Merging r37048, r37051, r37052, r37055 from the-real-msvc branch
[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 @@ -2431,6 +2431,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 @@ -2453,17 +2475,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 @@ -2493,6 +2504,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 Index: tooltips.c
86 ===================================================================
87 --- tooltips.c (revision 25790)
88 +++ tooltips.c (working copy)
89 @@ -2486,7 +2486,34 @@
90 TOOLTIPS_NotifyFormat (HWND hwnd, WPARAM wParam, LPARAM lParam)
91 {
92 FIXME ("hwnd=%p wParam=%lx lParam=%lx\n", hwnd, wParam, lParam);
93 + TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
94 + TTTOOL_INFO *toolPtr = infoPtr->tools;
95 + INT nResult;
96
97 + if (lParam == NF_QUERY)
98 + {
99 + if (toolPtr->bNotifyUnicode)
100 + {
101 + return NFR_UNICODE;
102 + } else {
103 + return NFR_ANSI;
104 + }
105 + }
106 + else if (lParam == NF_REQUERY)
107 + {
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 --- D:/Wine-CVS/wine/dlls/comctl32/treeview.c Sun Jun 15 18:29:21 2008
127 +++ D:/ReactOS-Trunk/reactos/dll/win32/comctl32/treeview.c Sun Jun 15 18:27:14 2008
128 @@ -2826,8 +2826,6 @@
129 }
130 }
131
132 - TREEVIEW_UpdateScrollBars(infoPtr);
133 -
134 if (infoPtr->cdmode & CDRF_NOTIFYPOSTPAINT)
135 infoPtr->cdmode =
136 TREEVIEW_SendCustomDrawNotify(infoPtr, CDDS_POSTPAINT, hdc, rect);