patch from Physicus, implement TOOLTIPS_NotifyFormat, it now retrurn the type of...
[reactos.git] / reactos / dll / win32 / comctl32 / comctl32_ros.diff
1 Index: listview.c
2 ===================================================================
3 --- listview.c (revision 23123)
4 +++ listview.c (working copy)
5 @@ -3777,9 +3777,8 @@
6 if (himl && lvItem.iImage >= 0 && !IsRectEmpty(&rcIcon))
7 {
8 TRACE("iImage=%d\n", lvItem.iImage);
9 + ImageList_Draw(himl, lvItem.iImage, hdc, rcIcon.left, rcIcon.top,
10 + (lvItem.state & LVIS_SELECTED) && (infoPtr->bFocus) ? ILD_SELECTED : ILD_NORMAL);
11 - ImageList_DrawEx(himl, lvItem.iImage, hdc, rcIcon.left, rcIcon.top,
12 - rcIcon.right - rcIcon.left, rcIcon.bottom - rcIcon.top, infoPtr->clrBk, CLR_DEFAULT,
13 - (lvItem.state & LVIS_SELECTED) && (infoPtr->bFocus) ? ILD_SELECTED : ILD_NORMAL);
14 }
15
16 /* Don't bother painting item being edited */
17 Index: propsheet.c
18 ===================================================================
19 --- propsheet.c (revision 25766)
20 +++ propsheet.c (working copy)
21 @@ -2422,6 +2422,28 @@
22 return FALSE;
23 }
24
25 +BOOL CALLBACK
26 +EnumChildProc(HWND hwnd, LPARAM lParam)
27 +{
28 + WCHAR szType[20];
29 + RealGetWindowClassW(hwnd, szType, 20);
30 +
31 + if (strcmpW(szType, WC_EDITW) == 0)
32 + {
33 + if (IsWindowEnabled(hwnd) && IsWindowVisible(hwnd))
34 + {
35 + SetFocus(hwnd);
36 + return FALSE;
37 + }
38 + }
39 + else
40 + {
41 + EnumChildWindows(hwnd, EnumChildProc, 0);
42 + }
43 +
44 + return TRUE;
45 +}
46 +
47 /******************************************************************************
48 * PROPSHEET_SetWizButtons
49 *
50 @@ -2444,17 +2466,6 @@
51 EnableWindow(hwndNext, FALSE);
52 EnableWindow(hwndFinish, FALSE);
53
54 - /* set the default pushbutton to an enabled button */
55 - if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH))
56 - SendMessageW(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0);
57 - else if (dwFlags & PSWIZB_NEXT)
58 - SendMessageW(hwndDlg, DM_SETDEFID, IDC_NEXT_BUTTON, 0);
59 - else if (dwFlags & PSWIZB_BACK)
60 - SendMessageW(hwndDlg, DM_SETDEFID, IDC_BACK_BUTTON, 0);
61 - else
62 - SendMessageW(hwndDlg, DM_SETDEFID, IDCANCEL, 0);
63 -
64 -
65 if (dwFlags & PSWIZB_BACK)
66 EnableWindow(hwndBack, TRUE);
67
68 @@ -2484,6 +2495,32 @@
69 }
70 else if (!(dwFlags & PSWIZB_DISABLEDFINISH))
71 EnableWindow(hwndFinish, TRUE);
72 +
73 + /* set the default pushbutton to an enabled button and give it focus */
74 + if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH))
75 + {
76 + SendMessageW(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0);
77 + SetFocus(hwndFinish);
78 + }
79 + else if (dwFlags & PSWIZB_NEXT)
80 + {
81 + SendMessageW(hwndDlg, DM_SETDEFID, IDC_NEXT_BUTTON, 0);
82 + SetFocus(hwndNext);
83 + }
84 + else if (dwFlags & PSWIZB_BACK)
85 + {
86 + SendMessageW(hwndDlg, DM_SETDEFID, IDC_BACK_BUTTON, 0);
87 + SetFocus(hwndBack);
88 + }
89 + else
90 + {
91 + SendMessageW(hwndDlg, DM_SETDEFID, IDCANCEL, 0);
92 + SetFocus(GetDlgItem(hwndDlg, IDCANCEL));
93 + }
94 +
95 + /* Now try to find an edit control that deserves focus */
96 + EnumChildWindows(PropSheet_GetCurrentPageHwnd(hwndDlg), EnumChildProc, 0);
97 +
98 }
99
100 /******************************************************************************
101 @@ -3548,7 +3585,7 @@
102
103 return FALSE;
104 }
105 -
106 +
107 case WM_SYSCOLORCHANGE:
108 COMCTL32_RefreshSysColors();
109 return FALSE;
110
111 Index: tooltips.c
112 ===================================================================
113 --- tooltips.c (revision 25790)
114 +++ tooltips.c (working copy)
115 @@ -2450,7 +2450,34 @@
116 TOOLTIPS_NotifyFormat (HWND hwnd, WPARAM wParam, LPARAM lParam)
117 {
118 FIXME ("hwnd=%p wParam=%x lParam=%lx\n", hwnd, wParam, lParam);
119 + TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
120 + TTTOOL_INFO *toolPtr = infoPtr->tools;
121 + INT nResult;
122
123 + if (lParam == NF_QUERY)
124 + {
125 + if (toolPtr->bNotifyUnicode)
126 + {
127 + return NFR_UNICODE;
128 + } else {
129 + return NFR_ANSI;
130 + }
131 + }
132 + else if (lParam == NF_REQUERY)
133 + {
134 + nResult = (INT) SendMessageW (toolPtr->hwnd, WM_NOTIFYFORMAT,
135 + (WPARAM)hwnd, (LPARAM)NF_QUERY);
136 + if (nResult == NFR_ANSI) {
137 + toolPtr->bNotifyUnicode = FALSE;
138 + TRACE(" -- WM_NOTIFYFORMAT returns: NFR_ANSI\n");
139 + } else if (nResult == NFR_UNICODE) {
140 + toolPtr->bNotifyUnicode = TRUE;
141 + TRACE(" -- WM_NOTIFYFORMAT returns: NFR_UNICODE\n");
142 + } else {
143 + TRACE (" -- WM_NOTIFYFORMAT returns: error!\n");
144 + }
145 + return nResult;
146 + }
147 return 0;
148 }
149