[COMCTL32]
[reactos.git] / reactos / 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 @@ -1634,8 +1635,19 @@
147 /* used to handle collapse main item column case */
148 static inline BOOL LISTVIEW_DrawFocusRect(const LISTVIEW_INFO *infoPtr, HDC hdc)
149 {
150 - return (infoPtr->rcFocus.left < infoPtr->rcFocus.right) ?
151 - DrawFocusRect(hdc, &infoPtr->rcFocus) : FALSE;
152 + BOOL Ret = FALSE;
153 +
154 + if (infoPtr->rcFocus.left < infoPtr->rcFocus.right)
155 + {
156 + DWORD dwOldBkColor, dwOldTextColor;
157 +
158 + dwOldBkColor = SetBkColor(hdc, RGB(255, 255, 255));
159 + dwOldTextColor = SetBkColor(hdc, RGB(0, 0, 0));
160 + Ret = DrawFocusRect(hdc, &infoPtr->rcFocus);
161 + SetBkColor(hdc, dwOldBkColor);
162 + SetBkColor(hdc, dwOldTextColor);
163 + }
164 + return Ret;
165 }
166
167 /* Listview invalidation functions: use _only_ these functions to invalidate */
168 @@ -5041,7 +5053,11 @@
169
170 /* Draw marquee rectangle if appropriate */
171 if (infoPtr->bMarqueeSelect)
172 + {
173 + SetBkColor(hdc, RGB(255, 255, 255));
174 + SetTextColor(hdc, RGB(0, 0, 0));
175 DrawFocusRect(hdc, &infoPtr->marqueeDrawRect);
176 + }
177
178 if (cdmode & CDRF_NOTIFYPOSTPAINT)
179 notify_postpaint(infoPtr, &nmlvcd);