dlls/comctl32/comboex.c - Implemented processing of WM_ENABLE =

Richard Bradbrook richard at bradders2000.co.uk
Sun Jul 31 12:01:23 CDT 2011


message=0A=
 dlls/user32/combo.c - Fixed wrong height of ownerdrawn combobox=0A=
=0A=
---=0A=
 dlls/comctl32/comboex.c |   21 ++++++++++++++++++---=0A=
 dlls/user32/combo.c     |    4 ++--=0A=
 2 files changed, 20 insertions(+), 5 deletions(-)=0A=
=0A=
diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c=0A=
index d6b0d8c..f6ff404 100644=0A=
--- a/dlls/comctl32/comboex.c=0A=
+++ b/dlls/comctl32/comboex.c=0A=
@@ -129,6 +129,7 @@ static LRESULT CALLBACK COMBOEX_EditWndProc (HWND =
hwnd, UINT uMsg, WPARAM wParam=0A=
 static LRESULT CALLBACK COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, =
WPARAM wParam, LPARAM lParam,=0A=
                                               UINT_PTR uId, DWORD_PTR =
ref_data);=0A=
 static LRESULT COMBOEX_Destroy (COMBOEX_INFO *infoPtr);=0A=
+static LRESULT COMBOEX_Enable (COMBOEX_INFO *infoPtr, BOOL enable);=0A=
 typedef INT (WINAPI *cmp_func_t)(LPCWSTR, LPCWSTR);=0A=
 =0A=
 static inline BOOL is_textW(LPCWSTR str)=0A=
@@ -1328,8 +1329,6 @@ static LRESULT COMBOEX_DrawItem (const =
COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT con=0A=
     COLORREF nbkc, ntxc, bkc, txc;=0A=
     int drawimage, drawstate, xioff;=0A=
 =0A=
-    if (!IsWindowEnabled(infoPtr->hwndCombo)) return 0;=0A=
-=0A=
     TRACE("DRAWITEMSTRUCT: CtlType=3D0x%08x CtlID=3D0x%08x\n",=0A=
 	  dis->CtlType, dis->CtlID);=0A=
     TRACE("itemID=3D0x%08x itemAction=3D0x%08x itemState=3D0x%08x\n",=0A=
@@ -1597,6 +1596,20 @@ static LRESULT COMBOEX_Destroy (COMBOEX_INFO =
*infoPtr)=0A=
     return 0;=0A=
 }=0A=
 =0A=
+static LRESULT COMBOEX_Enable (COMBOEX_INFO *infoPtr, BOOL enable)=0A=
+{=0A=
+    TRACE("hwnd=3D%p, enable=3D%s\n", infoPtr->hwndSelf, enable ? =
"TRUE":"FALSE");=0A=
+=0A=
+    if (infoPtr->hwndEdit)=0A=
+       EnableWindow(infoPtr->hwndEdit, enable);=0A=
+=0A=
+    EnableWindow(infoPtr->hwndCombo, enable);=0A=
+=0A=
+    /* Force the control to repaint when the enabled state changes. */=0A=
+    InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);=0A=
+=0A=
+    return 1;=0A=
+}=0A=
 =0A=
 static LRESULT COMBOEX_MeasureItem (COMBOEX_INFO const *infoPtr, =
MEASUREITEMSTRUCT *mis)=0A=
 {=0A=
@@ -1919,7 +1932,6 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM =
wParam, LPARAM lParam,=0A=
 =0A=
     switch (uMsg)=0A=
     {=0A=
-=0A=
     case WM_DRAWITEM:=0A=
 	    /*=0A=
 	     * The only way this message should come is from the=0A=
@@ -2278,6 +2290,9 @@ COMBOEX_WindowProc (HWND hwnd, UINT uMsg, WPARAM =
wParam, LPARAM lParam)=0A=
 	case WM_DESTROY:=0A=
 	    return COMBOEX_Destroy (infoPtr);=0A=
 =0A=
+        case WM_ENABLE:=0A=
+            return COMBOEX_Enable (infoPtr, (BOOL)wParam);=0A=
+=0A=
         case WM_MEASUREITEM:=0A=
             return COMBOEX_MeasureItem (infoPtr, (MEASUREITEMSTRUCT =
*)lParam);=0A=
 =0A=
diff --git a/dlls/user32/combo.c b/dlls/user32/combo.c=0A=
index 9c22df6..ef246db 100644=0A=
--- a/dlls/user32/combo.c=0A=
+++ b/dlls/user32/combo.c=0A=
@@ -262,10 +262,10 @@ static INT CBGetTextAreaHeight(=0A=
     measureItem.CtlID      =3D id;=0A=
     measureItem.itemID     =3D -1;=0A=
     measureItem.itemWidth  =3D clientRect.right;=0A=
-    measureItem.itemHeight =3D iTextItemHeight - 6; /* ownerdrawn cb is =
taller */=0A=
+    measureItem.itemHeight =3D iTextItemHeight;=0A=
     measureItem.itemData   =3D 0;=0A=
     SendMessageW(lphc->owner, WM_MEASUREITEM, id, (LPARAM)&measureItem);=0A=
-    iTextItemHeight =3D 6 + measureItem.itemHeight;=0A=
+    iTextItemHeight =3D 2 + measureItem.itemHeight; /* ownerdrawn cb is =
taller */=0A=
 =0A=
     /*=0A=
      * Send a second one in the case of a fixed ownerdraw list to =
calculate the=0A=
-- =0A=
1.7.4.1=0A=
=0A=

------=_NextPart_000_01CD_01CC4F7D.0B956C30--




More information about the wine-patches mailing list