[COMCTL32] -Implement BCM_GETTEXTMARGIN, BCM_SETTEXTMARGIN, BCM_SETIMAGELIST and...
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Sat, 25 Feb 2017 22:39:45 +0000 (22:39 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Sat, 25 Feb 2017 22:39:45 +0000 (22:39 +0000)
svn path=/trunk/; revision=73914

reactos/dll/win32/comctl32/button.c
reactos/dll/win32/comctl32/comctl32.h

index 820e56f..89ec414 100644 (file)
@@ -395,6 +395,8 @@ LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
             }
 
             memset(data, 0, sizeof(BUTTON_DATA));
+            SetRect(&data->rcTextMargin, 1,1,1,1);
+
             _SetButtonData(hWnd, data);
             break;
         }
@@ -448,6 +450,42 @@ LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
             }
             break;
         }
+        case BCM_GETTEXTMARGIN:
+        {
+            RECT* prc = (RECT*)lParam;
+            PBUTTON_DATA data = _GetButtonData(hWnd);
+            if (!prc || !data)
+                return FALSE;
+            *prc = data->rcTextMargin;
+            return TRUE;
+        }
+        case BCM_SETTEXTMARGIN:
+        {
+            RECT* prc = (RECT*)lParam;
+            PBUTTON_DATA data = _GetButtonData(hWnd);
+            if (!prc || !data)
+                return FALSE;
+            data->rcTextMargin = *prc;
+            return TRUE;
+        }
+        case BCM_SETIMAGELIST:
+        {
+            BUTTON_IMAGELIST * pimldata = (BUTTON_IMAGELIST *)lParam;
+            PBUTTON_DATA data = _GetButtonData(hWnd);
+            if (!data || !pimldata || !pimldata->himl)
+                return FALSE;
+            data->imlData = *pimldata;
+            return TRUE;
+        }
+        case BCM_GETIMAGELIST:
+        {
+            BUTTON_IMAGELIST * pimldata = (BUTTON_IMAGELIST *)lParam;
+            PBUTTON_DATA data = _GetButtonData(hWnd);
+            if (!data|| !pimldata)
+                return FALSE;
+            *pimldata = data->imlData;
+            return TRUE;
+        }
     }
 
     if (!_GetButtonData(hWnd))
index c19cfde..c677878 100644 (file)
@@ -81,6 +81,9 @@ typedef struct _BUTTON_DATA {
     HFONT font;
     LONG_PTR image;
     DWORD ui_state;
+
+    RECT rcTextMargin;
+    BUTTON_IMAGELIST imlData;
 } BUTTON_DATA, *PBUTTON_DATA;
 
 static inline PBUTTON_DATA _GetButtonData(HWND hwnd)