remove ros specific hack
[reactos.git] / reactos / dll / win32 / comctl32 / comctl32_ros.diff
1 Index: propsheet.c
2 ===================================================================
3 --- propsheet.c (revision 25766)
4 +++ propsheet.c (working copy)
5 @@ -2434,6 +2434,28 @@
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 * PROPSHEET_SetWizButtons
33 *
34 @@ -2456,17 +2478,6 @@
35 EnableWindow(hwndNext, FALSE);
36 EnableWindow(hwndFinish, FALSE);
37
38 - /* set the default pushbutton to an enabled button */
39 - if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH))
40 - SendMessageW(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0);
41 - else if (dwFlags & PSWIZB_NEXT)
42 - SendMessageW(hwndDlg, DM_SETDEFID, IDC_NEXT_BUTTON, 0);
43 - else if (dwFlags & PSWIZB_BACK)
44 - SendMessageW(hwndDlg, DM_SETDEFID, IDC_BACK_BUTTON, 0);
45 - else
46 - SendMessageW(hwndDlg, DM_SETDEFID, IDCANCEL, 0);
47 -
48 -
49 if (dwFlags & PSWIZB_BACK)
50 EnableWindow(hwndBack, TRUE);
51
52 @@ -2496,6 +2507,32 @@
53 }
54 else if (!(dwFlags & PSWIZB_DISABLEDFINISH))
55 EnableWindow(hwndFinish, TRUE);
56 +
57 + /* set the default pushbutton to an enabled button and give it focus */
58 + if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH))
59 + {
60 + SendMessageW(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0);
61 + SetFocus(hwndFinish);
62 + }
63 + else if (dwFlags & PSWIZB_NEXT)
64 + {
65 + SendMessageW(hwndDlg, DM_SETDEFID, IDC_NEXT_BUTTON, 0);
66 + SetFocus(hwndNext);
67 + }
68 + else if (dwFlags & PSWIZB_BACK)
69 + {
70 + SendMessageW(hwndDlg, DM_SETDEFID, IDC_BACK_BUTTON, 0);
71 + SetFocus(hwndBack);
72 + }
73 + else
74 + {
75 + SendMessageW(hwndDlg, DM_SETDEFID, IDCANCEL, 0);
76 + SetFocus(GetDlgItem(hwndDlg, IDCANCEL));
77 + }
78 +
79 + /* Now try to find an edit control that deserves focus */
80 + EnumChildWindows(PropSheet_GetCurrentPageHwnd(hwndDlg), EnumChildProc, 0);
81 +
82 }
83
84 /******************************************************************************
85 @@ -3555,6 +3558,8 @@
86 * from which to switch to the next page */
87 SendMessageW(hwndTabCtrl, TCM_SETCURSEL, psInfo->active_page, 0);
88
89 + PROPSHEET_UnChanged(hwnd, (HWND)wParam);
90 +
91 return TRUE;
92 }
93
94 Index: tooltips.c
95 ===================================================================
96 --- tooltips.c (revision 25790)
97 +++ tooltips.c (working copy)
98 @@ -2471,7 +2471,34 @@
99 TOOLTIPS_NotifyFormat (HWND hwnd, WPARAM wParam, LPARAM lParam)
100 {
101 FIXME ("hwnd=%p wParam=%lx lParam=%lx\n", hwnd, wParam, lParam);
102 + TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
103 + TTTOOL_INFO *toolPtr = infoPtr->tools;
104 + INT nResult;
105
106 + if (lParam == NF_QUERY)
107 + {
108 + if (toolPtr->bNotifyUnicode)
109 + {
110 + return NFR_UNICODE;
111 + } else {
112 + return NFR_ANSI;
113 + }
114 + }
115 + else if (lParam == NF_REQUERY)
116 + {
117 + nResult = (INT) SendMessageW (toolPtr->hwnd, WM_NOTIFYFORMAT,
118 + (WPARAM)hwnd, (LPARAM)NF_QUERY);
119 + if (nResult == NFR_ANSI) {
120 + toolPtr->bNotifyUnicode = FALSE;
121 + TRACE(" -- WM_NOTIFYFORMAT returns: NFR_ANSI\n");
122 + } else if (nResult == NFR_UNICODE) {
123 + toolPtr->bNotifyUnicode = TRUE;
124 + TRACE(" -- WM_NOTIFYFORMAT returns: NFR_UNICODE\n");
125 + } else {
126 + TRACE (" -- WM_NOTIFYFORMAT returns: error!\n");
127 + }
128 + return nResult;
129 + }
130 return 0;
131 }
132
133 Index: treeview.c
134 ===================================================================
135 --- treeview.c (revision 27134)
136 +++ treeview.c (working copy)
137 @@ -2844,8 +2844,6 @@
138 }
139 }
140
141 - TREEVIEW_UpdateScrollBars(infoPtr);
142 -
143 if (infoPtr->cdmode & CDRF_NOTIFYPOSTPAINT)
144 infoPtr->cdmode =
145 TREEVIEW_SendCustomDrawNotify(infoPtr, CDDS_POSTPAINT, hdc, rect);
146 @@ -4160,6 +4158,22 @@
147 static LRESULT
148 TREEVIEW_RButtonUp(const TREEVIEW_INFO *infoPtr, const POINT *pPt)
149 {
150 + TVHITTESTINFO ht;
151 +
152 + ht.pt = *pPt;
153 +
154 + TREEVIEW_HitTest(infoPtr, &ht);
155 +
156 + if (ht.hItem)
157 + {
158 + /* Change to screen coordinate for WM_CONTEXTMENU */
159 + ClientToScreen(infoPtr->hwnd, &ht.pt);
160 +
161 + /* Send a WM_CONTEXTMENU message in response to the RBUTTONUP */
162 + SendMessageW(infoPtr->hwnd, WM_CONTEXTMENU,
163 + (WPARAM)infoPtr->hwnd, MAKELPARAM(ht.pt.x, ht.pt.y));
164 + }
165 +
166 return 0;
167 }
168
169 Index: monthcal.c
170 ===================================================================
171 --- monthcal.c (revision 29360)
172 +++ monthcal.c (working copy)
173 @@ -1703,11 +1703,12 @@
174
175
176 static LRESULT
177 -MONTHCAL_KillFocus(const MONTHCAL_INFO *infoPtr)
178 +MONTHCAL_KillFocus(const MONTHCAL_INFO *infoPtr, HWND hFocusWnd)
179 {
180 TRACE("\n");
181
182 - InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
183 + if (infoPtr->hwndNotify != hFocusWnd)
184 + ShowWindow(infoPtr->hwndSelf, SW_HIDE);
185
186 return 0;
187 }
188 @@ -2015,7 +2016,7 @@
189 return DLGC_WANTARROWS | DLGC_WANTCHARS;
190
191 case WM_KILLFOCUS:
192 - return MONTHCAL_KillFocus(infoPtr);
193 + return MONTHCAL_KillFocus(infoPtr, wParam);
194
195 case WM_RBUTTONDOWN:
196 return MONTHCAL_RButtonDown(infoPtr, lParam);