[CMAKE]
[reactos.git] / dll / win32 / comctl32 / comctl32_ros.diff
1 Index: propsheet.c
2 ===================================================================
3 --- propsheet.c (revision 38890)
4 +++ propsheet.c (working copy)
5 @@ -2417,6 +2417,29 @@
6 return FALSE;
7 }
8
9 +BOOL CALLBACK
10 +EnumChildProc(HWND hwnd, LPARAM lParam)
11 +{
12 + WCHAR szType[20];
13 + RealGetWindowClassW(hwnd, szType, 20);
14 +
15 + if (strcmpW(szType, WC_EDITW) == 0)
16 + {
17 + if (IsWindowEnabled(hwnd) && IsWindowVisible(hwnd))
18 + {
19 + SetFocus(hwnd);
20 + return FALSE;
21 + }
22 + }
23 + else
24 + {
25 + EnumChildWindows(hwnd, EnumChildProc, 0);
26 + }
27 +
28 + return TRUE;
29 +}
30 +
31 +
32 /******************************************************************************
33 * PROPSHEET_SetWizButtons
34 *
35 @@ -2438,17 +2461,6 @@
36 EnableWindow(hwndNext, FALSE);
37 EnableWindow(hwndFinish, FALSE);
38
39 - /* set the default pushbutton to an enabled button */
40 - if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH))
41 - SendMessageW(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0);
42 - else if (dwFlags & PSWIZB_NEXT)
43 - SendMessageW(hwndDlg, DM_SETDEFID, IDC_NEXT_BUTTON, 0);
44 - else if (dwFlags & PSWIZB_BACK)
45 - SendMessageW(hwndDlg, DM_SETDEFID, IDC_BACK_BUTTON, 0);
46 - else
47 - SendMessageW(hwndDlg, DM_SETDEFID, IDCANCEL, 0);
48 -
49 -
50 if (dwFlags & PSWIZB_BACK)
51 EnableWindow(hwndBack, TRUE);
52
53 @@ -2478,6 +2490,31 @@
54 }
55 else if (!(dwFlags & PSWIZB_DISABLEDFINISH))
56 EnableWindow(hwndFinish, TRUE);
57 +
58 + /* set the default pushbutton to an enabled button and give it focus */
59 + if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH))
60 + {
61 + SendMessageW(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0);
62 + SetFocus(hwndFinish);
63 + }
64 + else if (dwFlags & PSWIZB_NEXT)
65 + {
66 + SendMessageW(hwndDlg, DM_SETDEFID, IDC_NEXT_BUTTON, 0);
67 + SetFocus(hwndNext);
68 + }
69 + else if (dwFlags & PSWIZB_BACK)
70 + {
71 + SendMessageW(hwndDlg, DM_SETDEFID, IDC_BACK_BUTTON, 0);
72 + SetFocus(hwndBack);
73 + }
74 + else
75 + {
76 + SendMessageW(hwndDlg, DM_SETDEFID, IDCANCEL, 0);
77 + SetFocus(GetDlgItem(hwndDlg, IDCANCEL));
78 + }
79 +
80 + /* Now try to find an edit control that deserves focus */
81 + EnumChildWindows(PropSheet_GetCurrentPageHwnd(hwndDlg), EnumChildProc, 0);
82 }
83
84 /******************************************************************************
85 Index: tooltips.c
86 ===================================================================
87 --- tooltips.c (revision 38890)
88 +++ tooltips.c (working copy)
89 @@ -2488,8 +2488,33 @@
90 static LRESULT
91 TOOLTIPS_NotifyFormat (HWND hwnd, WPARAM wParam, LPARAM lParam)
92 {
93 - FIXME ("hwnd=%p wParam=%lx lParam=%lx\n", hwnd, wParam, lParam);
94 + TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
95 + TTTOOL_INFO *toolPtr = infoPtr->tools;
96 + INT nResult;
97
98 + TRACE("hwnd=%p wParam=%lx lParam=%lx\n", hwnd, wParam, lParam);
99 +
100 + if (lParam == NF_QUERY) {
101 + if (toolPtr->bNotifyUnicode) {
102 + return NFR_UNICODE;
103 + } else {
104 + return NFR_ANSI;
105 + }
106 + }
107 + else if (lParam == NF_REQUERY) {
108 + nResult = (INT) SendMessageW (toolPtr->hwnd, WM_NOTIFYFORMAT,
109 + (WPARAM)hwnd, (LPARAM)NF_QUERY);
110 + if (nResult == NFR_ANSI) {
111 + toolPtr->bNotifyUnicode = FALSE;
112 + TRACE(" -- WM_NOTIFYFORMAT returns: NFR_ANSI\n");
113 + } else if (nResult == NFR_UNICODE) {
114 + toolPtr->bNotifyUnicode = TRUE;
115 + TRACE(" -- WM_NOTIFYFORMAT returns: NFR_UNICODE\n");
116 + } else {
117 + TRACE (" -- WM_NOTIFYFORMAT returns: error!\n");
118 + }
119 + return nResult;
120 + }
121 return 0;
122 }
123
124 Index: treeview.c
125 ===================================================================
126 --- treeview.c (revision 38890)
127 +++ treeview.c (working copy)
128 @@ -2830,7 +2830,12 @@
129 }
130 }
131
132 - TREEVIEW_UpdateScrollBars(infoPtr);
133 + //
134 + // This is correct, but is causes and infinite loop of WM_PAINT messages, resulting
135 + // in continuous painting of the scroll bar in reactos. Comment out until the real
136 + // bug is found
137 + //
138 + //TREEVIEW_UpdateScrollBars(infoPtr);
139
140 if (infoPtr->cdmode & CDRF_NOTIFYPOSTPAINT)
141 infoPtr->cdmode =
142 Index: listview.c
143 ===================================================================
144 --- listview.c (revision 51320)
145 +++ listview.c (working copy)
146 @@ -315,6 +315,7 @@
147 COLORREF clrBk;
148 COLORREF clrText;
149 COLORREF clrTextBk;
150 + BOOL bDefaultBkColor;
151
152 /* font */
153 HFONT hDefaultFont;
154 @@ -1635,8 +1636,19 @@
155 /* used to handle collapse main item column case */
156 static inline BOOL LISTVIEW_DrawFocusRect(const LISTVIEW_INFO *infoPtr, HDC hdc)
157 {
158 - return (infoPtr->rcFocus.left < infoPtr->rcFocus.right) ?
159 - DrawFocusRect(hdc, &infoPtr->rcFocus) : FALSE;
160 + BOOL Ret = FALSE;
161 +
162 + if (infoPtr->rcFocus.left < infoPtr->rcFocus.right)
163 + {
164 + DWORD dwOldBkColor, dwOldTextColor;
165 +
166 + dwOldBkColor = SetBkColor(hdc, RGB(255, 255, 255));
167 + dwOldTextColor = SetBkColor(hdc, RGB(0, 0, 0));
168 + Ret = DrawFocusRect(hdc, &infoPtr->rcFocus);
169 + SetBkColor(hdc, dwOldBkColor);
170 + SetBkColor(hdc, dwOldTextColor);
171 + }
172 + return Ret;
173 }
174
175 /* Listview invalidation functions: use _only_ these functions to invalidate */
176 @@ -5042,7 +5054,11 @@
177
178 /* Draw marquee rectangle if appropriate */
179 if (infoPtr->bMarqueeSelect)
180 + {
181 + SetBkColor(hdc, RGB(255, 255, 255));
182 + SetTextColor(hdc, RGB(0, 0, 0));
183 DrawFocusRect(hdc, &infoPtr->marqueeDrawRect);
184 + }
185
186 if (cdmode & CDRF_NOTIFYPOSTPAINT)
187 notify_postpaint(infoPtr, &nmlvcd);
188 @@ -7856,6 +7872,7 @@
189 {
190 TRACE("(clrBk=%x)\n", clrBk);
191
192 + infoPtr->bDefaultBkColor = FALSE;
193 if(infoPtr->clrBk != clrBk) {
194 if (infoPtr->clrBk != CLR_NONE) DeleteObject(infoPtr->hBkBrush);
195 infoPtr->clrBk = clrBk;
196 @@ -9248,6 +9265,7 @@
197 infoPtr->clrText = CLR_DEFAULT;
198 infoPtr->clrTextBk = CLR_DEFAULT;
199 LISTVIEW_SetBkColor(infoPtr, comctl32_color.clrWindow);
200 + infoPtr->bDefaultBkColor = TRUE;
201
202 /* set default values */
203 infoPtr->nFocusedItem = -1;
204 @@ -11510,6 +11528,11 @@
205
206 case WM_SYSCOLORCHANGE:
207 COMCTL32_RefreshSysColors();
208 + if (infoPtr->bDefaultBkColor)
209 + {
210 + LISTVIEW_SetBkColor(infoPtr, comctl32_color.clrWindow);
211 + infoPtr->bDefaultBkColor = TRUE;
212 + }
213 return 0;
214
215 /* case WM_TIMER: */
216 Index: rebar.c
217 ===================================================================
218 --- rebar.c (revision 51320)
219 +++ rebar.c (working copy)
220 @@ -51,7 +51,6 @@
221 * - WM_QUERYNEWPALETTE
222 * - WM_RBUTTONDOWN
223 * - WM_RBUTTONUP
224 - * - WM_SYSCOLORCHANGE
225 * - WM_VKEYTOITEM
226 * - WM_WININICHANGE
227 * Notifications:
228 @@ -2540,10 +2539,8 @@
229
230 /* initialize band */
231 memset(lpBand, 0, sizeof(*lpBand));
232 - lpBand->clrFore = infoPtr->clrText == CLR_NONE ? infoPtr->clrBtnText :
233 - infoPtr->clrText;
234 - lpBand->clrBack = infoPtr->clrBk == CLR_NONE ? infoPtr->clrBtnFace :
235 - infoPtr->clrBk;
236 + lpBand->clrFore = infoPtr->clrText;
237 + lpBand->clrBack = infoPtr->clrBk;
238 lpBand->iImage = -1;
239
240 REBAR_CommonSetupBand(infoPtr->hwndSelf, lprbbi, lpBand);
241 @@ -3793,6 +3790,8 @@
242
243 case WM_SYSCOLORCHANGE:
244 COMCTL32_RefreshSysColors();
245 + infoPtr->clrBtnText = comctl32_color.clrBtnText;
246 + infoPtr->clrBtnFace = comctl32_color.clrBtnFace;
247 return 0;
248
249 /* case WM_VKEYTOITEM: supported according to ControlSpy */