Author: cwittich Date: Wed Mar 5 17:15:10 2008 New Revision: 32572
URL: http://svn.reactos.org/svn/reactos?rev=3D32572&view=3Drev Log: some more syncing
Modified: trunk/reactos/dll/win32/user32/controls/combo.c trunk/reactos/dll/win32/user32/controls/listbox.c
Modified: trunk/reactos/dll/win32/user32/controls/combo.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/cont= rols/combo.c?rev=3D32572&r1=3D32571&r2=3D32572&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- trunk/reactos/dll/win32/user32/controls/combo.c (original) +++ trunk/reactos/dll/win32/user32/controls/combo.c Wed Mar 5 17:15:10 2008 @@ -15,17 +15,17 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 U= SA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, U= SA * * NOTES * * This code was audited for completeness against the documented features * of Comctl32.dll version 6.0 on Oct. 4, 2004, by Dimitrie O. Paun. - * + * =
* Unless otherwise noted, we believe this code to be complete, as per * the specification mentioned above. * If you discover missing features, or bugs, please note them below. - * + * =
* TODO: * - ComboBox_[GS]etMinVisible() * - CB_GETMINVISIBLE, CB_SETMINVISIBLE @@ -107,7 +107,7 @@ * * Load combo button bitmap. */ -static BOOL COMBO_Init() +static BOOL COMBO_Init(void) { HDC hDC; =
@@ -260,7 +260,7 @@ MEASUREITEMSTRUCT measureItem; RECT clientRect; INT originalItemHeight =3D iTextItemHeight; - UINT id =3D GetWindowLongPtrW( lphc->self, GWLP_ID ); + UINT id =3D (UINT)GetWindowLongPtrW( lphc->self, GWLP_ID ); =
/* * We use the client rect for the width of the item. @@ -441,8 +441,8 @@ } =
/* don't allow negative window width */ - if (lprEdit->right < lprEdit->left) - lprEdit->right =3D lprEdit->left; + if (lprEdit->right < lprEdit->left) + lprEdit->right =3D lprEdit->left; =
TRACE("\ttext\t=3D (%ld,%ld-%ld,%ld)\n", lprEdit->left, lprEdit->top, lprEdit->right, lprEdit->bottom); @@ -846,9 +846,9 @@ * CBPaintBorder */ static void CBPaintBorder( - HWND hwnd, - LPHEADCOMBO lphc, - HDC hdc) + HWND hwnd, + const HEADCOMBO *lphc, + HDC hdc) { RECT clientRect; =
@@ -1041,9 +1041,12 @@ } } =
- lphc->wState |=3D (CBF_NOEDITNOTIFY | CBF_NOLBSELECT); - SendMessageW(lphc->hWndEdit, WM_SETTEXT, 0, pText ? (LPARAM)pText : (LP= ARAM)empty_stringW); - lphc->wState &=3D ~(CBF_NOEDITNOTIFY | CBF_NOLBSELECT); + if( CB_HASSTRINGS(lphc) ) + { + lphc->wState |=3D (CBF_NOEDITNOTIFY | CBF_NOLBSELECT); + SendMessageW(lphc->hWndEdit, WM_SETTEXT, 0, pText ? (LPARAM)pText : = (LPARAM)empty_stringW); + lphc->wState &=3D ~(CBF_NOEDITNOTIFY | CBF_NOLBSELECT); + } =
if( lphc->wState & CBF_FOCUSED ) SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, (LPARAM)(-1)); @@ -1121,7 +1124,7 @@ if (nHeight < nDroppedHeight - COMBO_YBORDERSIZE()) nDroppedHeight =3D nHeight + COMBO_YBORDERSIZE(); =
- if (nDroppedHeight < nIHeight) + if (nDroppedHeight < nHeight) { if (nItems < 5) nDroppedHeight =3D (nItems+1)*nIHeight; @@ -1135,7 +1138,7 @@ mon_info.cbSize =3D sizeof(mon_info); GetMonitorInfoW( monitor, &mon_info ); =
- if( (rect.bottom + nDroppedHeight) >=3D GetSystemMetrics( SM_CYSCREEN )= ) + if( (rect.bottom + nDroppedHeight) >=3D mon_info.rcWork.bottom ) rect.bottom =3D rect.top - nDroppedHeight; =
SetWindowPos( lphc->hWndLBox, HWND_TOP, rect.left, rect.bottom, @@ -1163,7 +1166,7 @@ HWND hWnd =3D lphc->self; =
TRACE("[%p]: sel ok? [%i] dropped? [%i]\n", - lphc->self, (INT)ok, (INT)(lphc->wState & CBF_DROPPED)); + lphc->self, ok, (INT)(lphc->wState & CBF_DROPPED)); =
CB_NOTIFY( lphc, (ok) ? CBN_SELENDOK : CBN_SELENDCANCEL ); =
@@ -1319,7 +1322,7 @@ case (EN_CHANGE >> 8): /* * In some circumstances (when the selection of the combobox - * is changed for example) we don't wans the EN_CHANGE notification + * is changed for example) we don't want the EN_CHANGE notification * to be forwarded to the parent of the combobox. This code * checks a flag that is set in these occasions and ignores the * notification. @@ -1361,7 +1364,7 @@ case LBN_SELCHANGE: case LBN_SELCANCEL: =
- TRACE("[%p]: lbox selection change [%x]\n", lphc->self, lph= c->wState ); + TRACE("[%p]: lbox selection change [%x]\n", lphc->self, lp= hc->wState ); =
CB_NOTIFY( lphc, CBN_SELCHANGE ); =
@@ -1554,8 +1557,8 @@ */ static void CBResetPos( LPHEADCOMBO lphc, - LPRECT rectEdit, - LPRECT rectLB, + const RECT *rectEdit, + const RECT *rectLB, BOOL bRedraw) { BOOL bDrop =3D (CB_GETTYPE(lphc) !=3D CBS_SIMPLE); @@ -1711,8 +1714,8 @@ BOOL bButton; HWND hWnd =3D lphc->self; =
- pt.x =3D LOWORD(lParam); - pt.y =3D HIWORD(lParam); + pt.x =3D (short)LOWORD(lParam); + pt.y =3D (short)HIWORD(lParam); bButton =3D PtInRect(&lphc->buttonRect, pt); =
if( (CB_GETTYPE(lphc) =3D=3D CBS_DROPDOWNLIST) || @@ -1788,8 +1791,8 @@ POINT pt; RECT lbRect; =
- pt.x =3D LOWORD(lParam); - pt.y =3D HIWORD(lParam); + pt.x =3D (short)LOWORD(lParam); + pt.y =3D (short)HIWORD(lParam); =
if( lphc->wState & CBF_BUTTONDOWN ) { @@ -1817,7 +1820,7 @@ } } =
-static LRESULT COMBO_GetComboBoxInfo(LPHEADCOMBO lphc, COMBOBOXINFO *pcbi) +static LRESULT COMBO_GetComboBoxInfo(const HEADCOMBO *lphc, COMBOBOXINFO *= pcbi) { if (!pcbi || (pcbi->cbSize < sizeof(COMBOBOXINFO))) return FALSE; @@ -1851,14 +1854,14 @@ /*********************************************************************** * ComboWndProc_common * - * http://www.microsoft.com/msdn/sdk/platforms/doc/sdk/win32/ctrl/src/comb= obox_15.htm + * http://msdn.microsoft.com/library/default.asp?url=3D/library/en-us/shel= lcc/platform/commctls/comboboxes/comboboxes.asp */ static LRESULT ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, BOOL uni= code ) { LPHEADCOMBO lphc =3D (LPHEADCOMBO)GetWindowLongPtrW( hwnd, 0 ); =
- TRACE("[%p]: msg %s wp %08x lp %08lx\n", + TRACE("[%p]: msg %s wp %08lx lp %08lx\n", hwnd, SPY_GetMsgName(message, hwnd), wParam, lParam ); =
if( lphc || message =3D=3D WM_NCCREATE ) @@ -2128,6 +2131,7 @@ CharLowerA((LPSTR)lParam); else if( lphc->dwStyle & CBS_UPPERCASE ) CharUpperA((LPSTR)lParam); + return SendMessageA(lphc->hWndLBox, LB_INSERTSTRING, w= Param, lParam); } #ifndef __REACTOS__ @@ -2368,7 +2372,7 @@ =
default: if (message >=3D WM_USER) - WARN("unknown msg WM_USER+%04x wp=3D%04x lp=3D%08lx\n", + WARN("unknown msg WM_USER+%04x wp=3D%04lx lp=3D%08lx\n", message - WM_USER, wParam, lParam ); break; }
Modified: trunk/reactos/dll/win32/user32/controls/listbox.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/cont= rols/listbox.c?rev=3D32572&r1=3D32571&r2=3D32572&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- trunk/reactos/dll/win32/user32/controls/listbox.c (original) +++ trunk/reactos/dll/win32/user32/controls/listbox.c Wed Mar 5 17:15:10 2= 008 @@ -629,12 +629,12 @@ dis.hDC =3D hdc; dis.itemID =3D index; dis.itemState =3D 0; - if (item && item->selected) dis.itemState |=3D ODS_SELECTED; + if (item->selected) dis.itemState |=3D ODS_SELECTED; if (!ignoreFocus && (descr->focus_item =3D=3D index) && (descr->caret_on) && (descr->in_focus)) dis.itemState |=3D ODS_FOCUS; if (!IsWindowEnabled(descr->self)) dis.itemState |=3D ODS_DISABLED; - dis.itemData =3D item ? item->data : 0; + dis.itemData =3D item->data; dis.rcItem =3D *rect; TRACE("[%p]: drawitem %d (%s) action=3D%02x state=3D%02x rect=3D%l= d,%ld-%ld,%ld\n", descr->self, index, item ? debugstr_w(item->str) : "", actio= n, @@ -827,7 +827,7 @@ return TRUE; } if (!(descr->tabs =3D HeapAlloc( GetProcessHeap(), 0, - descr->nb_tabs * sizeof(INT) ))) + descr->nb_tabs * sizeof(INT) )= )) return FALSE; #ifndef __REACTOS__ if (short_ints) @@ -838,9 +838,9 @@ TRACE("[%p]: settabstops ", hwnd ); for (i =3D 0; i < descr->nb_tabs; i++) { descr->tabs[i] =3D *p++<<1; /* FIXME */ - if (TRACE_ON(listbox)) TRACE("%hd ", descr->tabs[i]); + TRACE("%hd ", descr->tabs[i]); } - if (TRACE_ON(listbox)) TRACE("\n"); + TRACE("\n"); } else memcpy( descr->tabs, tabs, descr->nb_tabs * sizeof(INT) ); #else