mirror of
https://github.com/reactos/reactos.git
synced 2025-05-05 09:57:04 +00:00
Sync to Wine-20050830:
Vitaliy Margolen <wine-patch@kievinfo.com> - Fix handling of minimum tab width. Add more tests to test it. Filip Navara <xnavara@volny.cz> - Use ReleaseDC instead of DeleteDC on DC handle. Phil Krylov <phil@newstar.rinet.ru> - Improved header control performance by maintaining an internal order array. - Draw header control items only within the header client area. Felix Nawothnig <felix.nawothnig@t-online.de> - Fix DPA_Search for sorted arrays. Michael Kaufmann <hallo@michael-kaufmann.ch> - Handle WM_GETFONT and WM_SETFONT. - Redraw immediately upon PBM_SETPOS, PBM_DELTAPOS, PBM_STEPIT. - New tests. Thomas Weidenmueller <wine-patches@reactsoft.com> - It should be allowed to pass NULL handles in the phpage array of the PROPSHEETHEADER structure to PropertySheet(), just ignore them. Aric Stewart <aric@codeweavers.com> - Fix for dreamweaver site definition dialog. Need to initialize the rect for a tab control to an empty rect if it is not visible. Alexandre Julliard <julliard@winehq.org> - Don't prefix the functions DllCanUnloadNow, DllGetClassObject and Dll(Un)RegisterServer with the dll name so that the compiler can check the prototypes. - Fixed regression in DPA_Search. Yuri Kozlov <kozlov.y@gmail.com> - Set default size for toolbar bitmap if not specified. Mike McCormack <mike@codeweavers.com> - Fix gcc 4.0 warnings. Vitaly Lipatov <lav@etersoft.ru> - Use STATEIMAGEINDEX / INDEXTOSTATEIMAGEMASK instead of bit operations. Steven Edwards <steven_ed4153@yahoo.com> - Correct RegCreateKeyEx[A/W] prototype to match the PSDK. Frank Richter <frank.richter@gmail.com> - Only draw a themed border when edit control has WS_EX_CLIENTEDGE style. - Merge subclass stubs and subclass proc. Having the stub set the window proc to the subclass proc was not a good idea since that breaks subclasses of themed standard controls (e.g. what Delphi does a lot). - Determining the superclass for a window subclassed for theming doesn't work - e.g. Delphi buttons have the classname "TButton" for which no superclass will be found. Instead, use initial subclass window procs that have the subclass hardcoded and store it for the "real" subclass window proc. - Add theming for toolbar control. - Improved trackbar theming. - Add initial theming support for trackbars. - Add theming for treeview control. - Add theming support for dialogs (to support tab page background). - Add theming for listbox (and combo listbox) controls. - Add theming for combo boxes. - Subclass edit control to draw themed border. - Added some generic code to allow subclassing (for the purpose of theming) of standard controls. - Fix warnings in 64bit. - Add hottracking support for the header control. - Since OpenThemeData() should return 0 in case theming is disabled globally or for the application we don't need to check that when calling OpenThemeData(). - Remove unneeded theming check. - Add theming for the monthcal control. - Instead of adding the border via WM_NCPAINT and WM_NCCALCSIZE, do what native does: just clear WS_EX_STATICEDGE when themed and reduce the area the actual bar is painted in to the progress bar theme part content rect. - Add theming for the progress control. - Split up the drawing code into a set of smaller functions and also moved some common computations into helper functions. All that to facilitate the implementation of the forthcoming theming support. - Add theming for the rebar control. - Add theming for status bar control. - Fix text color for "button" style tabs when theming is enabled. - Add theming support for the tab control. - Forward WM_DESTROY to superclass in edit & listbox theming. - Add WM_CTLCOLORSTATIC handler to dialog theming subclass so static text can appear transparent (for e.g. tab pages which commonly have a "fancy" background). svn path=/trunk/; revision=17664
This commit is contained in:
parent
ae18f3a1cc
commit
0389203146
29 changed files with 2552 additions and 827 deletions
|
@ -53,7 +53,7 @@ static struct {
|
|||
HMODULE hModule;
|
||||
HIC (WINAPI *fnICOpen)(DWORD, DWORD, UINT);
|
||||
LRESULT (WINAPI *fnICClose)(HIC);
|
||||
LRESULT (WINAPI *fnICSendMessage)(HIC, UINT, DWORD, DWORD);
|
||||
LRESULT (WINAPI *fnICSendMessage)(HIC, UINT, DWORD_PTR, DWORD_PTR);
|
||||
DWORD (WINAPIV *fnICDecompress)(HIC,DWORD,LPBITMAPINFOHEADER,LPVOID,LPBITMAPINFOHEADER,LPVOID);
|
||||
} fnIC;
|
||||
|
||||
|
@ -139,7 +139,8 @@ static BOOL ANIMATE_LoadFileW(ANIMATE_INFO *infoPtr, LPWSTR lpName)
|
|||
{
|
||||
infoPtr->hMMio = mmioOpenW(lpName, 0, MMIO_ALLOCBUF | MMIO_READ | MMIO_DENYWRITE);
|
||||
|
||||
return (BOOL)infoPtr->hMMio;
|
||||
if(!infoPtr->hMMio) return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -655,14 +656,14 @@ static BOOL ANIMATE_GetAviCodec(ANIMATE_INFO *infoPtr)
|
|||
}
|
||||
|
||||
outSize = fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_GET_FORMAT,
|
||||
(DWORD)infoPtr->inbih, 0L);
|
||||
(DWORD_PTR)infoPtr->inbih, 0L);
|
||||
|
||||
infoPtr->outbih = Alloc(outSize);
|
||||
if (!infoPtr->outbih)
|
||||
return FALSE;
|
||||
|
||||
if (fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_GET_FORMAT,
|
||||
(DWORD)infoPtr->inbih, (DWORD)infoPtr->outbih) != outSize)
|
||||
(DWORD_PTR)infoPtr->inbih, (DWORD_PTR)infoPtr->outbih) != outSize)
|
||||
{
|
||||
WARN("Can't get output BIH\n");
|
||||
return FALSE;
|
||||
|
@ -673,7 +674,7 @@ static BOOL ANIMATE_GetAviCodec(ANIMATE_INFO *infoPtr)
|
|||
return FALSE;
|
||||
|
||||
if (fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_BEGIN,
|
||||
(DWORD)infoPtr->inbih, (DWORD)infoPtr->outbih) != ICERR_OK) {
|
||||
(DWORD_PTR)infoPtr->inbih, (DWORD_PTR)infoPtr->outbih) != ICERR_OK) {
|
||||
WARN("Can't begin decompression\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -696,10 +697,10 @@ static BOOL ANIMATE_OpenW(ANIMATE_INFO *infoPtr, HINSTANCE hInstance, LPWSTR lps
|
|||
if (!hInstance)
|
||||
hInstance = (HINSTANCE)GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_HINSTANCE);
|
||||
|
||||
if (HIWORD(lpszName))
|
||||
{
|
||||
TRACE("(\"%s\");\n", debugstr_w(lpszName));
|
||||
TRACE("(%s)\n", debugstr_w(lpszName));
|
||||
|
||||
if (HIWORD(lpszName))
|
||||
{
|
||||
if (!ANIMATE_LoadResW(infoPtr, hInstance, lpszName))
|
||||
{
|
||||
TRACE("No AVI resource found!\n");
|
||||
|
@ -712,9 +713,7 @@ static BOOL ANIMATE_OpenW(ANIMATE_INFO *infoPtr, HINSTANCE hInstance, LPWSTR lps
|
|||
}
|
||||
else
|
||||
{
|
||||
TRACE("(%u);\n", (WORD)(DWORD)lpszName);
|
||||
|
||||
if (!ANIMATE_LoadResW(infoPtr, hInstance, MAKEINTRESOURCEW((INT)lpszName)))
|
||||
if (!ANIMATE_LoadResW(infoPtr, hInstance, lpszName))
|
||||
{
|
||||
WARN("No AVI resource found!\n");
|
||||
return FALSE;
|
||||
|
|
|
@ -839,10 +839,10 @@ COMBOEX_FindStringExact (COMBOEX_INFO *infoPtr, INT start, LPCWSTR str)
|
|||
}
|
||||
|
||||
|
||||
static DWORD COMBOEX_GetItemData (COMBOEX_INFO *infoPtr, INT index)
|
||||
static DWORD_PTR COMBOEX_GetItemData (COMBOEX_INFO *infoPtr, INT index)
|
||||
{
|
||||
CBE_ITEMDATA *item1, *item2;
|
||||
DWORD ret = 0;
|
||||
DWORD_PTR ret = 0;
|
||||
|
||||
item1 = get_item_data(infoPtr, index);
|
||||
if ((item1 != NULL) && ((LRESULT)item1 != CB_ERR)) {
|
||||
|
@ -854,7 +854,7 @@ static DWORD COMBOEX_GetItemData (COMBOEX_INFO *infoPtr, INT index)
|
|||
if (item1->mask & CBEIF_LPARAM) ret = item1->lParam;
|
||||
TRACE("returning 0x%08lx\n", ret);
|
||||
} else {
|
||||
ret = (DWORD)item1;
|
||||
ret = (DWORD_PTR)item1;
|
||||
TRACE("non-valid result from combo, returning 0x%08lx\n", ret);
|
||||
}
|
||||
return ret;
|
||||
|
@ -878,7 +878,7 @@ static INT COMBOEX_SetCursel (COMBOEX_INFO *infoPtr, INT index)
|
|||
}
|
||||
|
||||
|
||||
static DWORD COMBOEX_SetItemData (COMBOEX_INFO *infoPtr, INT index, DWORD data)
|
||||
static DWORD_PTR COMBOEX_SetItemData (COMBOEX_INFO *infoPtr, INT index, DWORD_PTR data)
|
||||
{
|
||||
CBE_ITEMDATA *item1, *item2;
|
||||
|
||||
|
@ -894,8 +894,8 @@ static DWORD COMBOEX_SetItemData (COMBOEX_INFO *infoPtr, INT index, DWORD data)
|
|||
TRACE("setting lparam to 0x%08lx\n", data);
|
||||
return 0;
|
||||
}
|
||||
TRACE("non-valid result from combo 0x%08lx\n", (DWORD)item1);
|
||||
return (LRESULT)item1;
|
||||
TRACE("non-valid result from combo %p\n", item1);
|
||||
return (DWORD_PTR)item1;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1136,10 +1136,10 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam, LPARAM lPa
|
|||
n = SendMessageW (infoPtr->hwndCombo, CB_GETCOUNT, 0, 0);
|
||||
for (cursel = 0; cursel < n; cursel++){
|
||||
item = get_item_data(infoPtr, cursel);
|
||||
if ((INT)item == CB_ERR) break;
|
||||
if ((INT_PTR)item == CB_ERR) break;
|
||||
if (!cmptext(COMBOEX_GetText(infoPtr, item), wintext)) break;
|
||||
}
|
||||
if ((cursel == n) || ((INT)item == CB_ERR)) {
|
||||
if ((cursel == n) || ((INT_PTR)item == CB_ERR)) {
|
||||
TRACE("failed to find match??? item=%p cursel=%d\n",
|
||||
item, cursel);
|
||||
if (infoPtr->hwndEdit)
|
||||
|
@ -1149,7 +1149,7 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam, LPARAM lPa
|
|||
}
|
||||
else {
|
||||
item = get_item_data(infoPtr, cursel);
|
||||
if ((INT)item == CB_ERR) {
|
||||
if ((INT_PTR)item == CB_ERR) {
|
||||
TRACE("failed to find match??? item=%p cursel=%d\n",
|
||||
item, cursel);
|
||||
if (infoPtr->hwndEdit)
|
||||
|
@ -2223,7 +2223,7 @@ COMBOEX_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
return COMBOEX_SetCursel (infoPtr, (INT)wParam);
|
||||
|
||||
case CB_SETITEMDATA:
|
||||
return COMBOEX_SetItemData (infoPtr, (INT)wParam, (DWORD)lParam);
|
||||
return COMBOEX_SetItemData (infoPtr, (INT)wParam, (DWORD_PTR)lParam);
|
||||
|
||||
case CB_SETITEMHEIGHT:
|
||||
return COMBOEX_SetItemHeight (infoPtr, (INT)wParam, (UINT)lParam);
|
||||
|
|
|
@ -249,4 +249,8 @@ static inline void MONTHCAL_CopyTime(const SYSTEMTIME *from, SYSTEMTIME *to)
|
|||
to->wMilliseconds = from->wMilliseconds;
|
||||
}
|
||||
|
||||
extern void THEMING_Initialize(void);
|
||||
extern LRESULT THEMING_CallOriginalClass(HWND, UINT, WPARAM, LPARAM);
|
||||
extern void THEMING_SetSubclassData(HWND, ULONG_PTR);
|
||||
|
||||
#endif /* __WINE_COMCTL32_H */
|
||||
|
|
|
@ -1,188 +1,188 @@
|
|||
# Functions exported by the Win95 comctl32.dll
|
||||
# (these need to have these exact ordinals, because some win95 dlls
|
||||
# import comctl32.dll by ordinal)
|
||||
# This list was created from a comctl32.dll v5.81 (IE5.01).
|
||||
|
||||
2 stdcall MenuHelp(long long long long long long ptr)
|
||||
3 stdcall ShowHideMenuCtl(long long ptr)
|
||||
4 stdcall GetEffectiveClientRect(long long long)
|
||||
5 stdcall DrawStatusTextA(long ptr str long)
|
||||
6 stdcall CreateStatusWindowA(long str long long)
|
||||
7 stdcall CreateToolbar(long long long long long long ptr long)
|
||||
8 stdcall CreateMappedBitmap(long long long ptr long)
|
||||
9 stdcall -noname DPA_LoadStream(ptr ptr ptr long)
|
||||
10 stdcall -noname DPA_SaveStream(ptr ptr ptr long)
|
||||
11 stdcall -noname DPA_Merge(ptr ptr long ptr ptr long)
|
||||
#12 stub Cctl1632_ThunkData32
|
||||
13 stdcall MakeDragList(long)
|
||||
14 stdcall LBItemFromPt(long long long long)
|
||||
15 stdcall DrawInsert(long long long)
|
||||
16 stdcall CreateUpDownControl(long long long long long long long long long long long long)
|
||||
17 stdcall InitCommonControls()
|
||||
71 stdcall -noname Alloc(long)
|
||||
72 stdcall -noname ReAlloc(ptr long)
|
||||
73 stdcall -noname Free(ptr)
|
||||
74 stdcall -noname GetSize(ptr)
|
||||
151 stdcall -noname CreateMRUListA(ptr)
|
||||
152 stdcall -noname FreeMRUList(long)
|
||||
153 stdcall -noname AddMRUStringA(long str)
|
||||
154 stdcall -noname EnumMRUListA(long long ptr long)
|
||||
155 stdcall -noname FindMRUStringA(long str ptr)
|
||||
156 stdcall -noname DelMRUString(long long)
|
||||
157 stdcall -noname CreateMRUListLazyA(ptr long long long)
|
||||
163 stub -noname CreatePage
|
||||
164 stub -noname CreateProxyPage
|
||||
167 stdcall -noname AddMRUData(long ptr long)
|
||||
169 stdcall -noname FindMRUData(long ptr long ptr)
|
||||
233 stdcall -noname Str_GetPtrA(str str long)
|
||||
234 stdcall -noname Str_SetPtrA(str str)
|
||||
235 stdcall -noname Str_GetPtrW(wstr wstr long)
|
||||
236 stdcall -noname Str_SetPtrW(wstr wstr)
|
||||
320 stdcall -noname DSA_Create(long long)
|
||||
321 stdcall -noname DSA_Destroy(ptr)
|
||||
322 stdcall -noname DSA_GetItem(ptr long long)
|
||||
323 stdcall -noname DSA_GetItemPtr(ptr long)
|
||||
324 stdcall -noname DSA_InsertItem(ptr long long)
|
||||
325 stdcall -noname DSA_SetItem (ptr long long)
|
||||
326 stdcall -noname DSA_DeleteItem(ptr long)
|
||||
327 stdcall -noname DSA_DeleteAllItems(ptr)
|
||||
328 stdcall -noname DPA_Create(long)
|
||||
329 stdcall -noname DPA_Destroy(ptr)
|
||||
330 stdcall -noname DPA_Grow(ptr long)
|
||||
331 stdcall -noname DPA_Clone(ptr ptr)
|
||||
332 stdcall -noname DPA_GetPtr(ptr long)
|
||||
333 stdcall -noname DPA_GetPtrIndex(ptr ptr)
|
||||
334 stdcall -noname DPA_InsertPtr(ptr long ptr)
|
||||
335 stdcall -noname DPA_SetPtr(ptr long ptr)
|
||||
336 stdcall -noname DPA_DeletePtr(ptr long)
|
||||
337 stdcall -noname DPA_DeleteAllPtrs(ptr)
|
||||
338 stdcall -noname DPA_Sort(ptr ptr long)
|
||||
339 stdcall -noname DPA_Search(ptr ptr long ptr long long)
|
||||
340 stdcall -noname DPA_CreateEx(long long)
|
||||
341 stdcall -noname SendNotify(long long long ptr)
|
||||
342 stdcall -noname SendNotifyEx(long long long ptr long)
|
||||
350 stdcall -noname StrChrA(str str)
|
||||
351 stdcall -noname StrRChrA(str str long)
|
||||
352 stdcall -noname StrCmpNA(str str long)
|
||||
353 stdcall -noname StrCmpNIA(str str long)
|
||||
354 stdcall -noname StrStrA(str str)
|
||||
355 stdcall -noname StrStrIA(str str)
|
||||
356 stdcall -noname StrCSpnA(str str)
|
||||
357 stdcall -noname StrToIntA(str)
|
||||
358 stdcall -noname StrChrW(wstr long)
|
||||
359 stdcall -noname StrRChrW(wstr wstr long)
|
||||
360 stdcall -noname StrCmpNW(wstr wstr long)
|
||||
361 stdcall -noname StrCmpNIW(wstr wstr long)
|
||||
362 stdcall -noname StrStrW(wstr wstr)
|
||||
363 stdcall -noname StrStrIW(wstr wstr)
|
||||
364 stdcall -noname StrCSpnW(wstr wstr)
|
||||
365 stdcall -noname StrToIntW(wstr)
|
||||
366 stdcall -noname StrChrIA(str long)
|
||||
367 stdcall -noname StrChrIW(wstr long)
|
||||
368 stdcall -noname StrRChrIA(str str long)
|
||||
369 stdcall -noname StrRChrIW(wstr wstr long)
|
||||
372 stdcall -noname StrRStrIA(str str str)
|
||||
373 stdcall -noname StrRStrIW(wstr wstr wstr)
|
||||
374 stdcall -noname StrCSpnIA(str str)
|
||||
375 stdcall -noname StrCSpnIW(wstr wstr)
|
||||
376 stdcall -noname IntlStrEqWorkerA(long str str long)
|
||||
377 stdcall -noname IntlStrEqWorkerW(long wstr wstr long)
|
||||
382 stdcall -noname SmoothScrollWindow(ptr)
|
||||
383 stub -noname DoReaderMode
|
||||
384 stdcall -noname SetPathWordBreakProc(ptr long)
|
||||
385 stdcall -noname DPA_EnumCallback(long long long)
|
||||
386 stdcall -noname DPA_DestroyCallback(ptr ptr long)
|
||||
387 stdcall -noname DSA_EnumCallback(ptr ptr long)
|
||||
388 stdcall -noname DSA_DestroyCallback(ptr ptr long)
|
||||
389 stub -noname SHGetProcessDword
|
||||
390 stdcall -noname ImageList_SetColorTable(ptr long long ptr)
|
||||
400 stdcall -noname CreateMRUListW(ptr)
|
||||
401 stdcall -noname AddMRUStringW(long wstr)
|
||||
402 stdcall -noname FindMRUStringW(long wstr ptr)
|
||||
403 stdcall -noname EnumMRUListW(long long ptr long)
|
||||
404 stdcall -noname CreateMRUListLazyW(ptr long long long)
|
||||
410 stdcall -noname SetWindowSubclass(long ptr long long)
|
||||
411 stdcall -noname GetWindowSubclass(long ptr long ptr)
|
||||
412 stdcall -noname RemoveWindowSubclass(long ptr long)
|
||||
413 stdcall -noname DefSubclassProc(long long long long)
|
||||
414 stdcall -noname MirrorIcon(ptr ptr)
|
||||
415 stdcall DrawTextWrap(long wstr long ptr long) user32.DrawTextW
|
||||
416 stdcall DrawTextExPrivWrap(long wstr long ptr long ptr) user32.DrawTextExW
|
||||
417 stdcall ExtTextOutWrap(long long long long ptr wstr long ptr) gdi32.ExtTextOutW
|
||||
418 stdcall GetCharWidthWrap(long long long long) gdi32.GetCharWidthW
|
||||
419 stdcall GetTextExtentPointWrap(long wstr long ptr) gdi32.GetTextExtentPointW
|
||||
420 stdcall GetTextExtentPoint32Wrap(long wstr long ptr) gdi32.GetTextExtentPoint32W
|
||||
421 stdcall TextOutWrap(long long long wstr long) gdi32.TextOutW
|
||||
|
||||
# Functions imported by name
|
||||
|
||||
@ stdcall CreatePropertySheetPage(ptr) CreatePropertySheetPageA
|
||||
@ stdcall CreatePropertySheetPageA(ptr)
|
||||
@ stdcall CreatePropertySheetPageW(ptr)
|
||||
@ stdcall CreateStatusWindow(long str long long) CreateStatusWindowA
|
||||
@ stdcall CreateStatusWindowW(long wstr long long)
|
||||
@ stdcall CreateToolbarEx(long long long long long long ptr long long long long long long)
|
||||
@ stdcall DestroyPropertySheetPage(long)
|
||||
@ stdcall DllGetVersion(ptr) COMCTL32_DllGetVersion
|
||||
@ stdcall DllInstall(long ptr) COMCTL32_DllInstall
|
||||
@ stdcall DrawStatusText(long ptr ptr long) DrawStatusTextA
|
||||
@ stdcall DrawStatusTextW(long ptr wstr long)
|
||||
@ stdcall FlatSB_EnableScrollBar (long long long)
|
||||
@ stdcall FlatSB_GetScrollInfo (long long ptr)
|
||||
@ stdcall FlatSB_GetScrollPos (long long)
|
||||
@ stdcall FlatSB_GetScrollProp (long long ptr)
|
||||
@ stdcall FlatSB_GetScrollRange (long long ptr ptr)
|
||||
@ stdcall FlatSB_SetScrollInfo (long long ptr long)
|
||||
@ stdcall FlatSB_SetScrollPos (long long long long)
|
||||
@ stdcall FlatSB_SetScrollProp (long long long long)
|
||||
@ stdcall FlatSB_SetScrollRange (long long long long long)
|
||||
@ stdcall FlatSB_ShowScrollBar (long long long)
|
||||
@ stdcall GetMUILanguage()
|
||||
@ stdcall ImageList_Add(ptr long long)
|
||||
@ stdcall ImageList_AddIcon(ptr long)
|
||||
@ stdcall ImageList_AddMasked(ptr long long)
|
||||
@ stdcall ImageList_BeginDrag(ptr long long long)
|
||||
@ stdcall ImageList_Copy(ptr long ptr long long)
|
||||
@ stdcall ImageList_Create(long long long long long)
|
||||
@ stdcall ImageList_Destroy(ptr)
|
||||
@ stdcall ImageList_DragEnter(long long long)
|
||||
@ stdcall ImageList_DragLeave(long)
|
||||
@ stdcall ImageList_DragMove(long long)
|
||||
@ stdcall ImageList_DragShowNolock(long)
|
||||
@ stdcall ImageList_Draw(ptr long long long long long)
|
||||
@ stdcall ImageList_DrawEx(ptr long long long long long long long long long)
|
||||
@ stdcall ImageList_DrawIndirect(ptr)
|
||||
@ stdcall ImageList_Duplicate(ptr)
|
||||
@ stdcall ImageList_EndDrag()
|
||||
@ stdcall ImageList_GetBkColor(ptr)
|
||||
@ stdcall ImageList_GetDragImage(ptr ptr)
|
||||
@ stdcall ImageList_GetFlags(ptr)
|
||||
@ stdcall ImageList_GetIcon(ptr long long)
|
||||
@ stdcall ImageList_GetIconSize(ptr ptr ptr)
|
||||
@ stdcall ImageList_GetImageCount(ptr)
|
||||
@ stdcall ImageList_GetImageInfo(ptr long ptr)
|
||||
@ stdcall ImageList_GetImageRect(ptr long ptr)
|
||||
@ stdcall ImageList_LoadImage(long str long long long long long) ImageList_LoadImageA
|
||||
@ stdcall ImageList_LoadImageA(long str long long long long long)
|
||||
@ stdcall ImageList_LoadImageW(long wstr long long long long long)
|
||||
@ stdcall ImageList_Merge(ptr long ptr long long long)
|
||||
@ stdcall ImageList_Read(ptr)
|
||||
@ stdcall ImageList_Remove(ptr long)
|
||||
@ stdcall ImageList_Replace(ptr long long long)
|
||||
@ stdcall ImageList_ReplaceIcon(ptr long long)
|
||||
@ stdcall ImageList_SetBkColor(ptr long)
|
||||
@ stdcall ImageList_SetDragCursorImage(ptr long long long)
|
||||
@ stdcall ImageList_SetFilter(ptr long long)
|
||||
@ stdcall ImageList_SetFlags(ptr long)
|
||||
@ stdcall ImageList_SetIconSize(ptr long long)
|
||||
@ stdcall ImageList_SetImageCount(ptr long)
|
||||
@ stdcall ImageList_SetOverlayImage(ptr long long)
|
||||
@ stdcall ImageList_Write(ptr ptr)
|
||||
@ stdcall InitCommonControlsEx(ptr)
|
||||
@ stdcall InitMUILanguage(long)
|
||||
@ stdcall InitializeFlatSB(long)
|
||||
@ stdcall PropertySheet(ptr) PropertySheetA
|
||||
@ stdcall PropertySheetA(ptr)
|
||||
@ stdcall PropertySheetW(ptr)
|
||||
@ stdcall UninitializeFlatSB(long)
|
||||
@ stdcall _TrackMouseEvent(ptr)
|
||||
# Functions exported by the Win95 comctl32.dll
|
||||
# (these need to have these exact ordinals, because some win95 dlls
|
||||
# import comctl32.dll by ordinal)
|
||||
# This list was created from a comctl32.dll v5.81 (IE5.01).
|
||||
|
||||
2 stdcall MenuHelp(long long long long long long ptr)
|
||||
3 stdcall ShowHideMenuCtl(long long ptr)
|
||||
4 stdcall GetEffectiveClientRect(long long long)
|
||||
5 stdcall DrawStatusTextA(long ptr str long)
|
||||
6 stdcall CreateStatusWindowA(long str long long)
|
||||
7 stdcall CreateToolbar(long long long long long long ptr long)
|
||||
8 stdcall CreateMappedBitmap(long long long ptr long)
|
||||
9 stdcall -noname DPA_LoadStream(ptr ptr ptr long)
|
||||
10 stdcall -noname DPA_SaveStream(ptr ptr ptr long)
|
||||
11 stdcall -noname DPA_Merge(ptr ptr long ptr ptr long)
|
||||
#12 stub Cctl1632_ThunkData32
|
||||
13 stdcall MakeDragList(long)
|
||||
14 stdcall LBItemFromPt(long long long long)
|
||||
15 stdcall DrawInsert(long long long)
|
||||
16 stdcall CreateUpDownControl(long long long long long long long long long long long long)
|
||||
17 stdcall InitCommonControls()
|
||||
71 stdcall -noname Alloc(long)
|
||||
72 stdcall -noname ReAlloc(ptr long)
|
||||
73 stdcall -noname Free(ptr)
|
||||
74 stdcall -noname GetSize(ptr)
|
||||
151 stdcall -noname CreateMRUListA(ptr)
|
||||
152 stdcall -noname FreeMRUList(long)
|
||||
153 stdcall -noname AddMRUStringA(long str)
|
||||
154 stdcall -noname EnumMRUListA(long long ptr long)
|
||||
155 stdcall -noname FindMRUStringA(long str ptr)
|
||||
156 stdcall -noname DelMRUString(long long)
|
||||
157 stdcall -noname CreateMRUListLazyA(ptr long long long)
|
||||
163 stub -noname CreatePage
|
||||
164 stub -noname CreateProxyPage
|
||||
167 stdcall -noname AddMRUData(long ptr long)
|
||||
169 stdcall -noname FindMRUData(long ptr long ptr)
|
||||
233 stdcall -noname Str_GetPtrA(str str long)
|
||||
234 stdcall -noname Str_SetPtrA(str str)
|
||||
235 stdcall -noname Str_GetPtrW(wstr wstr long)
|
||||
236 stdcall -noname Str_SetPtrW(wstr wstr)
|
||||
320 stdcall -noname DSA_Create(long long)
|
||||
321 stdcall -noname DSA_Destroy(ptr)
|
||||
322 stdcall -noname DSA_GetItem(ptr long long)
|
||||
323 stdcall -noname DSA_GetItemPtr(ptr long)
|
||||
324 stdcall -noname DSA_InsertItem(ptr long long)
|
||||
325 stdcall -noname DSA_SetItem (ptr long long)
|
||||
326 stdcall -noname DSA_DeleteItem(ptr long)
|
||||
327 stdcall -noname DSA_DeleteAllItems(ptr)
|
||||
328 stdcall -noname DPA_Create(long)
|
||||
329 stdcall -noname DPA_Destroy(ptr)
|
||||
330 stdcall -noname DPA_Grow(ptr long)
|
||||
331 stdcall -noname DPA_Clone(ptr ptr)
|
||||
332 stdcall -noname DPA_GetPtr(ptr long)
|
||||
333 stdcall -noname DPA_GetPtrIndex(ptr ptr)
|
||||
334 stdcall -noname DPA_InsertPtr(ptr long ptr)
|
||||
335 stdcall -noname DPA_SetPtr(ptr long ptr)
|
||||
336 stdcall -noname DPA_DeletePtr(ptr long)
|
||||
337 stdcall -noname DPA_DeleteAllPtrs(ptr)
|
||||
338 stdcall -noname DPA_Sort(ptr ptr long)
|
||||
339 stdcall -noname DPA_Search(ptr ptr long ptr long long)
|
||||
340 stdcall -noname DPA_CreateEx(long long)
|
||||
341 stdcall -noname SendNotify(long long long ptr)
|
||||
342 stdcall -noname SendNotifyEx(long long long ptr long)
|
||||
350 stdcall -noname StrChrA(str str)
|
||||
351 stdcall -noname StrRChrA(str str long)
|
||||
352 stdcall -noname StrCmpNA(str str long)
|
||||
353 stdcall -noname StrCmpNIA(str str long)
|
||||
354 stdcall -noname StrStrA(str str)
|
||||
355 stdcall -noname StrStrIA(str str)
|
||||
356 stdcall -noname StrCSpnA(str str)
|
||||
357 stdcall -noname StrToIntA(str)
|
||||
358 stdcall -noname StrChrW(wstr long)
|
||||
359 stdcall -noname StrRChrW(wstr wstr long)
|
||||
360 stdcall -noname StrCmpNW(wstr wstr long)
|
||||
361 stdcall -noname StrCmpNIW(wstr wstr long)
|
||||
362 stdcall -noname StrStrW(wstr wstr)
|
||||
363 stdcall -noname StrStrIW(wstr wstr)
|
||||
364 stdcall -noname StrCSpnW(wstr wstr)
|
||||
365 stdcall -noname StrToIntW(wstr)
|
||||
366 stdcall -noname StrChrIA(str long)
|
||||
367 stdcall -noname StrChrIW(wstr long)
|
||||
368 stdcall -noname StrRChrIA(str str long)
|
||||
369 stdcall -noname StrRChrIW(wstr wstr long)
|
||||
372 stdcall -noname StrRStrIA(str str str)
|
||||
373 stdcall -noname StrRStrIW(wstr wstr wstr)
|
||||
374 stdcall -noname StrCSpnIA(str str)
|
||||
375 stdcall -noname StrCSpnIW(wstr wstr)
|
||||
376 stdcall -noname IntlStrEqWorkerA(long str str long)
|
||||
377 stdcall -noname IntlStrEqWorkerW(long wstr wstr long)
|
||||
382 stdcall -noname SmoothScrollWindow(ptr)
|
||||
383 stub -noname DoReaderMode
|
||||
384 stdcall -noname SetPathWordBreakProc(ptr long)
|
||||
385 stdcall -noname DPA_EnumCallback(long long long)
|
||||
386 stdcall -noname DPA_DestroyCallback(ptr ptr long)
|
||||
387 stdcall -noname DSA_EnumCallback(ptr ptr long)
|
||||
388 stdcall -noname DSA_DestroyCallback(ptr ptr long)
|
||||
389 stub -noname SHGetProcessDword
|
||||
390 stdcall -noname ImageList_SetColorTable(ptr long long ptr)
|
||||
400 stdcall -noname CreateMRUListW(ptr)
|
||||
401 stdcall -noname AddMRUStringW(long wstr)
|
||||
402 stdcall -noname FindMRUStringW(long wstr ptr)
|
||||
403 stdcall -noname EnumMRUListW(long long ptr long)
|
||||
404 stdcall -noname CreateMRUListLazyW(ptr long long long)
|
||||
410 stdcall -noname SetWindowSubclass(long ptr long long)
|
||||
411 stdcall -noname GetWindowSubclass(long ptr long ptr)
|
||||
412 stdcall -noname RemoveWindowSubclass(long ptr long)
|
||||
413 stdcall -noname DefSubclassProc(long long long long)
|
||||
414 stdcall -noname MirrorIcon(ptr ptr)
|
||||
415 stdcall DrawTextWrap(long wstr long ptr long) user32.DrawTextW
|
||||
416 stdcall DrawTextExPrivWrap(long wstr long ptr long ptr) user32.DrawTextExW
|
||||
417 stdcall ExtTextOutWrap(long long long long ptr wstr long ptr) gdi32.ExtTextOutW
|
||||
418 stdcall GetCharWidthWrap(long long long long) gdi32.GetCharWidthW
|
||||
419 stdcall GetTextExtentPointWrap(long wstr long ptr) gdi32.GetTextExtentPointW
|
||||
420 stdcall GetTextExtentPoint32Wrap(long wstr long ptr) gdi32.GetTextExtentPoint32W
|
||||
421 stdcall TextOutWrap(long long long wstr long) gdi32.TextOutW
|
||||
|
||||
# Functions imported by name
|
||||
|
||||
@ stdcall CreatePropertySheetPage(ptr) CreatePropertySheetPageA
|
||||
@ stdcall CreatePropertySheetPageA(ptr)
|
||||
@ stdcall CreatePropertySheetPageW(ptr)
|
||||
@ stdcall CreateStatusWindow(long str long long) CreateStatusWindowA
|
||||
@ stdcall CreateStatusWindowW(long wstr long long)
|
||||
@ stdcall CreateToolbarEx(long long long long long long ptr long long long long long long)
|
||||
@ stdcall DestroyPropertySheetPage(long)
|
||||
@ stdcall -private DllGetVersion(ptr)
|
||||
@ stdcall -private DllInstall(long wstr)
|
||||
@ stdcall DrawStatusText(long ptr ptr long) DrawStatusTextA
|
||||
@ stdcall DrawStatusTextW(long ptr wstr long)
|
||||
@ stdcall FlatSB_EnableScrollBar (long long long)
|
||||
@ stdcall FlatSB_GetScrollInfo (long long ptr)
|
||||
@ stdcall FlatSB_GetScrollPos (long long)
|
||||
@ stdcall FlatSB_GetScrollProp (long long ptr)
|
||||
@ stdcall FlatSB_GetScrollRange (long long ptr ptr)
|
||||
@ stdcall FlatSB_SetScrollInfo (long long ptr long)
|
||||
@ stdcall FlatSB_SetScrollPos (long long long long)
|
||||
@ stdcall FlatSB_SetScrollProp (long long long long)
|
||||
@ stdcall FlatSB_SetScrollRange (long long long long long)
|
||||
@ stdcall FlatSB_ShowScrollBar (long long long)
|
||||
@ stdcall GetMUILanguage()
|
||||
@ stdcall ImageList_Add(ptr long long)
|
||||
@ stdcall ImageList_AddIcon(ptr long)
|
||||
@ stdcall ImageList_AddMasked(ptr long long)
|
||||
@ stdcall ImageList_BeginDrag(ptr long long long)
|
||||
@ stdcall ImageList_Copy(ptr long ptr long long)
|
||||
@ stdcall ImageList_Create(long long long long long)
|
||||
@ stdcall ImageList_Destroy(ptr)
|
||||
@ stdcall ImageList_DragEnter(long long long)
|
||||
@ stdcall ImageList_DragLeave(long)
|
||||
@ stdcall ImageList_DragMove(long long)
|
||||
@ stdcall ImageList_DragShowNolock(long)
|
||||
@ stdcall ImageList_Draw(ptr long long long long long)
|
||||
@ stdcall ImageList_DrawEx(ptr long long long long long long long long long)
|
||||
@ stdcall ImageList_DrawIndirect(ptr)
|
||||
@ stdcall ImageList_Duplicate(ptr)
|
||||
@ stdcall ImageList_EndDrag()
|
||||
@ stdcall ImageList_GetBkColor(ptr)
|
||||
@ stdcall ImageList_GetDragImage(ptr ptr)
|
||||
@ stdcall ImageList_GetFlags(ptr)
|
||||
@ stdcall ImageList_GetIcon(ptr long long)
|
||||
@ stdcall ImageList_GetIconSize(ptr ptr ptr)
|
||||
@ stdcall ImageList_GetImageCount(ptr)
|
||||
@ stdcall ImageList_GetImageInfo(ptr long ptr)
|
||||
@ stdcall ImageList_GetImageRect(ptr long ptr)
|
||||
@ stdcall ImageList_LoadImage(long str long long long long long) ImageList_LoadImageA
|
||||
@ stdcall ImageList_LoadImageA(long str long long long long long)
|
||||
@ stdcall ImageList_LoadImageW(long wstr long long long long long)
|
||||
@ stdcall ImageList_Merge(ptr long ptr long long long)
|
||||
@ stdcall ImageList_Read(ptr)
|
||||
@ stdcall ImageList_Remove(ptr long)
|
||||
@ stdcall ImageList_Replace(ptr long long long)
|
||||
@ stdcall ImageList_ReplaceIcon(ptr long long)
|
||||
@ stdcall ImageList_SetBkColor(ptr long)
|
||||
@ stdcall ImageList_SetDragCursorImage(ptr long long long)
|
||||
@ stdcall ImageList_SetFilter(ptr long long)
|
||||
@ stdcall ImageList_SetFlags(ptr long)
|
||||
@ stdcall ImageList_SetIconSize(ptr long long)
|
||||
@ stdcall ImageList_SetImageCount(ptr long)
|
||||
@ stdcall ImageList_SetOverlayImage(ptr long long)
|
||||
@ stdcall ImageList_Write(ptr ptr)
|
||||
@ stdcall InitCommonControlsEx(ptr)
|
||||
@ stdcall InitMUILanguage(long)
|
||||
@ stdcall InitializeFlatSB(long)
|
||||
@ stdcall PropertySheet(ptr) PropertySheetA
|
||||
@ stdcall PropertySheetA(ptr)
|
||||
@ stdcall PropertySheetW(ptr)
|
||||
@ stdcall UninitializeFlatSB(long)
|
||||
@ stdcall _TrackMouseEvent(ptr)
|
||||
|
|
|
@ -40,6 +40,11 @@
|
|||
<file>status.c</file>
|
||||
<file>syslink.c</file>
|
||||
<file>tab.c</file>
|
||||
<file>theme_combo.c</file>
|
||||
<file>theme_dialog.c</file>
|
||||
<file>theme_edit.c</file>
|
||||
<file>theme_listbox.c</file>
|
||||
<file>theming.c</file>
|
||||
<file>toolbar.c</file>
|
||||
<file>tooltips.c</file>
|
||||
<file>trackbar.c</file>
|
||||
|
|
|
@ -274,7 +274,6 @@ static void MRU_SaveChanged ( LPWINEMRULIST mp )
|
|||
HKEY newkey;
|
||||
WCHAR realname[2];
|
||||
LPWINEMRUITEM witem;
|
||||
static const WCHAR emptyW[] = {'\0'};
|
||||
|
||||
/* or should we do the following instead of RegOpenKeyEx:
|
||||
*/
|
||||
|
@ -287,7 +286,7 @@ static void MRU_SaveChanged ( LPWINEMRULIST mp )
|
|||
err);
|
||||
if ((err = RegCreateKeyExW( mp->extview.hKey, mp->extview.lpszSubKey,
|
||||
0,
|
||||
(LPWSTR)emptyW,
|
||||
NULL,
|
||||
REG_OPTION_NON_VOLATILE,
|
||||
KEY_READ | KEY_WRITE,
|
||||
0,
|
||||
|
@ -653,7 +652,6 @@ static HANDLE CreateMRUListLazy_common(LPWINEMRULIST mp)
|
|||
WCHAR realname[2];
|
||||
LPWINEMRUITEM witem;
|
||||
DWORD type;
|
||||
static const WCHAR emptyW[] = {'\0'};
|
||||
|
||||
/* get space to save indices that will turn into names
|
||||
* but in order of most to least recently used
|
||||
|
@ -668,16 +666,16 @@ static HANDLE CreateMRUListLazy_common(LPWINEMRULIST mp)
|
|||
/* open the sub key */
|
||||
if ((err = RegCreateKeyExW( mp->extview.hKey, mp->extview.lpszSubKey,
|
||||
0,
|
||||
(LPWSTR)emptyW,
|
||||
NULL,
|
||||
REG_OPTION_NON_VOLATILE,
|
||||
KEY_READ | KEY_WRITE,
|
||||
0,
|
||||
&newkey,
|
||||
&dwdisp))) {
|
||||
/* error - what to do ??? */
|
||||
ERR("(%lu %lu %lx %lx \"%s\" %p): Could not open key, error=%d\n",
|
||||
ERR("(%lu %lu %lx %p %s %p): Could not open key, error=%d\n",
|
||||
mp->extview.cbSize, mp->extview.nMaxItems, mp->extview.dwFlags,
|
||||
(DWORD)mp->extview.hKey, debugstr_w(mp->extview.lpszSubKey),
|
||||
mp->extview.hKey, debugstr_w(mp->extview.lpszSubKey),
|
||||
mp->extview.lpfnCompare, err);
|
||||
return 0;
|
||||
}
|
||||
|
@ -718,9 +716,9 @@ static HANDLE CreateMRUListLazy_common(LPWINEMRULIST mp)
|
|||
else
|
||||
mp->cursize = 0;
|
||||
|
||||
TRACE("(%lu %lu %lx %lx \"%s\" %p): Current Size = %ld\n",
|
||||
TRACE("(%lu %lu %lx %p %s %p): Current Size = %ld\n",
|
||||
mp->extview.cbSize, mp->extview.nMaxItems, mp->extview.dwFlags,
|
||||
(DWORD)mp->extview.hKey, debugstr_w(mp->extview.lpszSubKey),
|
||||
mp->extview.hKey, debugstr_w(mp->extview.lpszSubKey),
|
||||
mp->extview.lpfnCompare, mp->cursize);
|
||||
return (HANDLE)mp;
|
||||
}
|
||||
|
|
|
@ -119,7 +119,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
|||
COMCTL32_hModule = (HMODULE)hinstDLL;
|
||||
|
||||
/* add global subclassing atom (used by 'tooltip' and 'updown') */
|
||||
COMCTL32_wSubclass = (LPWSTR)(DWORD)GlobalAddAtomW (strCC32SubclassInfo);
|
||||
COMCTL32_wSubclass = (LPWSTR)(DWORD_PTR)GlobalAddAtomW (strCC32SubclassInfo);
|
||||
TRACE("Subclassing atom added: %p\n", COMCTL32_wSubclass);
|
||||
|
||||
/* create local pattern brush */
|
||||
|
@ -144,6 +144,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
|||
TRACKBAR_Register ();
|
||||
TREEVIEW_Register ();
|
||||
UPDOWN_Register ();
|
||||
|
||||
/* subclass user32 controls */
|
||||
THEMING_Initialize ();
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
|
@ -305,7 +308,7 @@ MenuHelp (UINT uMsg, WPARAM wParam, LPARAM lParam, HMENU hMainMenu,
|
|||
*/
|
||||
|
||||
BOOL WINAPI
|
||||
ShowHideMenuCtl (HWND hwnd, UINT uFlags, LPINT lpInfo)
|
||||
ShowHideMenuCtl (HWND hwnd, UINT_PTR uFlags, LPINT lpInfo)
|
||||
{
|
||||
LPINT lpMenuId;
|
||||
|
||||
|
@ -322,9 +325,9 @@ ShowHideMenuCtl (HWND hwnd, UINT uFlags, LPINT lpInfo)
|
|||
while (*lpMenuId != uFlags)
|
||||
lpMenuId += 2;
|
||||
|
||||
if (GetMenuState ((HMENU)lpInfo[1], uFlags, MF_BYCOMMAND) & MFS_CHECKED) {
|
||||
if (GetMenuState ((HMENU)(DWORD_PTR)lpInfo[1], uFlags, MF_BYCOMMAND) & MFS_CHECKED) {
|
||||
/* uncheck menu item */
|
||||
CheckMenuItem ((HMENU)lpInfo[0], *lpMenuId, MF_BYCOMMAND | MF_UNCHECKED);
|
||||
CheckMenuItem ((HMENU)(DWORD_PTR)lpInfo[0], *lpMenuId, MF_BYCOMMAND | MF_UNCHECKED);
|
||||
|
||||
/* hide control */
|
||||
lpMenuId++;
|
||||
|
@ -333,7 +336,7 @@ ShowHideMenuCtl (HWND hwnd, UINT uFlags, LPINT lpInfo)
|
|||
}
|
||||
else {
|
||||
/* check menu item */
|
||||
CheckMenuItem ((HMENU)lpInfo[0], *lpMenuId, MF_BYCOMMAND | MF_CHECKED);
|
||||
CheckMenuItem ((HMENU)(DWORD_PTR)lpInfo[0], *lpMenuId, MF_BYCOMMAND | MF_CHECKED);
|
||||
|
||||
/* show control */
|
||||
lpMenuId++;
|
||||
|
@ -373,8 +376,8 @@ GetEffectiveClientRect (HWND hwnd, LPRECT lpRect, LPINT lpInfo)
|
|||
INT *lpRun;
|
||||
HWND hwndCtrl;
|
||||
|
||||
TRACE("(0x%08lx 0x%08lx 0x%08lx)\n",
|
||||
(DWORD)hwnd, (DWORD)lpRect, (DWORD)lpInfo);
|
||||
TRACE("(%p %p %p)\n",
|
||||
hwnd, lpRect, lpInfo);
|
||||
|
||||
GetClientRect (hwnd, lpRect);
|
||||
lpRun = lpInfo;
|
||||
|
@ -503,7 +506,7 @@ CreateStatusWindowA (LONG style, LPCSTR text, HWND parent, UINT wid)
|
|||
return CreateWindowA(STATUSCLASSNAMEA, text, style,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
parent, (HMENU)wid, 0, 0);
|
||||
parent, (HMENU)(DWORD_PTR)wid, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -529,7 +532,7 @@ CreateStatusWindowW (LONG style, LPCWSTR text, HWND parent, UINT wid)
|
|||
return CreateWindowW(STATUSCLASSNAMEW, text, style,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
parent, (HMENU)wid, 0, 0);
|
||||
parent, (HMENU)(DWORD_PTR)wid, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -564,7 +567,7 @@ CreateUpDownControl (DWORD style, INT x, INT y, INT cx, INT cy,
|
|||
{
|
||||
HWND hUD =
|
||||
CreateWindowW (UPDOWN_CLASSW, 0, style, x, y, cx, cy,
|
||||
parent, (HMENU)id, inst, 0);
|
||||
parent, (HMENU)(DWORD_PTR)id, inst, 0);
|
||||
if (hUD) {
|
||||
SendMessageW (hUD, UDM_SETBUDDY, (WPARAM)buddy, 0);
|
||||
SendMessageW (hUD, UDM_SETRANGE, 0, MAKELONG(maxVal, minVal));
|
||||
|
@ -725,7 +728,7 @@ CreateToolbarEx (HWND hwnd, DWORD style, UINT wID, INT nBitmaps,
|
|||
|
||||
hwndTB =
|
||||
CreateWindowExW(0, TOOLBARCLASSNAMEW, NULL, style|WS_CHILD, 0,0,100,30,
|
||||
hwnd, (HMENU)wID, COMCTL32_hModule, NULL);
|
||||
hwnd, (HMENU)(DWORD_PTR)wID, COMCTL32_hModule, NULL);
|
||||
if(hwndTB) {
|
||||
TBADDBITMAP tbab;
|
||||
|
||||
|
@ -784,7 +787,7 @@ CreateToolbarEx (HWND hwnd, DWORD style, UINT wID, INT nBitmaps,
|
|||
*/
|
||||
|
||||
HBITMAP WINAPI
|
||||
CreateMappedBitmap (HINSTANCE hInstance, INT idBitmap, UINT wFlags,
|
||||
CreateMappedBitmap (HINSTANCE hInstance, INT_PTR idBitmap, UINT wFlags,
|
||||
LPCOLORMAP lpColorMap, INT iNumMaps)
|
||||
{
|
||||
HGLOBAL hglb;
|
||||
|
@ -931,8 +934,7 @@ CreateToolbar (HWND hwnd, DWORD style, UINT wID, INT nBitmaps,
|
|||
* Returns version of a comctl32.dll from IE4.01 SP1.
|
||||
*/
|
||||
|
||||
HRESULT WINAPI
|
||||
COMCTL32_DllGetVersion (DLLVERSIONINFO *pdvi)
|
||||
HRESULT WINAPI DllGetVersion (DLLVERSIONINFO *pdvi)
|
||||
{
|
||||
if (pdvi->cbSize != sizeof(DLLVERSIONINFO)) {
|
||||
WARN("wrong DLLVERSIONINFO size from app\n");
|
||||
|
@ -960,7 +962,7 @@ COMCTL32_DllGetVersion (DLLVERSIONINFO *pdvi)
|
|||
* Success: S_OK
|
||||
* Failure: A HRESULT error
|
||||
*/
|
||||
HRESULT WINAPI COMCTL32_DllInstall(BOOL bInstall, LPCWSTR cmdline)
|
||||
HRESULT WINAPI DllInstall(BOOL bInstall, LPCWSTR cmdline)
|
||||
{
|
||||
FIXME("(%s, %s): stub\n", bInstall?"TRUE":"FALSE",
|
||||
debugstr_w(cmdline));
|
||||
|
|
|
@ -1163,6 +1163,15 @@ DATETIME_StyleChanged(DATETIME_INFO *infoPtr, WPARAM wStyleType, LPSTYLESTRUCT l
|
|||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
DATETIME_SetFont (DATETIME_INFO *infoPtr, HFONT font, BOOL repaint)
|
||||
{
|
||||
infoPtr->hFont = font;
|
||||
if (repaint) InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
DATETIME_Create (HWND hwnd, LPCREATESTRUCTW lpcs)
|
||||
{
|
||||
|
@ -1314,6 +1323,12 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
case WM_STYLECHANGED:
|
||||
return DATETIME_StyleChanged(infoPtr, wParam, (LPSTYLESTRUCT)lParam);
|
||||
|
||||
case WM_SETFONT:
|
||||
return DATETIME_SetFont(infoPtr, (HFONT)wParam, (BOOL)lParam);
|
||||
|
||||
case WM_GETFONT:
|
||||
return (LRESULT) infoPtr->hFont;
|
||||
|
||||
default:
|
||||
if ((uMsg >= WM_USER) && (uMsg < WM_APP))
|
||||
ERR("unknown msg %04x wp=%08x lp=%08lx\n",
|
||||
|
|
|
@ -787,11 +787,6 @@ BOOL WINAPI DPA_Sort (const HDPA hdpa, PFNDPACOMPARE pfnCompare, LPARAM lParam)
|
|||
* RETURNS
|
||||
* Success: index of the pointer in the array.
|
||||
* Failure: -1
|
||||
*
|
||||
* NOTES
|
||||
* Binary search taken from R.Sedgewick "Algorithms in C"!
|
||||
* Function is NOT tested!
|
||||
* If something goes wrong, blame HIM not ME! (Eric Kohl)
|
||||
*/
|
||||
INT WINAPI DPA_Search (const HDPA hdpa, LPVOID pFind, INT nStart,
|
||||
PFNDPACOMPARE pfnCompare, LPARAM lParam, UINT uOptions)
|
||||
|
@ -807,47 +802,34 @@ INT WINAPI DPA_Search (const HDPA hdpa, LPVOID pFind, INT nStart,
|
|||
INT l, r, x, n;
|
||||
LPVOID *lpPtr;
|
||||
|
||||
TRACE("binary search\n");
|
||||
|
||||
l = (nStart == -1) ? 0 : nStart;
|
||||
r = hdpa->nItemCount - 1;
|
||||
lpPtr = hdpa->ptrs;
|
||||
while (r >= l) {
|
||||
x = (l + r) / 2;
|
||||
n = (pfnCompare)(pFind, lpPtr[x], lParam);
|
||||
if (n < 0)
|
||||
if (n == 0)
|
||||
return x;
|
||||
else if (n < 0)
|
||||
r = x - 1;
|
||||
else
|
||||
else /* (n > 0) */
|
||||
l = x + 1;
|
||||
if (n == 0) {
|
||||
TRACE("-- ret=%d\n", n);
|
||||
return n;
|
||||
}
|
||||
}
|
||||
|
||||
if (uOptions & (DPAS_INSERTBEFORE | DPAS_INSERTAFTER)) {
|
||||
TRACE("-- ret=%d\n", l);
|
||||
return l;
|
||||
}
|
||||
if (uOptions & (DPAS_INSERTBEFORE|DPAS_INSERTAFTER)) return l;
|
||||
}
|
||||
else {
|
||||
/* array is not sorted --> use linear search */
|
||||
LPVOID *lpPtr;
|
||||
INT nIndex;
|
||||
|
||||
TRACE("linear search\n");
|
||||
|
||||
nIndex = (nStart == -1)? 0 : nStart;
|
||||
lpPtr = hdpa->ptrs;
|
||||
for (; nIndex < hdpa->nItemCount; nIndex++) {
|
||||
if ((pfnCompare)(pFind, lpPtr[nIndex], lParam) == 0) {
|
||||
TRACE("-- ret=%d\n", nIndex);
|
||||
if ((pfnCompare)(pFind, lpPtr[nIndex], lParam) == 0)
|
||||
return nIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TRACE("-- not found: ret=-1\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -87,6 +87,7 @@ typedef struct
|
|||
|
||||
HIMAGELIST himl; /* handle to an image list (may be 0) */
|
||||
HEADER_ITEM *items; /* pointer to array of HEADER_ITEM's */
|
||||
INT *order; /* array of item IDs indexed by order */
|
||||
BOOL bRectsValid; /* validity flag for bounding rectangles */
|
||||
} HEADER_INFO;
|
||||
|
||||
|
@ -113,14 +114,10 @@ HEADER_OrderToIndex(HWND hwnd, WPARAM wParam)
|
|||
{
|
||||
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
|
||||
INT iorder = (INT)wParam;
|
||||
UINT i;
|
||||
|
||||
if ((iorder <0) || iorder >infoPtr->uNumItem)
|
||||
if ((iorder <0) || iorder >= infoPtr->uNumItem)
|
||||
return iorder;
|
||||
for (i=0; i<infoPtr->uNumItem; i++)
|
||||
if (HEADER_IndexToOrder(hwnd,i) == iorder)
|
||||
return i;
|
||||
return iorder;
|
||||
return infoPtr->order[iorder];
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -385,7 +382,7 @@ HEADER_Refresh (HWND hwnd, HDC hdc)
|
|||
}
|
||||
|
||||
x = rect.left;
|
||||
for (i = 0; i < infoPtr->uNumItem; i++) {
|
||||
for (i = 0; x <= rect.right && i < infoPtr->uNumItem; i++) {
|
||||
x = HEADER_DrawItem (hwnd, hdc, HEADER_OrderToIndex(hwnd,i),
|
||||
infoPtr->iHotItem == i);
|
||||
}
|
||||
|
@ -416,7 +413,7 @@ HEADER_RefreshItem (HWND hwnd, HDC hdc, INT iItem)
|
|||
|
||||
hFont = infoPtr->hFont ? infoPtr->hFont : GetStockObject (SYSTEM_FONT);
|
||||
hOldFont = SelectObject (hdc, hFont);
|
||||
HEADER_DrawItem (hwnd, hdc, iItem, FALSE);
|
||||
HEADER_DrawItem (hwnd, hdc, iItem, infoPtr->iHotItem == iItem);
|
||||
SelectObject (hdc, hOldFont);
|
||||
}
|
||||
|
||||
|
@ -647,16 +644,19 @@ HEADER_DeleteItem (HWND hwnd, WPARAM wParam)
|
|||
if (infoPtr->items[0].pszText)
|
||||
Free (infoPtr->items[0].pszText);
|
||||
Free (infoPtr->items);
|
||||
Free(infoPtr->order);
|
||||
infoPtr->items = 0;
|
||||
infoPtr->order = 0;
|
||||
infoPtr->uNumItem = 0;
|
||||
}
|
||||
else {
|
||||
HEADER_ITEM *oldItems = infoPtr->items;
|
||||
HEADER_ITEM *pItem;
|
||||
INT i;
|
||||
INT iOrder;
|
||||
TRACE("Complex delete! [iItem=%d]\n", iItem);
|
||||
|
||||
for (i = 0; i < infoPtr->uNumItem; i++)
|
||||
TRACE("%d: order=%d, iOrder=%d, ->iOrder=%d\n", i, infoPtr->order[i], infoPtr->items[i].iOrder, infoPtr->items[infoPtr->order[i]].iOrder);
|
||||
if (infoPtr->items[iItem].pszText)
|
||||
Free (infoPtr->items[iItem].pszText);
|
||||
iOrder = infoPtr->items[iItem].iOrder;
|
||||
|
@ -676,11 +676,21 @@ HEADER_DeleteItem (HWND hwnd, WPARAM wParam)
|
|||
}
|
||||
|
||||
/* Correct the orders */
|
||||
for (i=infoPtr->uNumItem, pItem = infoPtr->items; i; i--, pItem++)
|
||||
if (iOrder < infoPtr->uNumItem)
|
||||
{
|
||||
if (pItem->iOrder > iOrder)
|
||||
pItem->iOrder--;
|
||||
memmove(&infoPtr->order[iOrder], &infoPtr->order[iOrder + 1],
|
||||
(infoPtr->uNumItem - iOrder) * sizeof(INT));
|
||||
for (i = 0; i < infoPtr->uNumItem; i++)
|
||||
{
|
||||
if (infoPtr->order[i] > iItem)
|
||||
infoPtr->order[i]--;
|
||||
if (i >= iOrder)
|
||||
infoPtr->items[infoPtr->order[i]].iOrder = infoPtr->order[i];
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < infoPtr->uNumItem; i++)
|
||||
TRACE("%d: order=%d, iOrder=%d, ->iOrder=%d\n", i, infoPtr->order[i], infoPtr->items[i].iOrder, infoPtr->items[infoPtr->order[i]].iOrder);
|
||||
Free (oldItems);
|
||||
}
|
||||
|
||||
|
@ -850,14 +860,13 @@ HEADER_GetItemRect (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
static LRESULT
|
||||
HEADER_GetOrderArray(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
int i;
|
||||
LPINT order = (LPINT) lParam;
|
||||
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
|
||||
|
||||
if ((unsigned int)wParam <infoPtr->uNumItem)
|
||||
return FALSE;
|
||||
for (i=0; i<(int)wParam; i++)
|
||||
*order++=HEADER_OrderToIndex(hwnd,i);
|
||||
|
||||
memcpy(order, infoPtr->order, infoPtr->uNumItem * sizeof(INT));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -871,6 +880,7 @@ HEADER_SetOrderArray(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
if ((unsigned int)wParam <infoPtr->uNumItem)
|
||||
return FALSE;
|
||||
memcpy(infoPtr->order, order, infoPtr->uNumItem * sizeof(INT));
|
||||
for (i=0; i<(int)wParam; i++)
|
||||
{
|
||||
lpItem = &infoPtr->items[*order++];
|
||||
|
@ -923,10 +933,12 @@ HEADER_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
if (infoPtr->uNumItem == 0) {
|
||||
infoPtr->items = Alloc (sizeof (HEADER_ITEM));
|
||||
infoPtr->order = Alloc(sizeof(INT));
|
||||
infoPtr->uNumItem++;
|
||||
}
|
||||
else {
|
||||
HEADER_ITEM *oldItems = infoPtr->items;
|
||||
INT *oldOrder = infoPtr->order;
|
||||
|
||||
infoPtr->uNumItem++;
|
||||
infoPtr->items = Alloc (sizeof (HEADER_ITEM) * infoPtr->uNumItem);
|
||||
|
@ -949,13 +961,21 @@ HEADER_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
}
|
||||
|
||||
infoPtr->order = Alloc(sizeof(INT) * infoPtr->uNumItem);
|
||||
memcpy(infoPtr->order, oldOrder, iOrder * sizeof(INT));
|
||||
infoPtr->order[iOrder] = nItem;
|
||||
memcpy(&infoPtr->order[iOrder + 1], &oldOrder[iOrder],
|
||||
(infoPtr->uNumItem - iOrder - 1) * sizeof(INT));
|
||||
|
||||
Free (oldItems);
|
||||
Free(oldOrder);
|
||||
}
|
||||
|
||||
for (i=0; i < infoPtr->uNumItem; i++)
|
||||
for (i = 0; i < infoPtr->uNumItem; i++)
|
||||
{
|
||||
if (infoPtr->items[i].iOrder >= iOrder)
|
||||
infoPtr->items[i].iOrder++;
|
||||
if (i != iOrder && infoPtr->order[i] >= nItem)
|
||||
infoPtr->order[i]++;
|
||||
infoPtr->items[infoPtr->order[i]].iOrder = infoPtr->order[i];
|
||||
}
|
||||
|
||||
lpItem = &infoPtr->items[nItem];
|
||||
|
@ -1025,10 +1045,12 @@ HEADER_InsertItemW (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
if (infoPtr->uNumItem == 0) {
|
||||
infoPtr->items = Alloc (sizeof (HEADER_ITEM));
|
||||
infoPtr->order = Alloc(sizeof(INT));
|
||||
infoPtr->uNumItem++;
|
||||
}
|
||||
else {
|
||||
HEADER_ITEM *oldItems = infoPtr->items;
|
||||
INT *oldOrder = infoPtr->order;
|
||||
|
||||
infoPtr->uNumItem++;
|
||||
infoPtr->items = Alloc (sizeof (HEADER_ITEM) * infoPtr->uNumItem);
|
||||
|
@ -1051,13 +1073,21 @@ HEADER_InsertItemW (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
}
|
||||
|
||||
infoPtr->order = Alloc(infoPtr->uNumItem * sizeof(INT));
|
||||
memcpy(infoPtr->order, oldOrder, iOrder * sizeof(INT));
|
||||
infoPtr->order[iOrder] = nItem;
|
||||
memcpy(&infoPtr->order[iOrder + 1], &oldOrder[iOrder],
|
||||
(infoPtr->uNumItem - iOrder - 1) * sizeof(INT));
|
||||
|
||||
Free (oldItems);
|
||||
Free(oldOrder);
|
||||
}
|
||||
|
||||
for (i=0; i < infoPtr->uNumItem; i++)
|
||||
for (i = 0; i < infoPtr->uNumItem; i++)
|
||||
{
|
||||
if (infoPtr->items[i].iOrder >= iOrder)
|
||||
infoPtr->items[i].iOrder++;
|
||||
if (i != iOrder && infoPtr->order[i] >= nItem)
|
||||
infoPtr->order[i]++;
|
||||
infoPtr->items[infoPtr->order[i]].iOrder = infoPtr->order[i];
|
||||
}
|
||||
|
||||
lpItem = &infoPtr->items[nItem];
|
||||
|
@ -1143,7 +1173,7 @@ HEADER_SetImageList (HWND hwnd, HIMAGELIST himl)
|
|||
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
|
||||
HIMAGELIST himlOld;
|
||||
|
||||
TRACE("(himl 0x%x)\n", (int)himl);
|
||||
TRACE("(himl %p)\n", himl);
|
||||
himlOld = infoPtr->himl;
|
||||
infoPtr->himl = himl;
|
||||
|
||||
|
@ -1224,7 +1254,27 @@ HEADER_SetItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
if (phdi->mask & HDI_ORDER)
|
||||
{
|
||||
lpItem->iOrder = phdi->iOrder;
|
||||
INT i, nMin, nMax;
|
||||
|
||||
if (lpItem->iOrder < phdi->iOrder)
|
||||
{
|
||||
memmove(&infoPtr->order[lpItem->iOrder],
|
||||
&infoPtr->order[lpItem->iOrder + 1],
|
||||
(phdi->iOrder - lpItem->iOrder) * sizeof(INT));
|
||||
}
|
||||
if (phdi->iOrder < lpItem->iOrder)
|
||||
{
|
||||
memmove(&infoPtr->order[phdi->iOrder + 1],
|
||||
&infoPtr->order[phdi->iOrder],
|
||||
(lpItem->iOrder - phdi->iOrder) * sizeof(INT));
|
||||
}
|
||||
infoPtr->order[phdi->iOrder] = nItem;
|
||||
nMin = min(lpItem->iOrder, phdi->iOrder);
|
||||
nMax = max(lpItem->iOrder, phdi->iOrder);
|
||||
for (i = nMin; i <= nMax; i++)
|
||||
{
|
||||
infoPtr->items[infoPtr->order[i]].iOrder = infoPtr->order[i];
|
||||
}
|
||||
}
|
||||
|
||||
HEADER_SendHeaderNotify (hwnd, HDN_ITEMCHANGEDA, nItem, phdi->mask);
|
||||
|
@ -1289,7 +1339,27 @@ HEADER_SetItemW (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
if (phdi->mask & HDI_ORDER)
|
||||
{
|
||||
lpItem->iOrder = phdi->iOrder;
|
||||
INT i, nMin, nMax;
|
||||
|
||||
if (lpItem->iOrder < phdi->iOrder)
|
||||
{
|
||||
memmove(&infoPtr->order[lpItem->iOrder],
|
||||
&infoPtr->order[lpItem->iOrder + 1],
|
||||
(phdi->iOrder - lpItem->iOrder) * sizeof(INT));
|
||||
}
|
||||
if (phdi->iOrder < lpItem->iOrder)
|
||||
{
|
||||
memmove(&infoPtr->order[phdi->iOrder + 1],
|
||||
&infoPtr->order[phdi->iOrder],
|
||||
(lpItem->iOrder - phdi->iOrder) * sizeof(INT));
|
||||
}
|
||||
infoPtr->order[phdi->iOrder] = nItem;
|
||||
nMin = min(lpItem->iOrder, phdi->iOrder);
|
||||
nMax = max(lpItem->iOrder, phdi->iOrder);
|
||||
for (i = nMin; i <= nMax; i++)
|
||||
{
|
||||
infoPtr->items[infoPtr->order[i]].iOrder = infoPtr->order[i];
|
||||
}
|
||||
}
|
||||
|
||||
HEADER_SendHeaderNotify(hwnd, HDN_ITEMCHANGEDW, nItem, phdi->mask);
|
||||
|
@ -1320,7 +1390,6 @@ HEADER_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
TEXTMETRICW tm;
|
||||
HFONT hOldFont;
|
||||
HDC hdc;
|
||||
BOOL themingActive = IsAppThemed() && IsThemeActive();
|
||||
|
||||
infoPtr = (HEADER_INFO *)Alloc (sizeof(HEADER_INFO));
|
||||
SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
|
||||
|
@ -1329,6 +1398,7 @@ HEADER_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
infoPtr->uNumItem = 0;
|
||||
infoPtr->hFont = 0;
|
||||
infoPtr->items = 0;
|
||||
infoPtr->order = 0;
|
||||
infoPtr->bRectsValid = FALSE;
|
||||
infoPtr->hcurArrow = LoadCursorW (0, (LPWSTR)IDC_ARROW);
|
||||
infoPtr->hcurDivider = LoadCursorW (COMCTL32_hModule, MAKEINTRESOURCEW(IDC_DIVIDER));
|
||||
|
@ -1350,7 +1420,7 @@ HEADER_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
SelectObject (hdc, hOldFont);
|
||||
ReleaseDC (0, hdc);
|
||||
|
||||
if (themingActive) OpenThemeData(hwnd, themeClass);
|
||||
OpenThemeData(hwnd, themeClass);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1373,6 +1443,9 @@ HEADER_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
Free (infoPtr->items);
|
||||
}
|
||||
|
||||
if (infoPtr->order)
|
||||
Free(infoPtr->order);
|
||||
|
||||
if (infoPtr->himl)
|
||||
ImageList_Destroy (infoPtr->himl);
|
||||
|
||||
|
@ -1506,6 +1579,9 @@ HEADER_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
lpItem= &infoPtr->items[infoPtr->iMoveItem];
|
||||
lpItem->iOrder = newindex;
|
||||
|
||||
infoPtr->order[oldindex] = nItem;
|
||||
infoPtr->order[newindex] = infoPtr->iMoveItem;
|
||||
|
||||
infoPtr->bRectsValid = FALSE;
|
||||
InvalidateRect(hwnd, NULL, FALSE);
|
||||
/* FIXME: Should some WM_NOTIFY be sent */
|
||||
|
@ -1580,6 +1656,22 @@ HEADER_NotifyFormat (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
HEADER_MouseLeave (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
|
||||
/* Reset hot-tracked item when mouse leaves control. */
|
||||
INT oldHotItem = infoPtr->iHotItem;
|
||||
HDC hdc = GetDC (hwnd);
|
||||
|
||||
infoPtr->iHotItem = -1;
|
||||
if (oldHotItem != -1) HEADER_RefreshItem (hwnd, hdc, oldHotItem);
|
||||
ReleaseDC (hwnd, hdc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
HEADER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
|
@ -1589,28 +1681,35 @@ HEADER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
UINT flags;
|
||||
INT nItem, nWidth;
|
||||
HDC hdc;
|
||||
/* With theming, hottracking is always enabled */
|
||||
BOOL hotTrackEnabled =
|
||||
((dwStyle & HDS_BUTTONS) && (dwStyle & HDS_HOTTRACK))
|
||||
|| (GetWindowTheme (hwnd) != NULL);
|
||||
INT oldHotItem = infoPtr->iHotItem;
|
||||
|
||||
pt.x = (INT)(SHORT)LOWORD(lParam);
|
||||
pt.y = (INT)(SHORT)HIWORD(lParam);
|
||||
HEADER_InternalHitTest (hwnd, &pt, &flags, &nItem);
|
||||
|
||||
if ((dwStyle & HDS_BUTTONS) && (dwStyle & HDS_HOTTRACK)) {
|
||||
if (hotTrackEnabled) {
|
||||
if (flags & (HHT_ONHEADER | HHT_ONDIVIDER | HHT_ONDIVOPEN))
|
||||
infoPtr->iHotItem = nItem;
|
||||
else
|
||||
infoPtr->iHotItem = -1;
|
||||
InvalidateRect(hwnd, NULL, FALSE);
|
||||
}
|
||||
|
||||
if (infoPtr->bCaptured) {
|
||||
if (infoPtr->bPressed) {
|
||||
BOOL oldState = infoPtr->items[infoPtr->iMoveItem].bDown;
|
||||
if ((nItem == infoPtr->iMoveItem) && (flags == HHT_ONHEADER))
|
||||
infoPtr->items[infoPtr->iMoveItem].bDown = TRUE;
|
||||
else
|
||||
infoPtr->items[infoPtr->iMoveItem].bDown = FALSE;
|
||||
hdc = GetDC (hwnd);
|
||||
HEADER_RefreshItem (hwnd, hdc, infoPtr->iMoveItem);
|
||||
ReleaseDC (hwnd, hdc);
|
||||
if (oldState != infoPtr->items[infoPtr->iMoveItem].bDown) {
|
||||
hdc = GetDC (hwnd);
|
||||
HEADER_RefreshItem (hwnd, hdc, infoPtr->iMoveItem);
|
||||
ReleaseDC (hwnd, hdc);
|
||||
}
|
||||
|
||||
TRACE("Moving pressed item %d!\n", infoPtr->iMoveItem);
|
||||
}
|
||||
|
@ -1643,8 +1742,18 @@ HEADER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
}
|
||||
|
||||
if ((dwStyle & HDS_BUTTONS) && (dwStyle & HDS_HOTTRACK)) {
|
||||
FIXME("hot track support!\n");
|
||||
if (hotTrackEnabled) {
|
||||
TRACKMOUSEEVENT tme;
|
||||
if (oldHotItem != infoPtr->iHotItem) {
|
||||
hdc = GetDC (hwnd);
|
||||
if (oldHotItem != -1) HEADER_RefreshItem (hwnd, hdc, oldHotItem);
|
||||
if (infoPtr->iHotItem != -1) HEADER_RefreshItem (hwnd, hdc, infoPtr->iHotItem);
|
||||
ReleaseDC (hwnd, hdc);
|
||||
}
|
||||
tme.cbSize = sizeof( tme );
|
||||
tme.dwFlags = TME_LEAVE;
|
||||
tme.hwndTrack = hwnd;
|
||||
TrackMouseEvent( &tme );
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -1854,6 +1963,9 @@ HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
case WM_LBUTTONUP:
|
||||
return HEADER_LButtonUp (hwnd, wParam, lParam);
|
||||
|
||||
case WM_MOUSELEAVE:
|
||||
return HEADER_MouseLeave (hwnd, wParam, lParam);
|
||||
|
||||
case WM_MOUSEMOVE:
|
||||
return HEADER_MouseMove (hwnd, wParam, lParam);
|
||||
|
||||
|
|
|
@ -1084,8 +1084,8 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
|
|||
bMask = (himl->flags & ILC_MASK) && (fStyle & ILD_MASK) ;
|
||||
bBlend = (fStyle & (ILD_BLEND25 | ILD_BLEND50) ) && !bMask;
|
||||
|
||||
TRACE("himl(0x%lx) hbmMask(%p) iImage(%d) x(%d) y(%d) cx(%d) cy(%d)\n",
|
||||
(DWORD)himl, himl->hbmMask, pimldp->i, pimldp->x, pimldp->y, cx, cy);
|
||||
TRACE("himl(%p) hbmMask(%p) iImage(%d) x(%d) y(%d) cx(%d) cy(%d)\n",
|
||||
himl, himl->hbmMask, pimldp->i, pimldp->x, pimldp->y, cx, cy);
|
||||
|
||||
/* we will use these DCs to access the images and masks in the ImageList */
|
||||
hImageListDC = himl->hdcImage;
|
||||
|
|
|
@ -143,7 +143,7 @@ static LRESULT IPADDRESS_Draw (IPADDRESS_INFO *infoPtr, HDC hdc)
|
|||
fgCol = COLOR_GRAYTEXT;
|
||||
}
|
||||
|
||||
FillRect (hdc, &rect, (HBRUSH) (bgCol+1));
|
||||
FillRect (hdc, &rect, (HBRUSH)(DWORD_PTR)(bgCol+1));
|
||||
DrawEdge (hdc, &rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
|
||||
|
||||
SetBkColor (hdc, GetSysColor(bgCol));
|
||||
|
|
|
@ -380,6 +380,9 @@ typedef struct tagLISTVIEW_INFO
|
|||
#define LV_FL_DT_FLAGS (DT_TOP | DT_NOPREFIX | DT_EDITCONTROL | DT_CENTER | DT_WORDBREAK | DT_NOCLIP)
|
||||
#define LV_SL_DT_FLAGS (DT_VCENTER | DT_NOPREFIX | DT_EDITCONTROL | DT_SINGLELINE | DT_WORD_ELLIPSIS | DT_END_ELLIPSIS)
|
||||
|
||||
/* Image index from state */
|
||||
#define STATEIMAGEINDEX(x) (((x) & LVIS_STATEIMAGEMASK) >> 12)
|
||||
|
||||
/* The time in milliseconds to reset the search in the list */
|
||||
#define KEY_DELAY 450
|
||||
|
||||
|
@ -1244,8 +1247,8 @@ static BOOL iterator_frameditems(ITERATOR* i, LISTVIEW_INFO* infoPtr, const RECT
|
|||
TRACE("building icon ranges:\n");
|
||||
for (nItem = 0; nItem < infoPtr->nItemCount; nItem++)
|
||||
{
|
||||
rcItem.left = (LONG)DPA_GetPtr(infoPtr->hdpaPosX, nItem);
|
||||
rcItem.top = (LONG)DPA_GetPtr(infoPtr->hdpaPosY, nItem);
|
||||
rcItem.left = (LONG_PTR)DPA_GetPtr(infoPtr->hdpaPosX, nItem);
|
||||
rcItem.top = (LONG_PTR)DPA_GetPtr(infoPtr->hdpaPosY, nItem);
|
||||
rcItem.right = rcItem.left + infoPtr->nItemWidth;
|
||||
rcItem.bottom = rcItem.top + infoPtr->nItemHeight;
|
||||
if (IntersectRect(&rcTemp, &rcItem, &frame))
|
||||
|
@ -1842,8 +1845,8 @@ static void LISTVIEW_GetItemOrigin(LISTVIEW_INFO *infoPtr, INT nItem, LPPOINT lp
|
|||
|
||||
if ((uView == LVS_SMALLICON) || (uView == LVS_ICON))
|
||||
{
|
||||
lpptPosition->x = (LONG)DPA_GetPtr(infoPtr->hdpaPosX, nItem);
|
||||
lpptPosition->y = (LONG)DPA_GetPtr(infoPtr->hdpaPosY, nItem);
|
||||
lpptPosition->x = (LONG_PTR)DPA_GetPtr(infoPtr->hdpaPosX, nItem);
|
||||
lpptPosition->y = (LONG_PTR)DPA_GetPtr(infoPtr->hdpaPosY, nItem);
|
||||
}
|
||||
else if (uView == LVS_LIST)
|
||||
{
|
||||
|
@ -2220,8 +2223,8 @@ static BOOL LISTVIEW_MoveIconTo(LISTVIEW_INFO *infoPtr, INT nItem, const POINT *
|
|||
|
||||
if (!isNew)
|
||||
{
|
||||
old.x = (LONG)DPA_GetPtr(infoPtr->hdpaPosX, nItem);
|
||||
old.y = (LONG)DPA_GetPtr(infoPtr->hdpaPosY, nItem);
|
||||
old.x = (LONG_PTR)DPA_GetPtr(infoPtr->hdpaPosX, nItem);
|
||||
old.y = (LONG_PTR)DPA_GetPtr(infoPtr->hdpaPosY, nItem);
|
||||
|
||||
if (lppt->x == old.x && lppt->y == old.y) return TRUE;
|
||||
LISTVIEW_InvalidateItem(infoPtr, nItem);
|
||||
|
@ -2229,8 +2232,8 @@ static BOOL LISTVIEW_MoveIconTo(LISTVIEW_INFO *infoPtr, INT nItem, const POINT *
|
|||
|
||||
/* Allocating a POINTER for every item is too resource intensive,
|
||||
* so we'll keep the (x,y) in different arrays */
|
||||
if (!DPA_SetPtr(infoPtr->hdpaPosX, nItem, (void *)lppt->x)) return FALSE;
|
||||
if (!DPA_SetPtr(infoPtr->hdpaPosY, nItem, (void *)lppt->y)) return FALSE;
|
||||
if (!DPA_SetPtr(infoPtr->hdpaPosX, nItem, (void *)(LONG_PTR)lppt->x)) return FALSE;
|
||||
if (!DPA_SetPtr(infoPtr->hdpaPosY, nItem, (void *)(LONG_PTR)lppt->y)) return FALSE;
|
||||
|
||||
LISTVIEW_InvalidateItem(infoPtr, nItem);
|
||||
|
||||
|
@ -2309,8 +2312,8 @@ static void LISTVIEW_GetAreaRect(LISTVIEW_INFO *infoPtr, LPRECT lprcView)
|
|||
case LVS_SMALLICON:
|
||||
for (i = 0; i < infoPtr->nItemCount; i++)
|
||||
{
|
||||
x = (LONG)DPA_GetPtr(infoPtr->hdpaPosX, i);
|
||||
y = (LONG)DPA_GetPtr(infoPtr->hdpaPosY, i);
|
||||
x = (LONG_PTR)DPA_GetPtr(infoPtr->hdpaPosX, i);
|
||||
y = (LONG_PTR)DPA_GetPtr(infoPtr->hdpaPosY, i);
|
||||
lprcView->right = max(lprcView->right, x);
|
||||
lprcView->bottom = max(lprcView->bottom, y);
|
||||
}
|
||||
|
@ -3731,7 +3734,7 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, INT nS
|
|||
/* state icons */
|
||||
if (infoPtr->himlState && !IsRectEmpty(&rcState))
|
||||
{
|
||||
UINT uStateImage = (lvItem.state & LVIS_STATEIMAGEMASK) >> 12;
|
||||
UINT uStateImage = STATEIMAGEINDEX(lvItem.state);
|
||||
if (uStateImage)
|
||||
{
|
||||
TRACE("uStateImage=%d\n", uStateImage);
|
||||
|
@ -6102,7 +6105,7 @@ static INT LISTVIEW_HitTest(LISTVIEW_INFO *infoPtr, LPLVHITTESTINFO lpht, BOOL s
|
|||
lpht->flags |= LVHT_ONITEMICON;
|
||||
else if (PtInRect(&rcLabel, opt))
|
||||
lpht->flags |= LVHT_ONITEMLABEL;
|
||||
else if (infoPtr->himlState && ((lvItem.state & LVIS_STATEIMAGEMASK) >> 12) && PtInRect(&rcState, opt))
|
||||
else if (infoPtr->himlState && STATEIMAGEINDEX(lvItem.state) && PtInRect(&rcState, opt))
|
||||
lpht->flags |= LVHT_ONITEMSTATEICON;
|
||||
if (lpht->flags & LVHT_ONITEM)
|
||||
lpht->flags &= ~LVHT_NOWHERE;
|
||||
|
@ -6831,7 +6834,7 @@ static DWORD LISTVIEW_SetExtendedListViewStyle(LISTVIEW_INFO *infoPtr, DWORD dwM
|
|||
*
|
||||
* PARAMETER(S):
|
||||
* [I] infoPtr : valid pointer to the listview structure
|
||||
* [I} hCurosr : the new hot cursor handle
|
||||
* [I] hCursor : the new hot cursor handle
|
||||
*
|
||||
* RETURN:
|
||||
* Returns the previous hot cursor
|
||||
|
@ -7520,7 +7523,6 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
|
|||
LISTVIEW_INFO *infoPtr;
|
||||
UINT uView = lpcs->style & LVS_TYPEMASK;
|
||||
LOGFONTW logFont;
|
||||
BOOL themingActive = IsAppThemed() && IsThemeActive();
|
||||
|
||||
TRACE("(lpcs=%p)\n", lpcs);
|
||||
|
||||
|
@ -7603,7 +7605,7 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
|
|||
}
|
||||
}
|
||||
|
||||
if (themingActive) OpenThemeData(hwnd, themeClass);
|
||||
OpenThemeData(hwnd, themeClass);
|
||||
|
||||
return 0;
|
||||
|
||||
|
@ -8108,13 +8110,13 @@ static LRESULT LISTVIEW_LButtonDblClk(LISTVIEW_INFO *infoPtr, WORD wKey, INT x,
|
|||
* DESCRIPTION:
|
||||
* Processes mouse down messages (left mouse button).
|
||||
*
|
||||
* PARAMETER(S):
|
||||
* [I] infoPtr : valid pointer to the listview structure
|
||||
* [I] wKey : key flag
|
||||
* [I] x,y : mouse coordinate
|
||||
* PARAMETERS:
|
||||
* infoPtr [I ] valid pointer to the listview structure
|
||||
* wKey [I ] key flag
|
||||
* x,y [I ] mouse coordinate
|
||||
*
|
||||
* RETURN:
|
||||
* Zero
|
||||
* Zero
|
||||
*/
|
||||
static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT y)
|
||||
{
|
||||
|
@ -8144,12 +8146,12 @@ static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, IN
|
|||
{
|
||||
if ((infoPtr->dwLvExStyle & LVS_EX_CHECKBOXES) && (lvHitTestInfo.flags & LVHT_ONITEMSTATEICON))
|
||||
{
|
||||
DWORD state = LISTVIEW_GetItemState(infoPtr, nItem, LVIS_STATEIMAGEMASK) >> 12;
|
||||
DWORD state = STATEIMAGEINDEX(LISTVIEW_GetItemState(infoPtr, nItem, LVIS_STATEIMAGEMASK));
|
||||
if(state == 1 || state == 2)
|
||||
{
|
||||
LVITEMW lvitem;
|
||||
state ^= 3;
|
||||
lvitem.state = state << 12;
|
||||
lvitem.state = INDEXTOSTATEIMAGEMASK(state);
|
||||
lvitem.stateMask = LVIS_STATEIMAGEMASK;
|
||||
LISTVIEW_SetItemState(infoPtr, nItem, &lvitem);
|
||||
}
|
||||
|
@ -8223,13 +8225,13 @@ static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, IN
|
|||
* DESCRIPTION:
|
||||
* Processes mouse up messages (left mouse button).
|
||||
*
|
||||
* PARAMETER(S):
|
||||
* [I] infoPtr : valid pointer to the listview structure
|
||||
* [I] wKey : key flag
|
||||
* [I] x,y : mouse coordinate
|
||||
* PARAMETERS:
|
||||
* infoPtr [I ] valid pointer to the listview structure
|
||||
* wKey [I ] key flag
|
||||
* x,y [I ] mouse coordinate
|
||||
*
|
||||
* RETURN:
|
||||
* Zero
|
||||
* Zero
|
||||
*/
|
||||
static LRESULT LISTVIEW_LButtonUp(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT y)
|
||||
{
|
||||
|
@ -8419,15 +8421,13 @@ static LRESULT LISTVIEW_HeaderNotification(LISTVIEW_INFO *infoPtr, const NMHEADE
|
|||
static BOOL LISTVIEW_NCPaint(LISTVIEW_INFO *infoPtr, HRGN region)
|
||||
{
|
||||
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
|
||||
BOOL themingActive = IsAppThemed() && IsThemeActive();
|
||||
BOOL doTheming = themingActive && (theme != NULL);
|
||||
HDC dc;
|
||||
RECT r;
|
||||
HRGN cliprgn;
|
||||
int cxEdge = GetSystemMetrics (SM_CXEDGE),
|
||||
cyEdge = GetSystemMetrics (SM_CYEDGE);
|
||||
|
||||
if (!doTheming) return FALSE;
|
||||
if (!theme) return FALSE;
|
||||
|
||||
GetWindowRect(infoPtr->hwndSelf, &r);
|
||||
|
||||
|
|
|
@ -55,6 +55,8 @@
|
|||
#include "winnls.h"
|
||||
#include "commctrl.h"
|
||||
#include "comctl32.h"
|
||||
#include "uxtheme.h"
|
||||
#include "tmschema.h"
|
||||
#include "wine/unicode.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
|
@ -125,6 +127,7 @@ typedef struct
|
|||
/* Offsets of days in the week to the weekday of january 1 in a leap year */
|
||||
static const int DayOfWeekTable[] = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4};
|
||||
|
||||
static const WCHAR themeClass[] = { 'S','c','r','o','l','l','b','a','r',0 };
|
||||
|
||||
#define MONTHCAL_GetInfoPtr(hwnd) ((MONTHCAL_INFO *)GetWindowLongPtrW(hwnd, 0))
|
||||
|
||||
|
@ -388,6 +391,45 @@ static void MONTHCAL_DrawDay(MONTHCAL_INFO *infoPtr, HDC hdc, int day, int month
|
|||
}
|
||||
|
||||
|
||||
static void paint_button (MONTHCAL_INFO *infoPtr, HDC hdc, BOOL btnNext,
|
||||
BOOL pressed, RECT* r)
|
||||
{
|
||||
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
|
||||
|
||||
if (theme)
|
||||
{
|
||||
static const int states[] = {
|
||||
/* Prev button */
|
||||
ABS_LEFTNORMAL, ABS_LEFTPRESSED, ABS_LEFTDISABLED,
|
||||
/* Next button */
|
||||
ABS_RIGHTNORMAL, ABS_RIGHTPRESSED, ABS_RIGHTDISABLED
|
||||
};
|
||||
int stateNum = btnNext ? 3 : 0;
|
||||
if (pressed)
|
||||
stateNum += 1;
|
||||
else
|
||||
{
|
||||
DWORD dwStyle = GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE);
|
||||
if (dwStyle & WS_DISABLED) stateNum += 2;
|
||||
}
|
||||
DrawThemeBackground (theme, hdc, SBP_ARROWBTN, states[stateNum], r, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
int style = btnNext ? DFCS_SCROLLRIGHT : DFCS_SCROLLLEFT;
|
||||
if (pressed)
|
||||
style |= DFCS_PUSHED;
|
||||
else
|
||||
{
|
||||
DWORD dwStyle = GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE);
|
||||
if (dwStyle & WS_DISABLED) style |= DFCS_INACTIVE;
|
||||
}
|
||||
|
||||
DrawFrameControl(hdc, r, DFC_SCROLL, style);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, PAINTSTRUCT* ps)
|
||||
{
|
||||
static const WCHAR todayW[] = { 'T','o','d','a','y',':',0 };
|
||||
|
@ -434,27 +476,11 @@ static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, PAINTSTRUCT* ps)
|
|||
|
||||
/* if the previous button is pressed draw it depressed */
|
||||
if(IntersectRect(&rcTemp, &(ps->rcPaint), prev))
|
||||
{
|
||||
if((infoPtr->status & MC_PREVPRESSED))
|
||||
DrawFrameControl(hdc, prev, DFC_SCROLL,
|
||||
DFCS_SCROLLLEFT | DFCS_PUSHED |
|
||||
(dwStyle & WS_DISABLED ? DFCS_INACTIVE : 0));
|
||||
else /* if the previous button is pressed draw it depressed */
|
||||
DrawFrameControl(hdc, prev, DFC_SCROLL,
|
||||
DFCS_SCROLLLEFT |(dwStyle & WS_DISABLED ? DFCS_INACTIVE : 0));
|
||||
}
|
||||
paint_button (infoPtr, hdc, FALSE, infoPtr->status & MC_PREVPRESSED, prev);
|
||||
|
||||
/* if next button is depressed draw it depressed */
|
||||
if(IntersectRect(&rcTemp, &(ps->rcPaint), next))
|
||||
{
|
||||
if((infoPtr->status & MC_NEXTPRESSED))
|
||||
DrawFrameControl(hdc, next, DFC_SCROLL,
|
||||
DFCS_SCROLLRIGHT | DFCS_PUSHED |
|
||||
(dwStyle & WS_DISABLED ? DFCS_INACTIVE : 0));
|
||||
else /* if the next button is pressed draw it depressed */
|
||||
DrawFrameControl(hdc, next, DFC_SCROLL,
|
||||
DFCS_SCROLLRIGHT |(dwStyle & WS_DISABLED ? DFCS_INACTIVE : 0));
|
||||
}
|
||||
paint_button (infoPtr, hdc, TRUE, infoPtr->status & MC_NEXTPRESSED, next);
|
||||
|
||||
oldBkColor = SetBkColor(hdc, infoPtr->titlebk);
|
||||
SetTextColor(hdc, infoPtr->titletxt);
|
||||
|
@ -1812,6 +1838,15 @@ static LRESULT MONTHCAL_SetFont(MONTHCAL_INFO *infoPtr, HFONT hFont, BOOL redraw
|
|||
return (LRESULT)hOldFont;
|
||||
}
|
||||
|
||||
/* update theme after a WM_THEMECHANGED message */
|
||||
static LRESULT theme_changed (MONTHCAL_INFO* infoPtr)
|
||||
{
|
||||
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
|
||||
CloseThemeData (theme);
|
||||
theme = OpenThemeData (infoPtr->hwndSelf, themeClass);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* FIXME: check whether dateMin/dateMax need to be adjusted. */
|
||||
static LRESULT
|
||||
MONTHCAL_Create(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
|
@ -1857,6 +1892,8 @@ MONTHCAL_Create(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
/* call MONTHCAL_UpdateSize to set all of the dimensions */
|
||||
/* of the control */
|
||||
MONTHCAL_UpdateSize(infoPtr);
|
||||
|
||||
OpenThemeData (infoPtr->hwndSelf, themeClass);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1869,6 +1906,9 @@ MONTHCAL_Destroy(MONTHCAL_INFO *infoPtr)
|
|||
if(infoPtr->monthdayState)
|
||||
Free(infoPtr->monthdayState);
|
||||
SetWindowLongPtrW(infoPtr->hwndSelf, 0, 0);
|
||||
|
||||
CloseThemeData (GetWindowTheme (infoPtr->hwndSelf));
|
||||
|
||||
Free(infoPtr);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1987,6 +2027,9 @@ MONTHCAL_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
case WM_TIMER:
|
||||
return MONTHCAL_Timer(infoPtr, wParam);
|
||||
|
||||
case WM_THEMECHANGED:
|
||||
return theme_changed (infoPtr);
|
||||
|
||||
case WM_DESTROY:
|
||||
return MONTHCAL_Destroy(infoPtr);
|
||||
|
|
|
@ -38,6 +38,8 @@
|
|||
#include "winnls.h"
|
||||
#include "commctrl.h"
|
||||
#include "comctl32.h"
|
||||
#include "uxtheme.h"
|
||||
#include "tmschema.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(progress);
|
||||
|
@ -62,6 +64,70 @@ typedef struct
|
|||
#define MARQUEE_LEDS 5
|
||||
#define ID_MARQUEE_TIMER 1
|
||||
|
||||
/* Helper to obtain size of a progress bar chunk ("led"). */
|
||||
static inline int get_led_size ( PROGRESS_INFO *infoPtr, LONG style,
|
||||
const RECT* rect )
|
||||
{
|
||||
HTHEME theme = GetWindowTheme (infoPtr->Self);
|
||||
if (theme)
|
||||
{
|
||||
int chunkSize;
|
||||
if (SUCCEEDED( GetThemeInt( theme, 0, 0, TMT_PROGRESSCHUNKSIZE, &chunkSize )))
|
||||
return chunkSize;
|
||||
}
|
||||
|
||||
if (style & PBS_VERTICAL)
|
||||
return MulDiv (rect->right - rect->left, 2, 3);
|
||||
else
|
||||
return MulDiv (rect->bottom - rect->top, 2, 3);
|
||||
}
|
||||
|
||||
/* Helper to obtain gap between progress bar chunks */
|
||||
static inline int get_led_gap ( PROGRESS_INFO *infoPtr )
|
||||
{
|
||||
HTHEME theme = GetWindowTheme (infoPtr->Self);
|
||||
if (theme)
|
||||
{
|
||||
int spaceSize;
|
||||
if (SUCCEEDED( GetThemeInt( theme, 0, 0, TMT_PROGRESSSPACESIZE, &spaceSize )))
|
||||
return spaceSize;
|
||||
}
|
||||
|
||||
return LED_GAP;
|
||||
}
|
||||
|
||||
/* Get client rect. Takes into account that theming needs no adjustment. */
|
||||
static inline void get_client_rect (HWND hwnd, RECT* rect)
|
||||
{
|
||||
HTHEME theme = GetWindowTheme (hwnd);
|
||||
GetClientRect (hwnd, rect);
|
||||
if (!theme)
|
||||
InflateRect(rect, -1, -1);
|
||||
else
|
||||
{
|
||||
DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE);
|
||||
int part = (dwStyle & PBS_VERTICAL) ? PP_BARVERT : PP_BAR;
|
||||
GetThemeBackgroundContentRect (theme, 0, part, 0, rect, rect);
|
||||
}
|
||||
}
|
||||
|
||||
/* Compute the extend of the bar */
|
||||
static inline int get_bar_size( LONG style, const RECT* rect )
|
||||
{
|
||||
if (style & PBS_VERTICAL)
|
||||
return rect->bottom - rect->top;
|
||||
else
|
||||
return rect->right - rect->left;
|
||||
}
|
||||
|
||||
/* Compute the pixel position of a progress value */
|
||||
static inline int get_bar_position( PROGRESS_INFO *infoPtr, LONG style,
|
||||
const RECT* rect, INT value )
|
||||
{
|
||||
return MulDiv (value - infoPtr->MinVal, get_bar_size (style, rect),
|
||||
infoPtr->MaxVal - infoPtr->MinVal);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* PROGRESS_Invalidate
|
||||
*
|
||||
|
@ -71,37 +137,214 @@ static void PROGRESS_Invalidate( PROGRESS_INFO *infoPtr, INT old, INT new )
|
|||
{
|
||||
LONG style = GetWindowLongW (infoPtr->Self, GWL_STYLE);
|
||||
RECT rect;
|
||||
int oldPos, newPos, ledWidth;
|
||||
int oldPos, newPos;
|
||||
BOOL barSmooth = (style & PBS_SMOOTH) && !GetWindowTheme (infoPtr->Self);
|
||||
|
||||
GetClientRect (infoPtr->Self, &rect);
|
||||
InflateRect(&rect, -1, -1);
|
||||
get_client_rect( infoPtr->Self, &rect );
|
||||
|
||||
oldPos = get_bar_position( infoPtr, style, &rect, old );
|
||||
newPos = get_bar_position( infoPtr, style, &rect, new );
|
||||
|
||||
if (style & PBS_VERTICAL)
|
||||
{
|
||||
oldPos = rect.bottom - MulDiv (old - infoPtr->MinVal, rect.bottom - rect.top,
|
||||
infoPtr->MaxVal - infoPtr->MinVal);
|
||||
newPos = rect.bottom - MulDiv (new - infoPtr->MinVal, rect.bottom - rect.top,
|
||||
infoPtr->MaxVal - infoPtr->MinVal);
|
||||
ledWidth = MulDiv (rect.right - rect.left, 2, 3);
|
||||
rect.top = min( oldPos, newPos );
|
||||
rect.bottom = max( oldPos, newPos );
|
||||
if (!(style & PBS_SMOOTH)) rect.top -= ledWidth;
|
||||
InvalidateRect( infoPtr->Self, &rect, oldPos < newPos );
|
||||
rect.top = rect.bottom - max( oldPos, newPos );
|
||||
rect.bottom = rect.bottom - min( oldPos, newPos );
|
||||
if (!barSmooth) rect.top -=
|
||||
get_led_size (infoPtr, style, &rect) + get_led_gap (infoPtr);
|
||||
}
|
||||
else
|
||||
{
|
||||
oldPos = rect.left + MulDiv (old - infoPtr->MinVal, rect.right - rect.left,
|
||||
infoPtr->MaxVal - infoPtr->MinVal);
|
||||
newPos = rect.left + MulDiv (new - infoPtr->MinVal, rect.right - rect.left,
|
||||
infoPtr->MaxVal - infoPtr->MinVal);
|
||||
ledWidth = MulDiv (rect.bottom - rect.top, 2, 3);
|
||||
rect.left = min( oldPos, newPos );
|
||||
rect.right = max( oldPos, newPos );
|
||||
if (!(style & PBS_SMOOTH)) rect.right += ledWidth;
|
||||
InvalidateRect( infoPtr->Self, &rect, oldPos > newPos );
|
||||
if (!barSmooth) rect.right +=
|
||||
get_led_size (infoPtr, style, &rect) + get_led_gap (infoPtr);
|
||||
}
|
||||
InvalidateRect( infoPtr->Self, &rect, oldPos > newPos );
|
||||
}
|
||||
|
||||
/* Information for a progress bar drawing helper */
|
||||
typedef struct tagProgressDrawInfo
|
||||
{
|
||||
HDC hdc;
|
||||
RECT rect;
|
||||
HBRUSH hbrBar;
|
||||
HBRUSH hbrBk;
|
||||
int ledW, ledGap;
|
||||
HTHEME theme;
|
||||
RECT bgRect;
|
||||
} ProgressDrawInfo;
|
||||
|
||||
typedef void (*ProgressDrawProc)(const ProgressDrawInfo* di, int start, int end);
|
||||
|
||||
/* draw solid horizontal bar from 'start' to 'end' */
|
||||
static void draw_solid_bar_H (const ProgressDrawInfo* di, int start, int end)
|
||||
{
|
||||
RECT r;
|
||||
r.left = di->rect.left + start;
|
||||
r.top = di->rect.top;
|
||||
r.right = di->rect.left + end;
|
||||
r.bottom = di->rect.bottom;
|
||||
FillRect (di->hdc, &r, di->hbrBar);
|
||||
}
|
||||
|
||||
/* draw solid horizontal background from 'start' to 'end' */
|
||||
static void draw_solid_bkg_H (const ProgressDrawInfo* di, int start, int end)
|
||||
{
|
||||
RECT r;
|
||||
r.left = di->rect.left + start;
|
||||
r.top = di->rect.top;
|
||||
r.right = di->rect.left + end;
|
||||
r.bottom = di->rect.bottom;
|
||||
FillRect (di->hdc, &r, di->hbrBk);
|
||||
}
|
||||
|
||||
/* draw solid vertical bar from 'start' to 'end' */
|
||||
static void draw_solid_bar_V (const ProgressDrawInfo* di, int start, int end)
|
||||
{
|
||||
RECT r;
|
||||
r.left = di->rect.left;
|
||||
r.top = di->rect.bottom - end;
|
||||
r.right = di->rect.right;
|
||||
r.bottom = di->rect.bottom - start;
|
||||
FillRect (di->hdc, &r, di->hbrBar);
|
||||
}
|
||||
|
||||
/* draw solid vertical background from 'start' to 'end' */
|
||||
static void draw_solid_bkg_V (const ProgressDrawInfo* di, int start, int end)
|
||||
{
|
||||
RECT r;
|
||||
r.left = di->rect.left;
|
||||
r.top = di->rect.bottom - end;
|
||||
r.right = di->rect.right;
|
||||
r.bottom = di->rect.bottom - start;
|
||||
FillRect (di->hdc, &r, di->hbrBk);
|
||||
}
|
||||
|
||||
/* draw chunky horizontal bar from 'start' to 'end' */
|
||||
static void draw_chunk_bar_H (const ProgressDrawInfo* di, int start, int end)
|
||||
{
|
||||
RECT r;
|
||||
int right = di->rect.left + end;
|
||||
r.left = di->rect.left + start;
|
||||
r.top = di->rect.top;
|
||||
r.bottom = di->rect.bottom;
|
||||
while (r.left < right)
|
||||
{
|
||||
r.right = min (r.left + di->ledW, right);
|
||||
FillRect (di->hdc, &r, di->hbrBar);
|
||||
r.left = r.right;
|
||||
r.right = min (r.left + di->ledGap, right);
|
||||
FillRect (di->hdc, &r, di->hbrBk);
|
||||
r.left = r.right;
|
||||
}
|
||||
}
|
||||
|
||||
/* draw chunky vertical bar from 'start' to 'end' */
|
||||
static void draw_chunk_bar_V (const ProgressDrawInfo* di, int start, int end)
|
||||
{
|
||||
RECT r;
|
||||
int top = di->rect.bottom - end;
|
||||
r.left = di->rect.left;
|
||||
r.right = di->rect.right;
|
||||
r.bottom = di->rect.bottom - start;
|
||||
while (r.bottom > top)
|
||||
{
|
||||
r.top = max (r.bottom - di->ledW, top);
|
||||
FillRect (di->hdc, &r, di->hbrBar);
|
||||
r.bottom = r.top;
|
||||
r.top = max (r.bottom - di->ledGap, top);
|
||||
FillRect (di->hdc, &r, di->hbrBk);
|
||||
r.bottom = r.top;
|
||||
}
|
||||
}
|
||||
|
||||
/* drawing functions for "classic" style */
|
||||
static const ProgressDrawProc drawProcClassic[8] = {
|
||||
/* Smooth */
|
||||
/* Horizontal */
|
||||
draw_solid_bar_H, draw_solid_bkg_H,
|
||||
/* Vertical */
|
||||
draw_solid_bar_V, draw_solid_bkg_V,
|
||||
/* Chunky */
|
||||
/* Horizontal */
|
||||
draw_chunk_bar_H, draw_solid_bkg_H,
|
||||
/* Vertical */
|
||||
draw_chunk_bar_V, draw_solid_bkg_V,
|
||||
};
|
||||
|
||||
/* draw themed horizontal bar from 'start' to 'end' */
|
||||
static void draw_theme_bar_H (const ProgressDrawInfo* di, int start, int end)
|
||||
{
|
||||
RECT r;
|
||||
int right = di->rect.left + end;
|
||||
r.left = di->rect.left + start;
|
||||
r.top = di->rect.top;
|
||||
r.bottom = di->rect.bottom;
|
||||
while (r.left < right)
|
||||
{
|
||||
r.right = min (r.left + di->ledW, right);
|
||||
DrawThemeBackground (di->theme, di->hdc, PP_CHUNK, 0, &r, NULL);
|
||||
r.left = r.right;
|
||||
r.right = min (r.left + di->ledGap, right);
|
||||
DrawThemeBackground (di->theme, di->hdc, PP_BAR, 0, &di->bgRect, &r);
|
||||
r.left = r.right;
|
||||
}
|
||||
}
|
||||
|
||||
/* draw themed horizontal bar from 'start' to 'end' */
|
||||
static void draw_theme_bar_V (const ProgressDrawInfo* di, int start, int end)
|
||||
{
|
||||
RECT r;
|
||||
int top = di->rect.bottom - end;
|
||||
r.left = di->rect.left;
|
||||
r.right = di->rect.right;
|
||||
r.bottom = di->rect.bottom - start;
|
||||
while (r.bottom > top)
|
||||
{
|
||||
r.top = max (r.bottom - di->ledW, top);
|
||||
DrawThemeBackground (di->theme, di->hdc, PP_CHUNKVERT, 0, &r, NULL);
|
||||
r.bottom = r.top;
|
||||
r.top = max (r.bottom - di->ledGap, top);
|
||||
DrawThemeBackground (di->theme, di->hdc, PP_BARVERT, 0, &di->bgRect, &r);
|
||||
r.bottom = r.top;
|
||||
}
|
||||
}
|
||||
|
||||
/* draw themed horizontal background from 'start' to 'end' */
|
||||
static void draw_theme_bkg_H (const ProgressDrawInfo* di, int start, int end)
|
||||
{
|
||||
RECT r;
|
||||
r.left = di->rect.left + start;
|
||||
r.top = di->rect.top;
|
||||
r.right = di->rect.left + end;
|
||||
r.bottom = di->rect.bottom;
|
||||
DrawThemeBackground (di->theme, di->hdc, PP_BAR, 0, &di->bgRect, &r);
|
||||
}
|
||||
|
||||
/* draw themed vertical background from 'start' to 'end' */
|
||||
static void draw_theme_bkg_V (const ProgressDrawInfo* di, int start, int end)
|
||||
{
|
||||
RECT r;
|
||||
r.left = di->rect.left;
|
||||
r.top = di->rect.bottom - end;
|
||||
r.right = di->rect.right;
|
||||
r.bottom = di->rect.bottom - start;
|
||||
DrawThemeBackground (di->theme, di->hdc, PP_BARVERT, 0, &di->bgRect, &r);
|
||||
}
|
||||
|
||||
/* drawing functions for themed style */
|
||||
static const ProgressDrawProc drawProcThemed[8] = {
|
||||
/* Smooth */
|
||||
/* Horizontal */
|
||||
draw_theme_bar_H, draw_theme_bkg_H,
|
||||
/* Vertical */
|
||||
draw_theme_bar_V, draw_theme_bkg_V,
|
||||
/* Chunky */
|
||||
/* Horizontal */
|
||||
draw_theme_bar_H, draw_theme_bkg_H,
|
||||
/* Vertical */
|
||||
draw_theme_bar_V, draw_theme_bkg_V,
|
||||
};
|
||||
|
||||
/***********************************************************************
|
||||
* PROGRESS_Draw
|
||||
|
@ -109,274 +352,119 @@ static void PROGRESS_Invalidate( PROGRESS_INFO *infoPtr, INT old, INT new )
|
|||
*/
|
||||
static LRESULT PROGRESS_Draw (PROGRESS_INFO *infoPtr, HDC hdc)
|
||||
{
|
||||
HBRUSH hbrBar, hbrBk;
|
||||
int rightBar, rightMost, ledWidth;
|
||||
RECT rect;
|
||||
int barSize;
|
||||
DWORD dwStyle;
|
||||
BOOL barSmooth;
|
||||
const ProgressDrawProc* drawProcs;
|
||||
ProgressDrawInfo pdi;
|
||||
|
||||
TRACE("(infoPtr=%p, hdc=%p)\n", infoPtr, hdc);
|
||||
|
||||
pdi.hdc = hdc;
|
||||
pdi.theme = GetWindowTheme (infoPtr->Self);
|
||||
|
||||
/* get the required bar brush */
|
||||
if (infoPtr->ColorBar == CLR_DEFAULT)
|
||||
hbrBar = GetSysColorBrush(COLOR_HIGHLIGHT);
|
||||
pdi.hbrBar = GetSysColorBrush(COLOR_HIGHLIGHT);
|
||||
else
|
||||
hbrBar = CreateSolidBrush (infoPtr->ColorBar);
|
||||
pdi.hbrBar = CreateSolidBrush (infoPtr->ColorBar);
|
||||
|
||||
if (infoPtr->ColorBk == CLR_DEFAULT)
|
||||
hbrBk = GetSysColorBrush(COLOR_3DFACE);
|
||||
pdi.hbrBk = GetSysColorBrush(COLOR_3DFACE);
|
||||
else
|
||||
hbrBk = CreateSolidBrush(infoPtr->ColorBk);
|
||||
|
||||
/* get client rectangle */
|
||||
GetClientRect (infoPtr->Self, &rect);
|
||||
FrameRect( hdc, &rect, hbrBk );
|
||||
InflateRect(&rect, -1, -1);
|
||||
pdi.hbrBk = CreateSolidBrush(infoPtr->ColorBk);
|
||||
|
||||
/* get the window style */
|
||||
dwStyle = GetWindowLongW (infoPtr->Self, GWL_STYLE);
|
||||
|
||||
/* compute extent of progress bar */
|
||||
if (dwStyle & PBS_VERTICAL) {
|
||||
rightBar = rect.bottom -
|
||||
MulDiv (infoPtr->CurVal - infoPtr->MinVal,
|
||||
rect.bottom - rect.top,
|
||||
infoPtr->MaxVal - infoPtr->MinVal);
|
||||
ledWidth = MulDiv (rect.right - rect.left, 2, 3);
|
||||
rightMost = rect.top;
|
||||
} else {
|
||||
rightBar = rect.left +
|
||||
MulDiv (infoPtr->CurVal - infoPtr->MinVal,
|
||||
rect.right - rect.left,
|
||||
infoPtr->MaxVal - infoPtr->MinVal);
|
||||
ledWidth = MulDiv (rect.bottom - rect.top, 2, 3);
|
||||
rightMost = rect.right;
|
||||
/* get client rectangle */
|
||||
GetClientRect (infoPtr->Self, &pdi.rect);
|
||||
if (!pdi.theme) {
|
||||
FrameRect( hdc, &pdi.rect, pdi.hbrBk );
|
||||
InflateRect(&pdi.rect, -1, -1);
|
||||
}
|
||||
else
|
||||
{
|
||||
RECT cntRect;
|
||||
int part = (dwStyle & PBS_VERTICAL) ? PP_BARVERT : PP_BAR;
|
||||
|
||||
GetThemeBackgroundContentRect (pdi.theme, hdc, part, 0, &pdi.rect,
|
||||
&cntRect);
|
||||
|
||||
/* Exclude content rect - content background will be drawn later */
|
||||
ExcludeClipRect (hdc, cntRect.left, cntRect.top,
|
||||
cntRect.right, cntRect.bottom);
|
||||
if (IsThemeBackgroundPartiallyTransparent (pdi.theme, part, 0))
|
||||
DrawThemeParentBackground (infoPtr->Self, hdc, NULL);
|
||||
DrawThemeBackground (pdi.theme, hdc, part, 0, &pdi.rect, NULL);
|
||||
SelectClipRgn (hdc, NULL);
|
||||
CopyRect (&pdi.rect, &cntRect);
|
||||
}
|
||||
|
||||
/* now draw the bar */
|
||||
if (dwStyle & PBS_SMOOTH)
|
||||
/* compute some drawing parameters */
|
||||
barSmooth = (dwStyle & PBS_SMOOTH) && !pdi.theme;
|
||||
drawProcs = &((pdi.theme ? drawProcThemed : drawProcClassic)[(barSmooth ? 0 : 4)
|
||||
+ ((dwStyle & PBS_VERTICAL) ? 2 : 0)]);
|
||||
barSize = get_bar_size( dwStyle, &pdi.rect );
|
||||
if (pdi.theme)
|
||||
{
|
||||
if (dwStyle & PBS_VERTICAL)
|
||||
{
|
||||
if (dwStyle & PBS_MARQUEE)
|
||||
{
|
||||
INT old_top, old_bottom, ledMStart, leds;
|
||||
old_top = rect.top;
|
||||
old_bottom = rect.bottom;
|
||||
GetWindowRect( infoPtr->Self, &pdi.bgRect );
|
||||
ScreenToClient( infoPtr->Self, (POINT*)&pdi.bgRect );
|
||||
ScreenToClient( infoPtr->Self, (POINT*)&pdi.bgRect.right );
|
||||
}
|
||||
|
||||
leds = rect.bottom - rect.top;
|
||||
ledMStart = (infoPtr->MarqueePos + MARQUEE_LEDS) - leds;
|
||||
|
||||
if(ledMStart > 0)
|
||||
{
|
||||
rect.top = max(rect.bottom - ledMStart, old_top);
|
||||
FillRect(hdc, &rect, hbrBar);
|
||||
rect.bottom = rect.top;
|
||||
}
|
||||
if(infoPtr->MarqueePos > 0)
|
||||
{
|
||||
rect.top = max(old_bottom - infoPtr->MarqueePos, old_top);
|
||||
FillRect(hdc, &rect, hbrBk);
|
||||
rect.bottom = rect.top;
|
||||
}
|
||||
if(rect.top >= old_top)
|
||||
{
|
||||
rect.top = max(rect.bottom - MARQUEE_LEDS, old_top);
|
||||
FillRect(hdc, &rect, hbrBar);
|
||||
rect.bottom = rect.top;
|
||||
}
|
||||
if(rect.top >= old_top)
|
||||
{
|
||||
rect.top = old_top;
|
||||
FillRect(hdc, &rect, hbrBk);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
INT old_top = rect.top;
|
||||
rect.top = rightBar;
|
||||
FillRect(hdc, &rect, hbrBar);
|
||||
rect.bottom = rect.top;
|
||||
rect.top = old_top;
|
||||
FillRect(hdc, &rect, hbrBk);
|
||||
}
|
||||
if (!barSmooth)
|
||||
pdi.ledW = get_led_size( infoPtr, dwStyle, &pdi.rect);
|
||||
pdi.ledGap = get_led_gap( infoPtr );
|
||||
|
||||
if (dwStyle & PBS_MARQUEE)
|
||||
{
|
||||
const int ledW = !barSmooth ? (pdi.ledW + pdi.ledGap) : 1;
|
||||
const int leds = (barSize + ledW - 1) / ledW;
|
||||
const int ledMEnd = infoPtr->MarqueePos + MARQUEE_LEDS;
|
||||
|
||||
if (ledMEnd > leds)
|
||||
{
|
||||
/* case 1: the marquee bar extends over the end and wraps around to
|
||||
* the start */
|
||||
const int gapStart = max((ledMEnd - leds) * ledW, 0);
|
||||
const int gapEnd = min(infoPtr->MarqueePos * ledW, barSize);
|
||||
|
||||
drawProcs[0]( &pdi, 0, gapStart);
|
||||
drawProcs[1]( &pdi, gapStart, gapEnd);
|
||||
drawProcs[0]( &pdi, gapEnd, barSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dwStyle & PBS_MARQUEE)
|
||||
{
|
||||
INT old_left, old_right, ledMStart, leds;
|
||||
old_left = rect.left;
|
||||
old_right = rect.right;
|
||||
/* case 2: the marquee bar is between start and end */
|
||||
const int barStart = infoPtr->MarqueePos * ledW;
|
||||
const int barEnd = min (ledMEnd * ledW, barSize);
|
||||
|
||||
leds = rect.right - rect.left;
|
||||
ledMStart = (infoPtr->MarqueePos + MARQUEE_LEDS) - leds;
|
||||
rect.right = rect.left;
|
||||
|
||||
if(ledMStart > 0)
|
||||
{
|
||||
rect.right = min(rect.left + ledMStart, old_right);
|
||||
FillRect(hdc, &rect, hbrBar);
|
||||
rect.left = rect.right;
|
||||
}
|
||||
if(infoPtr->MarqueePos > 0)
|
||||
{
|
||||
rect.right = min(old_left + infoPtr->MarqueePos, old_right);
|
||||
FillRect(hdc, &rect, hbrBk);
|
||||
rect.left = rect.right;
|
||||
}
|
||||
if(rect.right < old_right)
|
||||
{
|
||||
rect.right = min(rect.left + MARQUEE_LEDS, old_right);
|
||||
FillRect(hdc, &rect, hbrBar);
|
||||
rect.left = rect.right;
|
||||
}
|
||||
if(rect.right < old_right)
|
||||
{
|
||||
rect.right = old_right;
|
||||
FillRect(hdc, &rect, hbrBk);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
INT old_right = rect.right;
|
||||
rect.right = rightBar;
|
||||
FillRect(hdc, &rect, hbrBar);
|
||||
rect.left = rect.right;
|
||||
rect.right = old_right;
|
||||
FillRect(hdc, &rect, hbrBk);
|
||||
}
|
||||
drawProcs[1]( &pdi, 0, barStart);
|
||||
drawProcs[0]( &pdi, barStart, barEnd);
|
||||
drawProcs[1]( &pdi, barEnd, barSize);
|
||||
}
|
||||
} else {
|
||||
if (dwStyle & PBS_VERTICAL) {
|
||||
if (dwStyle & PBS_MARQUEE)
|
||||
{
|
||||
INT i, old_top, old_bottom, ledMStart, leds;
|
||||
old_top = rect.top;
|
||||
old_bottom = rect.bottom;
|
||||
|
||||
leds = ((rect.bottom - rect.top) + (ledWidth + LED_GAP) - 1) / (ledWidth + LED_GAP);
|
||||
ledMStart = (infoPtr->MarqueePos + MARQUEE_LEDS) - leds;
|
||||
|
||||
while(ledMStart > 0)
|
||||
{
|
||||
rect.top = max(rect.bottom - ledWidth, old_top);
|
||||
FillRect(hdc, &rect, hbrBar);
|
||||
rect.bottom = rect.top;
|
||||
rect.top -= LED_GAP;
|
||||
if (rect.top <= old_top) break;
|
||||
FillRect(hdc, &rect, hbrBk);
|
||||
rect.bottom = rect.top;
|
||||
ledMStart--;
|
||||
}
|
||||
if(infoPtr->MarqueePos > 0)
|
||||
{
|
||||
rect.top = max(old_bottom - (infoPtr->MarqueePos * (ledWidth + LED_GAP)), old_top);
|
||||
FillRect(hdc, &rect, hbrBk);
|
||||
rect.bottom = rect.top;
|
||||
}
|
||||
for(i = 0; i < MARQUEE_LEDS && rect.top >= old_top; i++)
|
||||
{
|
||||
rect.top = max(rect.bottom - ledWidth, old_top);
|
||||
FillRect(hdc, &rect, hbrBar);
|
||||
rect.bottom = rect.top;
|
||||
rect.top -= LED_GAP;
|
||||
if (rect.top <= old_top) break;
|
||||
FillRect(hdc, &rect, hbrBk);
|
||||
rect.bottom = rect.top;
|
||||
}
|
||||
if(rect.top >= old_top)
|
||||
{
|
||||
rect.top = old_top;
|
||||
FillRect(hdc, &rect, hbrBk);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while(rect.bottom > rightBar) {
|
||||
rect.top = rect.bottom - ledWidth;
|
||||
if (rect.top < rightMost)
|
||||
rect.top = rightMost;
|
||||
FillRect(hdc, &rect, hbrBar);
|
||||
rect.bottom = rect.top;
|
||||
rect.top -= LED_GAP;
|
||||
if (rect.top <= rightBar) break;
|
||||
FillRect(hdc, &rect, hbrBk);
|
||||
rect.bottom = rect.top;
|
||||
}
|
||||
}
|
||||
rect.top = rightMost;
|
||||
FillRect(hdc, &rect, hbrBk);
|
||||
} else {
|
||||
if (dwStyle & PBS_MARQUEE)
|
||||
{
|
||||
INT i, old_right, old_left, ledMStart, leds;
|
||||
old_left = rect.left;
|
||||
old_right = rect.right;
|
||||
|
||||
leds = ((rect.right - rect.left) + ledWidth - 1) / (ledWidth + LED_GAP);
|
||||
ledMStart = (infoPtr->MarqueePos + MARQUEE_LEDS) - leds;
|
||||
rect.right = rect.left;
|
||||
|
||||
while(ledMStart > 0)
|
||||
{
|
||||
rect.right = min(rect.left + ledWidth, old_right);
|
||||
FillRect(hdc, &rect, hbrBar);
|
||||
rect.left = rect.right;
|
||||
rect.right += LED_GAP;
|
||||
if (rect.right > old_right) break;
|
||||
FillRect(hdc, &rect, hbrBk);
|
||||
rect.left = rect.right;
|
||||
ledMStart--;
|
||||
}
|
||||
if(infoPtr->MarqueePos > 0)
|
||||
{
|
||||
rect.right = min(old_left + (infoPtr->MarqueePos * (ledWidth + LED_GAP)), old_right);
|
||||
FillRect(hdc, &rect, hbrBk);
|
||||
rect.left = rect.right;
|
||||
}
|
||||
for(i = 0; i < MARQUEE_LEDS && rect.right < old_right; i++)
|
||||
{
|
||||
rect.right = min(rect.left + ledWidth, old_right);
|
||||
FillRect(hdc, &rect, hbrBar);
|
||||
rect.left = rect.right;
|
||||
rect.right += LED_GAP;
|
||||
if (rect.right > old_right) break;
|
||||
FillRect(hdc, &rect, hbrBk);
|
||||
rect.left = rect.right;
|
||||
}
|
||||
if(rect.right < old_right)
|
||||
{
|
||||
rect.right = old_right;
|
||||
FillRect(hdc, &rect, hbrBk);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while(rect.left < rightBar) {
|
||||
rect.right = rect.left + ledWidth;
|
||||
if (rect.right > rightMost)
|
||||
rect.right = rightMost;
|
||||
FillRect(hdc, &rect, hbrBar);
|
||||
rect.left = rect.right;
|
||||
rect.right += LED_GAP;
|
||||
if (rect.right >= rightBar) break;
|
||||
FillRect(hdc, &rect, hbrBk);
|
||||
rect.left = rect.right;
|
||||
}
|
||||
rect.right = rightMost;
|
||||
FillRect(hdc, &rect, hbrBk);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int barEnd = get_bar_position( infoPtr, dwStyle, &pdi.rect,
|
||||
infoPtr->CurVal);
|
||||
if (!barSmooth)
|
||||
{
|
||||
const int ledW = pdi.ledW + pdi.ledGap;
|
||||
barEnd = min (((barEnd + ledW - 1) / ledW) * ledW, barSize);
|
||||
}
|
||||
drawProcs[0]( &pdi, 0, barEnd);
|
||||
drawProcs[1]( &pdi, barEnd, barSize);
|
||||
}
|
||||
|
||||
/* delete bar brush */
|
||||
if (infoPtr->ColorBar != CLR_DEFAULT) DeleteObject (hbrBar);
|
||||
if (infoPtr->ColorBk != CLR_DEFAULT) DeleteObject (hbrBk);
|
||||
if (infoPtr->ColorBar != CLR_DEFAULT) DeleteObject (pdi.hbrBar);
|
||||
if (infoPtr->ColorBk != CLR_DEFAULT) DeleteObject (pdi.hbrBk);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* PROGRESS_Paint
|
||||
* Draw the progress bar. The background need not be erased.
|
||||
|
@ -404,39 +492,19 @@ static LRESULT PROGRESS_Timer (PROGRESS_INFO *infoPtr, INT idTimer)
|
|||
LONG style = GetWindowLongW (infoPtr->Self, GWL_STYLE);
|
||||
RECT rect;
|
||||
int ledWidth, leds;
|
||||
HTHEME theme = GetWindowTheme (infoPtr->Self);
|
||||
BOOL barSmooth = (style & PBS_SMOOTH) && !theme;
|
||||
|
||||
GetClientRect (infoPtr->Self, &rect);
|
||||
InflateRect(&rect, -1, -1);
|
||||
get_client_rect (infoPtr->Self, &rect);
|
||||
|
||||
if(!(style & PBS_SMOOTH))
|
||||
{
|
||||
int width, height;
|
||||
|
||||
if(style & PBS_VERTICAL)
|
||||
{
|
||||
width = rect.bottom - rect.top;
|
||||
height = rect.right - rect.left;
|
||||
}
|
||||
else
|
||||
{
|
||||
height = rect.bottom - rect.top;
|
||||
width = rect.right - rect.left;
|
||||
}
|
||||
ledWidth = MulDiv (height, 2, 3);
|
||||
leds = (width + ledWidth - 1) / (ledWidth + LED_GAP);
|
||||
}
|
||||
if(!barSmooth)
|
||||
ledWidth = get_led_size( infoPtr, style, &rect ) +
|
||||
get_led_gap( infoPtr );
|
||||
else
|
||||
{
|
||||
ledWidth = 1;
|
||||
if(style & PBS_VERTICAL)
|
||||
{
|
||||
leds = rect.bottom - rect.top;
|
||||
}
|
||||
else
|
||||
{
|
||||
leds = rect.right - rect.left;
|
||||
}
|
||||
}
|
||||
|
||||
leds = (get_bar_size( style, &rect ) + ledWidth - 1) /
|
||||
ledWidth;
|
||||
|
||||
/* increment the marquee progress */
|
||||
if(++infoPtr->MarqueePos >= leds)
|
||||
|
@ -444,7 +512,8 @@ static LRESULT PROGRESS_Timer (PROGRESS_INFO *infoPtr, INT idTimer)
|
|||
infoPtr->MarqueePos = 0;
|
||||
}
|
||||
|
||||
InvalidateRect(infoPtr->Self, &rect, TRUE);
|
||||
InvalidateRect(infoPtr->Self, &rect, FALSE);
|
||||
UpdateWindow(infoPtr->Self);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -496,6 +565,8 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
|
|||
WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
PROGRESS_INFO *infoPtr;
|
||||
static const WCHAR themeClass[] = {'P','r','o','g','r','e','s','s',0};
|
||||
HTHEME theme;
|
||||
|
||||
TRACE("hwnd=%p msg=%04x wparam=%x lParam=%lx\n", hwnd, message, wParam, lParam);
|
||||
|
||||
|
@ -508,8 +579,11 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
|
|||
case WM_CREATE:
|
||||
{
|
||||
DWORD dwExStyle = GetWindowLongW (hwnd, GWL_EXSTYLE);
|
||||
|
||||
theme = OpenThemeData (hwnd, themeClass);
|
||||
|
||||
dwExStyle &= ~(WS_EX_CLIENTEDGE | WS_EX_WINDOWEDGE);
|
||||
dwExStyle |= WS_EX_STATICEDGE;
|
||||
if (!theme) dwExStyle |= WS_EX_STATICEDGE;
|
||||
SetWindowLongW (hwnd, GWL_EXSTYLE, dwExStyle);
|
||||
/* Force recalculation of a non-client area */
|
||||
SetWindowPos(hwnd, 0, 0, 0, 0, 0,
|
||||
|
@ -531,6 +605,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
|
|||
infoPtr->ColorBar = CLR_DEFAULT;
|
||||
infoPtr->ColorBk = CLR_DEFAULT;
|
||||
infoPtr->Font = 0;
|
||||
|
||||
TRACE("Progress Ctrl creation, hwnd=%p\n", hwnd);
|
||||
return 0;
|
||||
}
|
||||
|
@ -539,8 +614,13 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
|
|||
TRACE("Progress Ctrl destruction, hwnd=%p\n", hwnd);
|
||||
Free (infoPtr);
|
||||
SetWindowLongPtrW(hwnd, 0, 0);
|
||||
theme = GetWindowTheme (hwnd);
|
||||
CloseThemeData (theme);
|
||||
return 0;
|
||||
|
||||
case WM_ERASEBKGND:
|
||||
return 1;
|
||||
|
||||
case WM_GETFONT:
|
||||
return (LRESULT)infoPtr->Font;
|
||||
|
||||
|
@ -553,6 +633,25 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
|
|||
case WM_TIMER:
|
||||
return PROGRESS_Timer (infoPtr, (INT)wParam);
|
||||
|
||||
case WM_THEMECHANGED:
|
||||
{
|
||||
DWORD dwExStyle = GetWindowLongW (hwnd, GWL_EXSTYLE);
|
||||
|
||||
theme = GetWindowTheme (hwnd);
|
||||
CloseThemeData (theme);
|
||||
theme = OpenThemeData (hwnd, themeClass);
|
||||
|
||||
/* WS_EX_STATICEDGE disappears when the control is themed */
|
||||
if (theme)
|
||||
dwExStyle &= ~WS_EX_STATICEDGE;
|
||||
else
|
||||
dwExStyle |= WS_EX_STATICEDGE;
|
||||
SetWindowLongW (hwnd, GWL_EXSTYLE, dwExStyle);
|
||||
|
||||
InvalidateRect (hwnd, NULL, FALSE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
case PBM_DELTAPOS:
|
||||
{
|
||||
INT oldVal;
|
||||
|
@ -562,6 +661,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
|
|||
PROGRESS_CoercePos (infoPtr);
|
||||
TRACE("PBM_DELTAPOS: current pos changed from %d to %d\n", oldVal, infoPtr->CurVal);
|
||||
PROGRESS_Invalidate( infoPtr, oldVal, infoPtr->CurVal );
|
||||
UpdateWindow( infoPtr->Self );
|
||||
}
|
||||
return oldVal;
|
||||
}
|
||||
|
@ -575,6 +675,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
|
|||
PROGRESS_CoercePos(infoPtr);
|
||||
TRACE("PBM_SETPOS: current pos changed from %d to %d\n", oldVal, infoPtr->CurVal);
|
||||
PROGRESS_Invalidate( infoPtr, oldVal, infoPtr->CurVal );
|
||||
UpdateWindow( infoPtr->Self );
|
||||
}
|
||||
return oldVal;
|
||||
}
|
||||
|
@ -601,6 +702,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
|
|||
{
|
||||
TRACE("PBM_STEPIT: current pos changed from %d to %d\n", oldVal, infoPtr->CurVal);
|
||||
PROGRESS_Invalidate( infoPtr, oldVal, infoPtr->CurVal );
|
||||
UpdateWindow( infoPtr->Self );
|
||||
}
|
||||
return oldVal;
|
||||
}
|
||||
|
|
|
@ -162,7 +162,7 @@ const WCHAR PropSheetInfoStr[] =
|
|||
/******************************************************************************
|
||||
* Prototypes
|
||||
*/
|
||||
static int PROPSHEET_CreateDialog(PropSheetInfo* psInfo);
|
||||
static INT_PTR PROPSHEET_CreateDialog(PropSheetInfo* psInfo);
|
||||
static BOOL PROPSHEET_SizeMismatch(HWND hwndDlg, PropSheetInfo* psInfo);
|
||||
static BOOL PROPSHEET_AdjustSize(HWND hwndDlg, PropSheetInfo* psInfo);
|
||||
static BOOL PROPSHEET_AdjustButtons(HWND hwndParent, PropSheetInfo* psInfo);
|
||||
|
@ -452,6 +452,9 @@ BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEW lppsp,
|
|||
DWORD dwFlags;
|
||||
int width, height;
|
||||
|
||||
if (!lppsp)
|
||||
return FALSE;
|
||||
|
||||
TRACE("\n");
|
||||
psInfo->proppage[index].hpage = (HPROPSHEETPAGE)lppsp;
|
||||
psInfo->proppage[index].hwndPage = 0;
|
||||
|
@ -591,7 +594,7 @@ BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEW lppsp,
|
|||
|
||||
if ( !HIWORD( lppsp->pszTitle ) )
|
||||
{
|
||||
if (!LoadStringW( lppsp->hInstance, (UINT)lppsp->pszTitle,szTitle,sizeof(szTitle) ))
|
||||
if (!LoadStringW( lppsp->hInstance, (DWORD_PTR)lppsp->pszTitle,szTitle,sizeof(szTitle) ))
|
||||
{
|
||||
pTitle = pszNull;
|
||||
FIXME("Could not load resource #%04x?\n",LOWORD(lppsp->pszTitle));
|
||||
|
@ -640,7 +643,7 @@ BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEW lppsp,
|
|||
*
|
||||
* Creates the actual property sheet.
|
||||
*/
|
||||
int PROPSHEET_CreateDialog(PropSheetInfo* psInfo)
|
||||
INT_PTR PROPSHEET_CreateDialog(PropSheetInfo* psInfo)
|
||||
{
|
||||
LRESULT ret;
|
||||
LPCVOID template;
|
||||
|
@ -708,7 +711,7 @@ int PROPSHEET_CreateDialog(PropSheetInfo* psInfo)
|
|||
* -1 (error). */
|
||||
if( psInfo->unicode )
|
||||
{
|
||||
ret = (int)CreateDialogIndirectParamW(psInfo->ppshheader.hInstance,
|
||||
ret = (INT_PTR)CreateDialogIndirectParamW(psInfo->ppshheader.hInstance,
|
||||
(LPDLGTEMPLATEW) temp,
|
||||
psInfo->ppshheader.hwndParent,
|
||||
PROPSHEET_DialogProc,
|
||||
|
@ -717,7 +720,7 @@ int PROPSHEET_CreateDialog(PropSheetInfo* psInfo)
|
|||
}
|
||||
else
|
||||
{
|
||||
ret = (int)CreateDialogIndirectParamA(psInfo->ppshheader.hInstance,
|
||||
ret = (INT_PTR)CreateDialogIndirectParamA(psInfo->ppshheader.hInstance,
|
||||
(LPDLGTEMPLATEA) temp,
|
||||
psInfo->ppshheader.hwndParent,
|
||||
PROPSHEET_DialogProc,
|
||||
|
@ -827,8 +830,8 @@ static BOOL PROPSHEET_AdjustSize(HWND hwndDlg, PropSheetInfo* psInfo)
|
|||
|
||||
rc.right -= rc.left;
|
||||
rc.bottom -= rc.top;
|
||||
TRACE("setting tab %08lx, rc (0,0)-(%ld,%ld)\n",
|
||||
(DWORD)hwndTabCtrl, rc.right, rc.bottom);
|
||||
TRACE("setting tab %p, rc (0,0)-(%ld,%ld)\n",
|
||||
hwndTabCtrl, rc.right, rc.bottom);
|
||||
SetWindowPos(hwndTabCtrl, 0, 0, 0, rc.right, rc.bottom,
|
||||
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
|
||||
|
@ -843,8 +846,8 @@ static BOOL PROPSHEET_AdjustSize(HWND hwndDlg, PropSheetInfo* psInfo)
|
|||
/*
|
||||
* Resize the property sheet.
|
||||
*/
|
||||
TRACE("setting dialog %08lx, rc (0,0)-(%ld,%ld)\n",
|
||||
(DWORD)hwndDlg, rc.right, rc.bottom);
|
||||
TRACE("setting dialog %p, rc (0,0)-(%ld,%ld)\n",
|
||||
hwndDlg, rc.right, rc.bottom);
|
||||
SetWindowPos(hwndDlg, 0, 0, 0, rc.right, rc.bottom,
|
||||
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
return TRUE;
|
||||
|
@ -879,8 +882,8 @@ static BOOL PROPSHEET_AdjustSizeWizard(HWND hwndDlg, PropSheetInfo* psInfo)
|
|||
AdjustWindowRect(&rc, GetWindowLongW(hwndDlg, GWL_STYLE), FALSE);
|
||||
|
||||
/* Resize the property sheet */
|
||||
TRACE("setting dialog %08lx, rc (0,0)-(%ld,%ld)\n",
|
||||
(DWORD)hwndDlg, rc.right, rc.bottom);
|
||||
TRACE("setting dialog %p, rc (0,0)-(%ld,%ld)\n",
|
||||
hwndDlg, rc.right, rc.bottom);
|
||||
SetWindowPos(hwndDlg, 0, 0, 0, rc.right - rc.left, rc.bottom - rc.top,
|
||||
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
|
||||
|
@ -1361,7 +1364,7 @@ static UINT GetTemplateSize(DLGTEMPLATE* pTemplate)
|
|||
TRACE("%d items\n",nrofitems);
|
||||
while (nrofitems > 0)
|
||||
{
|
||||
p = (WORD*)(((DWORD)p + 3) & ~3); /* DWORD align */
|
||||
p = (WORD*)(((DWORD_PTR)p + 3) & ~3); /* DWORD align */
|
||||
|
||||
/* skip header */
|
||||
p += (istemplateex ? sizeof(MyDLGITEMTEMPLATEEX) : sizeof(DLGITEMTEMPLATE))/sizeof(WORD);
|
||||
|
@ -1564,7 +1567,7 @@ static VOID PROPSHEET_LoadWizardBitmaps(PropSheetInfo *psInfo)
|
|||
!(psInfo->ppshheader.dwFlags & PSH_USEHBMWATERMARK))
|
||||
{
|
||||
((PropSheetInfo *)psInfo)->ppshheader.u4.hbmWatermark =
|
||||
CreateMappedBitmap(psInfo->ppshheader.hInstance, (INT)psInfo->ppshheader.u4.pszbmWatermark, 0, NULL, 0);
|
||||
CreateMappedBitmap(psInfo->ppshheader.hInstance, (INT_PTR)psInfo->ppshheader.u4.pszbmWatermark, 0, NULL, 0);
|
||||
}
|
||||
|
||||
/* Same behavior as for watermarks */
|
||||
|
@ -1572,7 +1575,7 @@ static VOID PROPSHEET_LoadWizardBitmaps(PropSheetInfo *psInfo)
|
|||
!(psInfo->ppshheader.dwFlags & PSH_USEHBMHEADER))
|
||||
{
|
||||
((PropSheetInfo *)psInfo)->ppshheader.u5.hbmHeader =
|
||||
CreateMappedBitmap(psInfo->ppshheader.hInstance, (INT)psInfo->ppshheader.u5.pszbmHeader, 0, NULL, 0);
|
||||
CreateMappedBitmap(psInfo->ppshheader.hInstance, (INT_PTR)psInfo->ppshheader.u5.pszbmHeader, 0, NULL, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2631,7 +2634,7 @@ static LRESULT PROPSHEET_IdToIndex(HWND hwndDlg, int iPageId)
|
|||
TRACE("(%p, %d)\n", hwndDlg, iPageId);
|
||||
for (index = 0; index < psInfo->nPages; index++) {
|
||||
psp = (LPCPROPSHEETPAGEW)psInfo->proppage[index].hpage;
|
||||
if (psp->u.pszTemplate == (LPCWSTR)iPageId)
|
||||
if (psp->u.pszTemplate == MAKEINTRESOURCEW(iPageId))
|
||||
return index;
|
||||
}
|
||||
|
||||
|
@ -2799,9 +2802,9 @@ static INT do_loop(PropSheetInfo *psInfo)
|
|||
*| ID_PSREBOOTSYSTEM - The user must reboot the computer for the changes to take effect.
|
||||
*| ID_PSRESTARTWINDOWS - The user must restart Windows for the changes to take effect.
|
||||
*/
|
||||
INT WINAPI PropertySheetA(LPCPROPSHEETHEADERA lppsh)
|
||||
INT_PTR WINAPI PropertySheetA(LPCPROPSHEETHEADERA lppsh)
|
||||
{
|
||||
int bRet = 0;
|
||||
INT_PTR bRet = 0;
|
||||
PropSheetInfo* psInfo = (PropSheetInfo*) GlobalAlloc(GPTR,
|
||||
sizeof(PropSheetInfo));
|
||||
UINT i, n;
|
||||
|
@ -2850,9 +2853,9 @@ INT WINAPI PropertySheetA(LPCPROPSHEETHEADERA lppsh)
|
|||
*
|
||||
* See PropertySheetA.
|
||||
*/
|
||||
INT WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
|
||||
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
|
||||
{
|
||||
int bRet = 0;
|
||||
INT_PTR bRet = 0;
|
||||
PropSheetInfo* psInfo = (PropSheetInfo*) GlobalAlloc(GPTR,
|
||||
sizeof(PropSheetInfo));
|
||||
UINT i, n;
|
||||
|
@ -3238,7 +3241,7 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
|
|||
}
|
||||
else
|
||||
{
|
||||
nLength = LoadStringW(ppshpage->hInstance, (UINT)ppshpage->pszHeaderTitle,
|
||||
nLength = LoadStringW(ppshpage->hInstance, (UINT_PTR)ppshpage->pszHeaderTitle,
|
||||
szBuffer, 256);
|
||||
if (nLength != 0)
|
||||
{
|
||||
|
@ -3262,7 +3265,7 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
|
|||
}
|
||||
else
|
||||
{
|
||||
nLength = LoadStringW(ppshpage->hInstance, (UINT)ppshpage->pszHeaderSubTitle,
|
||||
nLength = LoadStringW(ppshpage->hInstance, (UINT_PTR)ppshpage->pszHeaderSubTitle,
|
||||
szBuffer, 256);
|
||||
if (nLength != 0)
|
||||
{
|
||||
|
@ -3440,7 +3443,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
WCHAR szText[256];
|
||||
|
||||
if (LoadStringW(psInfo->ppshheader.hInstance,
|
||||
(UINT)psInfo->ppshheader.pszCaption, szText, 255))
|
||||
(UINT_PTR)psInfo->ppshheader.pszCaption, szText, 255))
|
||||
PROPSHEET_SetTitleW(hwnd, psInfo->ppshheader.dwFlags, szText);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -102,6 +102,8 @@
|
|||
#include "winnls.h"
|
||||
#include "commctrl.h"
|
||||
#include "comctl32.h"
|
||||
#include "uxtheme.h"
|
||||
#include "tmschema.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(rebar);
|
||||
|
@ -184,6 +186,7 @@ typedef struct
|
|||
HFONT hFont; /* handle to the rebar's font */
|
||||
SIZE imageSize; /* image size (image list) */
|
||||
DWORD dwStyle; /* window style */
|
||||
DWORD orgStyle; /* original style (dwStyle may change) */
|
||||
SIZE calcSize; /* calculated rebar size */
|
||||
SIZE oldSize; /* previous calculated rebar size */
|
||||
BOOL bUnicode; /* TRUE if this window is W type */
|
||||
|
@ -322,6 +325,7 @@ static const char *band_maskname[] = {
|
|||
|
||||
static CHAR line[200];
|
||||
|
||||
static const WCHAR themeClass[] = { 'R','e','b','a','r',0 };
|
||||
|
||||
static CHAR *
|
||||
REBAR_FmtStyle( UINT style)
|
||||
|
@ -542,6 +546,7 @@ REBAR_DrawBand (HDC hdc, REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
|
|||
HFONT hOldFont = 0;
|
||||
INT oldBkMode = 0;
|
||||
NMCUSTOMDRAW nmcd;
|
||||
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
|
||||
|
||||
if (lpBand->fDraw & DRAW_TEXT) {
|
||||
hOldFont = SelectObject (hdc, infoPtr->hFont);
|
||||
|
@ -567,7 +572,19 @@ REBAR_DrawBand (HDC hdc, REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
|
|||
|
||||
/* draw gripper */
|
||||
if (lpBand->fDraw & DRAW_GRIPPER)
|
||||
DrawEdge (hdc, &lpBand->rcGripper, BDR_RAISEDINNER, BF_RECT | BF_MIDDLE);
|
||||
{
|
||||
if (theme)
|
||||
{
|
||||
RECT rcGripper = lpBand->rcGripper;
|
||||
int partId = (infoPtr->dwStyle & CCS_VERT) ? RP_GRIPPERVERT : RP_GRIPPER;
|
||||
GetThemeBackgroundExtent (theme, hdc, partId, 0, &rcGripper, &rcGripper);
|
||||
OffsetRect (&rcGripper, lpBand->rcGripper.left - rcGripper.left,
|
||||
lpBand->rcGripper.top - rcGripper.top);
|
||||
DrawThemeBackground (theme, hdc, partId, 0, &rcGripper, NULL);
|
||||
}
|
||||
else
|
||||
DrawEdge (hdc, &lpBand->rcGripper, BDR_RAISEDINNER, BF_RECT | BF_MIDDLE);
|
||||
}
|
||||
|
||||
/* draw caption image */
|
||||
if (lpBand->fDraw & DRAW_IMAGE) {
|
||||
|
@ -604,18 +621,32 @@ REBAR_DrawBand (HDC hdc, REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
|
|||
|
||||
if (!IsRectEmpty(&lpBand->rcChevron))
|
||||
{
|
||||
if (lpBand->fDraw & DRAW_CHEVRONPUSHED)
|
||||
if (theme)
|
||||
{
|
||||
DrawEdge(hdc, &lpBand->rcChevron, BDR_SUNKENOUTER, BF_RECT | BF_MIDDLE);
|
||||
REBAR_DrawChevron(hdc, lpBand->rcChevron.left+1, lpBand->rcChevron.top + 11, COLOR_WINDOWFRAME);
|
||||
}
|
||||
else if (lpBand->fDraw & DRAW_CHEVRONHOT)
|
||||
{
|
||||
DrawEdge(hdc, &lpBand->rcChevron, BDR_RAISEDINNER, BF_RECT | BF_MIDDLE);
|
||||
REBAR_DrawChevron(hdc, lpBand->rcChevron.left, lpBand->rcChevron.top + 10, COLOR_WINDOWFRAME);
|
||||
int stateId;
|
||||
if (lpBand->fDraw & DRAW_CHEVRONPUSHED)
|
||||
stateId = CHEVS_PRESSED;
|
||||
else if (lpBand->fDraw & DRAW_CHEVRONHOT)
|
||||
stateId = CHEVS_HOT;
|
||||
else
|
||||
stateId = CHEVS_NORMAL;
|
||||
DrawThemeBackground (theme, hdc, RP_CHEVRON, stateId, &lpBand->rcChevron, NULL);
|
||||
}
|
||||
else
|
||||
REBAR_DrawChevron(hdc, lpBand->rcChevron.left, lpBand->rcChevron.top + 10, COLOR_WINDOWFRAME);
|
||||
{
|
||||
if (lpBand->fDraw & DRAW_CHEVRONPUSHED)
|
||||
{
|
||||
DrawEdge(hdc, &lpBand->rcChevron, BDR_SUNKENOUTER, BF_RECT | BF_MIDDLE);
|
||||
REBAR_DrawChevron(hdc, lpBand->rcChevron.left+1, lpBand->rcChevron.top + 11, COLOR_WINDOWFRAME);
|
||||
}
|
||||
else if (lpBand->fDraw & DRAW_CHEVRONHOT)
|
||||
{
|
||||
DrawEdge(hdc, &lpBand->rcChevron, BDR_RAISEDINNER, BF_RECT | BF_MIDDLE);
|
||||
REBAR_DrawChevron(hdc, lpBand->rcChevron.left, lpBand->rcChevron.top + 10, COLOR_WINDOWFRAME);
|
||||
}
|
||||
else
|
||||
REBAR_DrawChevron(hdc, lpBand->rcChevron.left, lpBand->rcChevron.top + 10, COLOR_WINDOWFRAME);
|
||||
}
|
||||
}
|
||||
|
||||
if (lpBand->uCDret == (CDRF_NOTIFYPOSTPAINT | CDRF_NOTIFYITEMDRAW)) {
|
||||
|
@ -2201,8 +2232,11 @@ REBAR_InternalEraseBkGnd (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, REC
|
|||
UINT i;
|
||||
INT oldrow;
|
||||
HDC hdc = (HDC)wParam;
|
||||
RECT rect;
|
||||
RECT rect, cr;
|
||||
COLORREF old = CLR_NONE, new;
|
||||
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
|
||||
|
||||
GetClientRect (infoPtr->hwndSelf, &cr);
|
||||
|
||||
oldrow = -1;
|
||||
for(i=0; i<infoPtr->uNumBands; i++) {
|
||||
|
@ -2218,12 +2252,18 @@ REBAR_InternalEraseBkGnd (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, REC
|
|||
if (infoPtr->dwStyle & CCS_VERT) {
|
||||
rcRowSep.right += SEP_WIDTH_SIZE;
|
||||
rcRowSep.bottom = infoPtr->calcSize.cy;
|
||||
DrawEdge (hdc, &rcRowSep, EDGE_ETCHED, BF_RIGHT);
|
||||
if (theme)
|
||||
DrawThemeEdge (theme, hdc, RP_BAND, 0, &rcRowSep, EDGE_ETCHED, BF_RIGHT, NULL);
|
||||
else
|
||||
DrawEdge (hdc, &rcRowSep, EDGE_ETCHED, BF_RIGHT);
|
||||
}
|
||||
else {
|
||||
rcRowSep.bottom += SEP_WIDTH_SIZE;
|
||||
rcRowSep.right = infoPtr->calcSize.cx;
|
||||
DrawEdge (hdc, &rcRowSep, EDGE_ETCHED, BF_BOTTOM);
|
||||
if (theme)
|
||||
DrawThemeEdge (theme, hdc, RP_BAND, 0, &rcRowSep, EDGE_ETCHED, BF_BOTTOM, NULL);
|
||||
else
|
||||
DrawEdge (hdc, &rcRowSep, EDGE_ETCHED, BF_BOTTOM);
|
||||
}
|
||||
TRACE ("drawing band separator bottom (%ld,%ld)-(%ld,%ld)\n",
|
||||
rcRowSep.left, rcRowSep.top,
|
||||
|
@ -2237,11 +2277,17 @@ REBAR_InternalEraseBkGnd (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, REC
|
|||
rcSep = lpBand->rcBand;
|
||||
if (infoPtr->dwStyle & CCS_VERT) {
|
||||
rcSep.bottom += SEP_WIDTH_SIZE;
|
||||
DrawEdge (hdc, &rcSep, EDGE_ETCHED, BF_BOTTOM);
|
||||
if (theme)
|
||||
DrawThemeEdge (theme, hdc, RP_BAND, 0, &rcSep, EDGE_ETCHED, BF_BOTTOM, NULL);
|
||||
else
|
||||
DrawEdge (hdc, &rcSep, EDGE_ETCHED, BF_BOTTOM);
|
||||
}
|
||||
else {
|
||||
rcSep.right += SEP_WIDTH_SIZE;
|
||||
DrawEdge (hdc, &rcSep, EDGE_ETCHED, BF_RIGHT);
|
||||
if (theme)
|
||||
DrawThemeEdge (theme, hdc, RP_BAND, 0, &rcSep, EDGE_ETCHED, BF_RIGHT, NULL);
|
||||
else
|
||||
DrawEdge (hdc, &rcSep, EDGE_ETCHED, BF_RIGHT);
|
||||
}
|
||||
TRACE("drawing band separator right (%ld,%ld)-(%ld,%ld)\n",
|
||||
rcSep.left, rcSep.top, rcSep.right, rcSep.bottom);
|
||||
|
@ -2267,20 +2313,30 @@ REBAR_InternalEraseBkGnd (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, REC
|
|||
new = RGB(0,128,0);
|
||||
#endif
|
||||
}
|
||||
old = SetBkColor (hdc, new);
|
||||
|
||||
rect = lpBand->rcBand;
|
||||
TRACE("%s background color=0x%06lx, band (%ld,%ld)-(%ld,%ld), clip (%ld,%ld)-(%ld,%ld)\n",
|
||||
(lpBand->clrBack == CLR_NONE) ? "none" :
|
||||
((lpBand->clrBack == CLR_DEFAULT) ? "dft" : ""),
|
||||
GetBkColor(hdc),
|
||||
lpBand->rcBand.left,lpBand->rcBand.top,
|
||||
lpBand->rcBand.right,lpBand->rcBand.bottom,
|
||||
clip->left, clip->top,
|
||||
clip->right, clip->bottom);
|
||||
ExtTextOutW (hdc, 0, 0, ETO_OPAQUE, &rect, NULL, 0, 0);
|
||||
if (lpBand->clrBack != CLR_NONE)
|
||||
SetBkColor (hdc, old);
|
||||
|
||||
if (theme)
|
||||
{
|
||||
/* When themed, the background color is ignored (but not a
|
||||
* background bitmap */
|
||||
DrawThemeBackground (theme, hdc, 0, 0, &cr, &rect);
|
||||
}
|
||||
else
|
||||
{
|
||||
old = SetBkColor (hdc, new);
|
||||
TRACE("%s background color=0x%06lx, band (%ld,%ld)-(%ld,%ld), clip (%ld,%ld)-(%ld,%ld)\n",
|
||||
(lpBand->clrBack == CLR_NONE) ? "none" :
|
||||
((lpBand->clrBack == CLR_DEFAULT) ? "dft" : ""),
|
||||
GetBkColor(hdc),
|
||||
lpBand->rcBand.left,lpBand->rcBand.top,
|
||||
lpBand->rcBand.right,lpBand->rcBand.bottom,
|
||||
clip->left, clip->top,
|
||||
clip->right, clip->bottom);
|
||||
ExtTextOutW (hdc, 0, 0, ETO_OPAQUE, &rect, NULL, 0, 0);
|
||||
if (lpBand->clrBack != CLR_NONE)
|
||||
SetBkColor (hdc, old);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -3759,6 +3815,7 @@ REBAR_Create (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
|||
{
|
||||
LPCREATESTRUCTW cs = (LPCREATESTRUCTW) lParam;
|
||||
RECT wnrc1, clrc1;
|
||||
HTHEME theme;
|
||||
|
||||
if (TRACE_ON(rebar)) {
|
||||
GetWindowRect(infoPtr->hwndSelf, &wnrc1);
|
||||
|
@ -3770,6 +3827,13 @@ REBAR_Create (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
|
||||
TRACE("created!\n");
|
||||
|
||||
if ((theme = OpenThemeData (infoPtr->hwndSelf, themeClass)))
|
||||
{
|
||||
/* native seems to clear WS_BORDER when themed */
|
||||
infoPtr->dwStyle &= ~WS_BORDER;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -3807,6 +3871,8 @@ REBAR_Destroy (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
|||
DestroyCursor (infoPtr->hcurDrag);
|
||||
if(infoPtr->hDefaultFont) DeleteObject (infoPtr->hDefaultFont);
|
||||
SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0);
|
||||
|
||||
CloseThemeData (GetWindowTheme (infoPtr->hwndSelf));
|
||||
|
||||
/* free rebar info data */
|
||||
Free (infoPtr);
|
||||
|
@ -3869,7 +3935,7 @@ REBAR_LButtonDown (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
|||
{
|
||||
REBAR_BAND *lpBand;
|
||||
UINT htFlags;
|
||||
UINT iHitBand;
|
||||
INT iHitBand;
|
||||
POINT ptMouseDown;
|
||||
ptMouseDown.x = (INT)LOWORD(lParam);
|
||||
ptMouseDown.y = (INT)HIWORD(lParam);
|
||||
|
@ -4051,10 +4117,15 @@ REBAR_MouseMove (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
|||
inline static LRESULT
|
||||
REBAR_NCCalcSize (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
HTHEME theme;
|
||||
if (infoPtr->dwStyle & WS_BORDER) {
|
||||
InflateRect((LPRECT)lParam, -GetSystemMetrics(SM_CXEDGE),
|
||||
-GetSystemMetrics(SM_CYEDGE));
|
||||
}
|
||||
else if ((theme = GetWindowTheme (infoPtr->hwndSelf)))
|
||||
{
|
||||
((LPRECT)lParam)->top++;
|
||||
}
|
||||
TRACE("new client=(%ld,%ld)-(%ld,%ld)\n",
|
||||
((LPRECT)lParam)->left, ((LPRECT)lParam)->top,
|
||||
((LPRECT)lParam)->right, ((LPRECT)lParam)->bottom);
|
||||
|
@ -4117,6 +4188,8 @@ REBAR_NCCreate (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
infoPtr->NtfUnicode = (i == NFR_UNICODE) ? 1 : 0;
|
||||
|
||||
/* Stow away the original style */
|
||||
infoPtr->orgStyle = cs->style;
|
||||
/* add necessary styles to the requested styles */
|
||||
infoPtr->dwStyle = cs->style | WS_VISIBLE | CCS_TOP;
|
||||
SetWindowLongW (hwnd, GWL_STYLE, infoPtr->dwStyle);
|
||||
|
@ -4200,6 +4273,7 @@ REBAR_NCPaint (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
|||
{
|
||||
RECT rcWindow;
|
||||
HDC hdc;
|
||||
HTHEME theme;
|
||||
|
||||
if (infoPtr->dwStyle & WS_MINIMIZE)
|
||||
return 0; /* Nothing to do */
|
||||
|
@ -4217,6 +4291,19 @@ REBAR_NCPaint (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
|||
DrawEdge (hdc, &rcWindow, EDGE_ETCHED, BF_RECT);
|
||||
ReleaseDC( infoPtr->hwndSelf, hdc );
|
||||
}
|
||||
else if ((theme = GetWindowTheme (infoPtr->hwndSelf)))
|
||||
{
|
||||
/* adjust rectangle and draw the necessary edge */
|
||||
if (!(hdc = GetDCEx( infoPtr->hwndSelf, 0, DCX_USESTYLE | DCX_WINDOW )))
|
||||
return 0;
|
||||
GetWindowRect (infoPtr->hwndSelf, &rcWindow);
|
||||
OffsetRect (&rcWindow, -rcWindow.left, -rcWindow.top);
|
||||
TRACE("rect (%ld,%ld)-(%ld,%ld)\n",
|
||||
rcWindow.left, rcWindow.top,
|
||||
rcWindow.right, rcWindow.bottom);
|
||||
DrawThemeEdge (theme, hdc, 0, 0, &rcWindow, BDR_RAISEDINNER, BF_TOP, NULL);
|
||||
ReleaseDC( infoPtr->hwndSelf, hdc );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -4456,11 +4543,25 @@ REBAR_StyleChanged (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
TRACE("current style=%08lx, styleOld=%08lx, style being set to=%08lx\n",
|
||||
infoPtr->dwStyle, ss->styleOld, ss->styleNew);
|
||||
infoPtr->dwStyle = ss->styleNew;
|
||||
infoPtr->orgStyle = infoPtr->dwStyle = ss->styleNew;
|
||||
if (GetWindowTheme (infoPtr->hwndSelf))
|
||||
infoPtr->dwStyle &= ~WS_BORDER;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* update theme after a WM_THEMECHANGED message */
|
||||
static LRESULT theme_changed (REBAR_INFO* infoPtr)
|
||||
{
|
||||
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
|
||||
CloseThemeData (theme);
|
||||
theme = OpenThemeData (infoPtr->hwndSelf, themeClass);
|
||||
/* WS_BORDER disappears when theming is enabled and reappears when
|
||||
* disabled... */
|
||||
infoPtr->dwStyle &= ~WS_BORDER;
|
||||
infoPtr->dwStyle |= theme ? 0 : (infoPtr->orgStyle & WS_BORDER);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static LRESULT
|
||||
REBAR_WindowPosChanged (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
||||
|
@ -4691,6 +4792,9 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
case WM_STYLECHANGED:
|
||||
return REBAR_StyleChanged (infoPtr, wParam, lParam);
|
||||
|
||||
case WM_THEMECHANGED:
|
||||
return theme_changed (infoPtr);
|
||||
|
||||
/* case WM_SYSCOLORCHANGE: supported according to ControlSpy */
|
||||
/* "Applications that have brushes using the existing system colors
|
||||
should delete those brushes and recreate them using the new
|
||||
|
|
|
@ -51,6 +51,8 @@
|
|||
#include "winnls.h"
|
||||
#include "commctrl.h"
|
||||
#include "comctl32.h"
|
||||
#include "uxtheme.h"
|
||||
#include "tmschema.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(statusbar);
|
||||
|
@ -94,6 +96,8 @@ typedef struct
|
|||
#define VERT_BORDER 2
|
||||
#define HORZ_GAP 2
|
||||
|
||||
const static WCHAR themeClass[] = { 'S','t','a','t','u','s',0 };
|
||||
|
||||
/* prototype */
|
||||
static void
|
||||
STATUSBAR_SetPartBounds (STATUS_INFO *infoPtr);
|
||||
|
@ -104,13 +108,28 @@ static inline LPCSTR debugstr_t(LPCWSTR text, BOOL isW)
|
|||
}
|
||||
|
||||
static void
|
||||
STATUSBAR_DrawSizeGrip (HDC hdc, LPRECT lpRect)
|
||||
STATUSBAR_DrawSizeGrip (HTHEME theme, HDC hdc, LPRECT lpRect)
|
||||
{
|
||||
HPEN hPenFace, hPenShadow, hPenHighlight, hOldPen;
|
||||
POINT pt;
|
||||
INT i;
|
||||
|
||||
TRACE("draw size grip %ld,%ld - %ld,%ld\n", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);
|
||||
|
||||
if (theme)
|
||||
{
|
||||
RECT gripperRect;
|
||||
SIZE gripperSize;
|
||||
gripperRect = *lpRect;
|
||||
if (SUCCEEDED (GetThemePartSize (theme, hdc, SP_GRIPPER, 0, lpRect,
|
||||
TS_DRAW, &gripperSize)))
|
||||
{
|
||||
gripperRect.left = gripperRect.right - gripperSize.cx;
|
||||
gripperRect.top = gripperRect.bottom - gripperSize.cy;
|
||||
if (SUCCEEDED (DrawThemeBackground(theme, hdc, SP_GRIPPER, 0, &gripperRect, NULL)))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
pt.x = lpRect->right - 1;
|
||||
pt.y = lpRect->bottom - 1;
|
||||
|
@ -153,6 +172,8 @@ STATUSBAR_DrawPart (STATUS_INFO *infoPtr, HDC hdc, STATUSWINDOWPART *part, int i
|
|||
{
|
||||
RECT r = part->bound;
|
||||
UINT border = BDR_SUNKENOUTER;
|
||||
HTHEME theme = GetWindowTheme (infoPtr->Self);
|
||||
int themePart = SP_PANE;
|
||||
|
||||
TRACE("part bound %ld,%ld - %ld,%ld\n", r.left, r.top, r.right, r.bottom);
|
||||
if (part->style & SBT_POPOUT)
|
||||
|
@ -160,7 +181,15 @@ STATUSBAR_DrawPart (STATUS_INFO *infoPtr, HDC hdc, STATUSWINDOWPART *part, int i
|
|||
else if (part->style & SBT_NOBORDERS)
|
||||
border = 0;
|
||||
|
||||
DrawEdge(hdc, &r, border, BF_RECT|BF_ADJUST);
|
||||
if (theme)
|
||||
{
|
||||
if ((GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP)
|
||||
&& (infoPtr->simple || (itemID == (infoPtr->numParts-1))))
|
||||
themePart = SP_GRIPPERPANE;
|
||||
DrawThemeBackground(theme, hdc, themePart, 0, &r, NULL);
|
||||
}
|
||||
else
|
||||
DrawEdge(hdc, &r, border, BF_RECT|BF_ADJUST);
|
||||
|
||||
if (part->style & SBT_OWNERDRAW) {
|
||||
DRAWITEMSTRUCT dis;
|
||||
|
@ -170,7 +199,7 @@ STATUSBAR_DrawPart (STATUS_INFO *infoPtr, HDC hdc, STATUSWINDOWPART *part, int i
|
|||
dis.hwndItem = infoPtr->Self;
|
||||
dis.hDC = hdc;
|
||||
dis.rcItem = r;
|
||||
dis.itemData = (INT)part->text;
|
||||
dis.itemData = (ULONG_PTR)part->text;
|
||||
SendMessageW (infoPtr->Notify, WM_DRAWITEM, (WPARAM)dis.CtlID, (LPARAM)&dis);
|
||||
} else {
|
||||
if (part->hIcon) {
|
||||
|
@ -190,6 +219,7 @@ STATUSBAR_RefreshPart (STATUS_INFO *infoPtr, HDC hdc, STATUSWINDOWPART *part, in
|
|||
{
|
||||
HBRUSH hbrBk;
|
||||
HFONT hOldFont;
|
||||
HTHEME theme;
|
||||
|
||||
TRACE("item %d\n", itemID);
|
||||
if (!IsWindowVisible (infoPtr->Self))
|
||||
|
@ -197,11 +227,22 @@ STATUSBAR_RefreshPart (STATUS_INFO *infoPtr, HDC hdc, STATUSWINDOWPART *part, in
|
|||
|
||||
if (part->bound.right < part->bound.left) return;
|
||||
|
||||
if (infoPtr->clrBk != CLR_DEFAULT)
|
||||
hbrBk = CreateSolidBrush (infoPtr->clrBk);
|
||||
if ((theme = GetWindowTheme (infoPtr->Self)))
|
||||
{
|
||||
RECT cr;
|
||||
GetClientRect (infoPtr->Self, &cr);
|
||||
DrawThemeBackground(theme, hdc, 0, 0, &cr, &part->bound);
|
||||
}
|
||||
else
|
||||
hbrBk = GetSysColorBrush (COLOR_3DFACE);
|
||||
FillRect(hdc, &part->bound, hbrBk);
|
||||
{
|
||||
if (infoPtr->clrBk != CLR_DEFAULT)
|
||||
hbrBk = CreateSolidBrush (infoPtr->clrBk);
|
||||
else
|
||||
hbrBk = GetSysColorBrush (COLOR_3DFACE);
|
||||
FillRect(hdc, &part->bound, hbrBk);
|
||||
if (infoPtr->clrBk != CLR_DEFAULT)
|
||||
DeleteObject (hbrBk);
|
||||
}
|
||||
|
||||
hOldFont = SelectObject (hdc, infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont);
|
||||
|
||||
|
@ -209,14 +250,11 @@ STATUSBAR_RefreshPart (STATUS_INFO *infoPtr, HDC hdc, STATUSWINDOWPART *part, in
|
|||
|
||||
SelectObject (hdc, hOldFont);
|
||||
|
||||
if (infoPtr->clrBk != CLR_DEFAULT)
|
||||
DeleteObject (hbrBk);
|
||||
|
||||
if (GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP) {
|
||||
RECT rect;
|
||||
|
||||
GetClientRect (infoPtr->Self, &rect);
|
||||
STATUSBAR_DrawSizeGrip (hdc, &rect);
|
||||
STATUSBAR_DrawSizeGrip (theme, hdc, &rect);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -228,6 +266,7 @@ STATUSBAR_Refresh (STATUS_INFO *infoPtr, HDC hdc)
|
|||
RECT rect;
|
||||
HBRUSH hbrBk;
|
||||
HFONT hOldFont;
|
||||
HTHEME theme;
|
||||
|
||||
TRACE("\n");
|
||||
if (!IsWindowVisible(infoPtr->Self))
|
||||
|
@ -237,11 +276,20 @@ STATUSBAR_Refresh (STATUS_INFO *infoPtr, HDC hdc)
|
|||
|
||||
GetClientRect (infoPtr->Self, &rect);
|
||||
|
||||
if (infoPtr->clrBk != CLR_DEFAULT)
|
||||
hbrBk = CreateSolidBrush (infoPtr->clrBk);
|
||||
if ((theme = GetWindowTheme (infoPtr->Self)))
|
||||
{
|
||||
DrawThemeBackground(theme, hdc, 0, 0, &rect, NULL);
|
||||
}
|
||||
else
|
||||
hbrBk = GetSysColorBrush (COLOR_3DFACE);
|
||||
FillRect(hdc, &rect, hbrBk);
|
||||
{
|
||||
if (infoPtr->clrBk != CLR_DEFAULT)
|
||||
hbrBk = CreateSolidBrush (infoPtr->clrBk);
|
||||
else
|
||||
hbrBk = GetSysColorBrush (COLOR_3DFACE);
|
||||
FillRect(hdc, &rect, hbrBk);
|
||||
if (infoPtr->clrBk != CLR_DEFAULT)
|
||||
DeleteObject (hbrBk);
|
||||
}
|
||||
|
||||
hOldFont = SelectObject (hdc, infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont);
|
||||
|
||||
|
@ -255,11 +303,8 @@ STATUSBAR_Refresh (STATUS_INFO *infoPtr, HDC hdc)
|
|||
|
||||
SelectObject (hdc, hOldFont);
|
||||
|
||||
if (infoPtr->clrBk != CLR_DEFAULT)
|
||||
DeleteObject (hbrBk);
|
||||
|
||||
if (GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP)
|
||||
STATUSBAR_DrawSizeGrip (hdc, &rect);
|
||||
STATUSBAR_DrawSizeGrip (theme, hdc, &rect);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -570,9 +615,26 @@ STATUSBAR_SetMinHeight (STATUS_INFO *infoPtr, INT height)
|
|||
if (IsWindowVisible (infoPtr->Self)) {
|
||||
INT width, x, y;
|
||||
RECT parent_rect;
|
||||
HTHEME theme;
|
||||
|
||||
GetClientRect (infoPtr->Notify, &parent_rect);
|
||||
infoPtr->height = height + infoPtr->verticalBorder;
|
||||
|
||||
if ((theme = GetWindowTheme (infoPtr->Self)))
|
||||
{
|
||||
/* Determine bar height from theme such that the content area is
|
||||
* 'height' pixels large */
|
||||
HDC hdc = GetDC (infoPtr->Self);
|
||||
RECT r;
|
||||
memset (&r, 0, sizeof (r));
|
||||
r.bottom = height;
|
||||
if (SUCCEEDED(GetThemeBackgroundExtent (theme, hdc, SP_PANE, 0, &r, &r)))
|
||||
{
|
||||
infoPtr->height = r.bottom - r.top;
|
||||
}
|
||||
ReleaseDC (infoPtr->Self, hdc);
|
||||
}
|
||||
|
||||
width = parent_rect.right - parent_rect.left;
|
||||
x = parent_rect.left;
|
||||
y = parent_rect.bottom - infoPtr->height;
|
||||
|
@ -820,6 +882,8 @@ STATUSBAR_WMDestroy (STATUS_INFO *infoPtr)
|
|||
if (infoPtr->hwndToolTip)
|
||||
DestroyWindow (infoPtr->hwndToolTip);
|
||||
|
||||
CloseThemeData (GetWindowTheme (infoPtr->Self));
|
||||
|
||||
SetWindowLongPtrW(infoPtr->Self, 0, 0);
|
||||
Free (infoPtr);
|
||||
return 0;
|
||||
|
@ -879,6 +943,8 @@ STATUSBAR_WMCreate (HWND hwnd, LPCREATESTRUCTA lpCreate)
|
|||
infoPtr->parts[0].x = -1;
|
||||
infoPtr->parts[0].style = 0;
|
||||
infoPtr->parts[0].hIcon = 0;
|
||||
|
||||
OpenThemeData (hwnd, themeClass);
|
||||
|
||||
if (IsWindowUnicode (hwnd)) {
|
||||
infoPtr->bUnicode = TRUE;
|
||||
|
@ -901,11 +967,15 @@ STATUSBAR_WMCreate (HWND hwnd, LPCREATESTRUCTA lpCreate)
|
|||
}
|
||||
|
||||
dwStyle = GetWindowLongW (hwnd, GWL_STYLE);
|
||||
/* native seems to clear WS_BORDER, too */
|
||||
dwStyle &= ~WS_BORDER;
|
||||
|
||||
/* statusbars on managed windows should not have SIZEGRIP style */
|
||||
if ((dwStyle & SBARS_SIZEGRIP) && lpCreate->hwndParent &&
|
||||
GetPropA( lpCreate->hwndParent, "__wine_x11_managed" ))
|
||||
SetWindowLongW (hwnd, GWL_STYLE, dwStyle & ~SBARS_SIZEGRIP);
|
||||
dwStyle &= ~SBARS_SIZEGRIP;
|
||||
|
||||
SetWindowLongW (hwnd, GWL_STYLE, dwStyle);
|
||||
|
||||
if ((hdc = GetDC (hwnd))) {
|
||||
TEXTMETRICW tm;
|
||||
|
@ -940,9 +1010,26 @@ STATUSBAR_WMCreate (HWND hwnd, LPCREATESTRUCTA lpCreate)
|
|||
}
|
||||
|
||||
if (!(dwStyle & CCS_NORESIZE)) { /* don't resize wnd if it doesn't want it ! */
|
||||
HTHEME theme;
|
||||
GetClientRect (infoPtr->Notify, &rect);
|
||||
width = rect.right - rect.left;
|
||||
infoPtr->height = textHeight + 4 + infoPtr->verticalBorder;
|
||||
|
||||
if ((theme = GetWindowTheme (hwnd)))
|
||||
{
|
||||
/* Determine bar height from theme such that the content area is
|
||||
* textHeight pixels large */
|
||||
HDC hdc = GetDC (hwnd);
|
||||
RECT r;
|
||||
memset (&r, 0, sizeof (r));
|
||||
r.bottom = textHeight;
|
||||
if (SUCCEEDED(GetThemeBackgroundExtent (theme, hdc, SP_PANE, 0, &r, &r)))
|
||||
{
|
||||
infoPtr->height = r.bottom - r.top;
|
||||
}
|
||||
ReleaseDC (hwnd, hdc);
|
||||
}
|
||||
|
||||
SetWindowPos(hwnd, 0, lpCreate->x, lpCreate->y - 1,
|
||||
width, infoPtr->height, SWP_NOZORDER);
|
||||
STATUSBAR_SetPartBounds (infoPtr);
|
||||
|
@ -1102,6 +1189,16 @@ STATUSBAR_WMSize (STATUS_INFO *infoPtr, WORD flags)
|
|||
}
|
||||
|
||||
|
||||
/* update theme after a WM_THEMECHANGED message */
|
||||
static LRESULT theme_changed (STATUS_INFO* infoPtr)
|
||||
{
|
||||
HTHEME theme = GetWindowTheme (infoPtr->Self);
|
||||
CloseThemeData (theme);
|
||||
OpenThemeData (infoPtr->Self, themeClass);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
STATUSBAR_NotifyFormat (STATUS_INFO *infoPtr, HWND from, INT cmd)
|
||||
{
|
||||
|
@ -1264,6 +1361,9 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
if (STATUSBAR_WMSize (infoPtr, (WORD)wParam)) return 0;
|
||||
return DefWindowProcW (hwnd, msg, wParam, lParam);
|
||||
|
||||
case WM_THEMECHANGED:
|
||||
return theme_changed (infoPtr);
|
||||
|
||||
default:
|
||||
if ((msg >= WM_USER) && (msg < WM_APP))
|
||||
ERR("unknown msg %04x wp=%04x lp=%08lx\n",
|
||||
|
|
|
@ -73,6 +73,8 @@
|
|||
#include "winnls.h"
|
||||
#include "commctrl.h"
|
||||
#include "comctl32.h"
|
||||
#include "uxtheme.h"
|
||||
#include "tmschema.h"
|
||||
#include "wine/debug.h"
|
||||
#include <math.h>
|
||||
|
||||
|
@ -140,19 +142,26 @@ typedef struct
|
|||
#define BUTTON_SPACINGX 3
|
||||
#define BUTTON_SPACINGY 3
|
||||
#define FLAT_BTN_SPACINGX 8
|
||||
#define DEFAULT_TAB_WIDTH 96
|
||||
#define DEFAULT_MIN_TAB_WIDTH 54
|
||||
#define DEFAULT_TAB_WIDTH_FIXED 96
|
||||
#define DEFAULT_PADDING_X 6
|
||||
#define EXTRA_ICON_PADDING 3
|
||||
|
||||
#define TAB_GetInfoPtr(hwnd) ((TAB_INFO *)GetWindowLongPtrW(hwnd,0))
|
||||
/* Since items are variable sized, cannot directly access them */
|
||||
#define TAB_GetItem(info,i) \
|
||||
((TAB_ITEM*)((LPBYTE)info->items + (i) * TAB_ITEM_SIZE(info)))
|
||||
|
||||
#define GET_DEFAULT_MIN_TAB_WIDTH(infoPtr) (DEFAULT_MIN_TAB_WIDTH - (DEFAULT_PADDING_X - (infoPtr)->uHItemPadding) * 2)
|
||||
|
||||
/******************************************************************************
|
||||
* Hot-tracking timer constants
|
||||
*/
|
||||
#define TAB_HOTTRACK_TIMER 1
|
||||
#define TAB_HOTTRACK_TIMER_INTERVAL 100 /* milliseconds */
|
||||
|
||||
static const WCHAR themeClass[] = { 'T','a','b',0 };
|
||||
|
||||
/******************************************************************************
|
||||
* Prototypes
|
||||
*/
|
||||
|
@ -325,7 +334,18 @@ static BOOL TAB_InternalGetItemRect(
|
|||
if ( (infoPtr->uNumItem <= 0) ||
|
||||
(itemIndex >= infoPtr->uNumItem) ||
|
||||
(!((lStyle & TCS_MULTILINE) || (lStyle & TCS_VERTICAL)) && (itemIndex < infoPtr->leftmostVisible)) )
|
||||
return FALSE;
|
||||
{
|
||||
TRACE("Not Visible\n");
|
||||
/* need to initialize these to empty rects */
|
||||
if (itemRect)
|
||||
{
|
||||
memset(itemRect,0,sizeof(RECT));
|
||||
itemRect->bottom = infoPtr->tabHeight;
|
||||
}
|
||||
if (selectedRect)
|
||||
memset(selectedRect,0,sizeof(RECT));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Avoid special cases in this procedure by assigning the "out"
|
||||
|
@ -581,7 +601,8 @@ static LRESULT
|
|||
TAB_LButtonDown (TAB_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
POINT pt;
|
||||
INT newItem, dummy;
|
||||
INT newItem;
|
||||
UINT dummy;
|
||||
|
||||
if (infoPtr->hwndToolTip)
|
||||
TAB_RelayEvent (infoPtr->hwndToolTip, infoPtr->hwnd,
|
||||
|
@ -658,6 +679,22 @@ TAB_DrawLoneItemInterior(TAB_INFO* infoPtr, int iItem)
|
|||
ReleaseDC(infoPtr->hwnd, hdc);
|
||||
}
|
||||
|
||||
/* update a tab after hottracking - invalidate it or just redraw the interior,
|
||||
* based on whether theming is used or not */
|
||||
static inline void hottrack_refresh (TAB_INFO* infoPtr, int tabIndex)
|
||||
{
|
||||
if (tabIndex == -1) return;
|
||||
|
||||
if (GetWindowTheme (infoPtr->hwnd))
|
||||
{
|
||||
RECT rect;
|
||||
TAB_InternalGetItemRect(infoPtr, tabIndex, &rect, NULL);
|
||||
InvalidateRect (infoPtr->hwnd, &rect, FALSE);
|
||||
}
|
||||
else
|
||||
TAB_DrawLoneItemInterior(infoPtr, tabIndex);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TAB_HotTrackTimerProc
|
||||
*
|
||||
|
@ -674,7 +711,7 @@ TAB_HotTrackTimerProc
|
|||
(
|
||||
HWND hwnd, /* handle of window for timer messages */
|
||||
UINT uMsg, /* WM_TIMER message */
|
||||
UINT idEvent, /* timer identifier */
|
||||
UINT_PTR idEvent, /* timer identifier */
|
||||
DWORD dwTime /* current system time */
|
||||
)
|
||||
{
|
||||
|
@ -697,7 +734,7 @@ TAB_HotTrackTimerProc
|
|||
/* Redraw iHotTracked to look normal */
|
||||
INT iRedraw = infoPtr->iHotTracked;
|
||||
infoPtr->iHotTracked = -1;
|
||||
TAB_DrawLoneItemInterior(infoPtr, iRedraw);
|
||||
hottrack_refresh (infoPtr, iRedraw);
|
||||
|
||||
/* Kill this timer */
|
||||
KillTimer(hwnd, TAB_HOTTRACK_TIMER);
|
||||
|
@ -738,7 +775,8 @@ TAB_RecalcHotTrack
|
|||
if (out_redrawEnter != NULL)
|
||||
*out_redrawEnter = -1;
|
||||
|
||||
if (GetWindowLongW(infoPtr->hwnd, GWL_STYLE) & TCS_HOTTRACK)
|
||||
if ((GetWindowLongW(infoPtr->hwnd, GWL_STYLE) & TCS_HOTTRACK)
|
||||
|| GetWindowTheme (infoPtr->hwnd))
|
||||
{
|
||||
POINT pt;
|
||||
UINT flags;
|
||||
|
@ -816,10 +854,8 @@ TAB_MouseMove (TAB_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
|||
** status. */
|
||||
TAB_RecalcHotTrack(infoPtr, &lParam, &redrawLeave, &redrawEnter);
|
||||
|
||||
if (redrawLeave != -1)
|
||||
TAB_DrawLoneItemInterior(infoPtr, redrawLeave);
|
||||
if (redrawEnter != -1)
|
||||
TAB_DrawLoneItemInterior(infoPtr, redrawEnter);
|
||||
hottrack_refresh (infoPtr, redrawLeave);
|
||||
hottrack_refresh (infoPtr, redrawEnter);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1133,23 +1169,43 @@ static void TAB_SetItemBounds (TAB_INFO *infoPtr)
|
|||
/* Set the leftmost position of the tab. */
|
||||
curr->rect.left = curItemLeftPos;
|
||||
|
||||
if ((lStyle & TCS_FIXEDWIDTH) || !curr->pszText)
|
||||
if (lStyle & TCS_FIXEDWIDTH)
|
||||
{
|
||||
curr->rect.right = curr->rect.left +
|
||||
max(infoPtr->tabWidth, icon_width);
|
||||
}
|
||||
else if (!curr->pszText)
|
||||
{
|
||||
/* If no text use minimum tab width including padding. */
|
||||
if (infoPtr->tabMinWidth < 0)
|
||||
curr->rect.right = curr->rect.left + GET_DEFAULT_MIN_TAB_WIDTH(infoPtr);
|
||||
else
|
||||
{
|
||||
curr->rect.right = curr->rect.left + infoPtr->tabMinWidth;
|
||||
|
||||
/* Add extra padding if icon is present */
|
||||
if (infoPtr->himl && infoPtr->tabMinWidth > 0 && infoPtr->tabMinWidth < DEFAULT_MIN_TAB_WIDTH
|
||||
&& infoPtr->uHItemPadding > 1)
|
||||
curr->rect.right += EXTRA_ICON_PADDING * (infoPtr->uHItemPadding-1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int num = 2;
|
||||
|
||||
int tabwidth;
|
||||
/* Calculate how wide the tab is depending on the text it contains */
|
||||
GetTextExtentPoint32W(hdc, curr->pszText,
|
||||
lstrlenW(curr->pszText), &size);
|
||||
|
||||
curr->rect.right = curr->rect.left + size.cx + icon_width +
|
||||
num * infoPtr->uHItemPadding;
|
||||
TRACE("for <%s>, l,r=%ld,%ld, num=%d\n",
|
||||
debugstr_w(curr->pszText), curr->rect.left, curr->rect.right, num);
|
||||
tabwidth = size.cx + icon_width + 2 * infoPtr->uHItemPadding;
|
||||
|
||||
if (infoPtr->tabMinWidth < 0)
|
||||
tabwidth = max(tabwidth, GET_DEFAULT_MIN_TAB_WIDTH(infoPtr));
|
||||
else
|
||||
tabwidth = max(tabwidth, infoPtr->tabMinWidth);
|
||||
|
||||
curr->rect.right = curr->rect.left + tabwidth;
|
||||
TRACE("for <%s>, l,r=%ld,%ld\n",
|
||||
debugstr_w(curr->pszText), curr->rect.left, curr->rect.right);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1438,7 +1494,8 @@ TAB_EraseTabInterior
|
|||
}
|
||||
else /* !TCS_BUTTONS */
|
||||
{
|
||||
FillRect(hdc, &rTemp, hbr);
|
||||
if (!GetWindowTheme (infoPtr->hwnd))
|
||||
FillRect(hdc, &rTemp, hbr);
|
||||
}
|
||||
|
||||
/* Cleanup */
|
||||
|
@ -1600,9 +1657,11 @@ TAB_DrawItemInterior
|
|||
* Setup for text output
|
||||
*/
|
||||
oldBkMode = SetBkMode(hdc, TRANSPARENT);
|
||||
SetTextColor(hdc, (((iItem == infoPtr->iHotTracked) && !(lStyle & TCS_FLATBUTTONS)) |
|
||||
(TAB_GetItem(infoPtr, iItem)->dwState & TCIS_HIGHLIGHTED)) ?
|
||||
comctl32_color.clrHighlight : comctl32_color.clrBtnText);
|
||||
if (!GetWindowTheme (infoPtr->hwnd) || (lStyle & TCS_BUTTONS))
|
||||
SetTextColor(hdc, (((lStyle & TCS_HOTTRACK) && (iItem == infoPtr->iHotTracked)
|
||||
&& !(lStyle & TCS_FLATBUTTONS))
|
||||
| (TAB_GetItem(infoPtr, iItem)->dwState & TCIS_HIGHLIGHTED)) ?
|
||||
comctl32_color.clrHighlight : comctl32_color.clrBtnText);
|
||||
|
||||
/*
|
||||
* if owner draw, tell the owner to draw
|
||||
|
@ -1879,6 +1938,7 @@ static void TAB_DrawItem(
|
|||
INT clRight = 0;
|
||||
INT clBottom = 0;
|
||||
COLORREF bkgnd, corner;
|
||||
HTHEME theme;
|
||||
|
||||
/*
|
||||
* Get the rectangle for the item.
|
||||
|
@ -1955,7 +2015,53 @@ static void TAB_DrawItem(
|
|||
*/
|
||||
fillRect = r;
|
||||
|
||||
if(lStyle & TCS_VERTICAL)
|
||||
/* Draw themed tabs - but only if they are at the top.
|
||||
* Windows draws even side or bottom tabs themed, with wacky results.
|
||||
* However, since in Wine apps may get themed that did not opt in via
|
||||
* a manifest avoid theming when we know the result will be wrong */
|
||||
if ((theme = GetWindowTheme (infoPtr->hwnd))
|
||||
&& ((lStyle & (TCS_VERTICAL | TCS_BOTTOM)) == 0))
|
||||
{
|
||||
const static int partIds[8] = {
|
||||
/* Normal item */
|
||||
TABP_TABITEM,
|
||||
TABP_TABITEMLEFTEDGE,
|
||||
TABP_TABITEMRIGHTEDGE,
|
||||
TABP_TABITEMBOTHEDGE,
|
||||
/* Selected tab */
|
||||
TABP_TOPTABITEM,
|
||||
TABP_TOPTABITEMLEFTEDGE,
|
||||
TABP_TOPTABITEMRIGHTEDGE,
|
||||
TABP_TOPTABITEMBOTHEDGE,
|
||||
};
|
||||
int partIndex = 0;
|
||||
int stateId = TIS_NORMAL;
|
||||
|
||||
/* selected and unselected tabs have different parts */
|
||||
if (iItem == infoPtr->iSelected)
|
||||
partIndex += 4;
|
||||
/* The part also differs on the position of a tab on a line.
|
||||
* "Visually" determining the position works well enough. */
|
||||
if(selectedRect.left == 0)
|
||||
partIndex += 1;
|
||||
if(selectedRect.right == clRight)
|
||||
partIndex += 2;
|
||||
|
||||
if (iItem == infoPtr->iSelected)
|
||||
stateId = TIS_SELECTED;
|
||||
else if (iItem == infoPtr->iHotTracked)
|
||||
stateId = TIS_HOT;
|
||||
else if (iItem == infoPtr->uFocus)
|
||||
stateId = TIS_FOCUSED;
|
||||
|
||||
/* Adjust rectangle for bottommost row */
|
||||
if (TAB_GetItem(infoPtr, iItem)->rect.top == infoPtr->uNumRows-1)
|
||||
r.bottom += 3;
|
||||
|
||||
DrawThemeBackground (theme, hdc, partIds[partIndex], stateId, &r, NULL);
|
||||
GetThemeBackgroundContentRect (theme, hdc, partIds[partIndex], stateId, &r, &r);
|
||||
}
|
||||
else if(lStyle & TCS_VERTICAL)
|
||||
{
|
||||
/* These are for adjusting the drawing of a Selected tab */
|
||||
/* The initial values are for the normal case of non-Selected */
|
||||
|
@ -2176,6 +2282,7 @@ static void TAB_DrawBorder (TAB_INFO *infoPtr, HDC hdc)
|
|||
{
|
||||
RECT rect;
|
||||
DWORD lStyle = GetWindowLongW(infoPtr->hwnd, GWL_STYLE);
|
||||
HTHEME theme = GetWindowTheme (infoPtr->hwnd);
|
||||
|
||||
GetClientRect (infoPtr->hwnd, &rect);
|
||||
|
||||
|
@ -2198,7 +2305,10 @@ static void TAB_DrawBorder (TAB_INFO *infoPtr, HDC hdc)
|
|||
TRACE("border=(%ld,%ld)-(%ld,%ld)\n",
|
||||
rect.left, rect.top, rect.right, rect.bottom);
|
||||
|
||||
DrawEdge(hdc, &rect, EDGE_RAISED, BF_SOFT|BF_RECT);
|
||||
if (theme)
|
||||
DrawThemeBackground (theme, hdc, TABP_PANE, 0, &rect, NULL);
|
||||
else
|
||||
DrawEdge(hdc, &rect, EDGE_RAISED, BF_SOFT|BF_RECT);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -2564,7 +2674,7 @@ TAB_SetItemSize (TAB_INFO *infoPtr, LPARAM lParam)
|
|||
/* UNDOCUMENTED: If requested Width or Height is 0 this means that program wants to use auto size. */
|
||||
if (lStyle & TCS_FIXEDWIDTH && (infoPtr->tabWidth != (INT)LOWORD(lParam)))
|
||||
{
|
||||
infoPtr->tabWidth = max((INT)LOWORD(lParam), infoPtr->tabMinWidth);
|
||||
infoPtr->tabWidth = (INT)LOWORD(lParam);
|
||||
bNeedPaint = TRUE;
|
||||
}
|
||||
|
||||
|
@ -2596,8 +2706,9 @@ static inline LRESULT TAB_SetMinTabWidth (TAB_INFO *infoPtr, INT cx)
|
|||
|
||||
if (infoPtr) {
|
||||
oldcx = infoPtr->tabMinWidth;
|
||||
infoPtr->tabMinWidth = (cx==-1)?DEFAULT_TAB_WIDTH:cx;
|
||||
infoPtr->tabMinWidth = cx;
|
||||
}
|
||||
TAB_SetItemBounds(infoPtr);
|
||||
|
||||
return oldcx;
|
||||
}
|
||||
|
@ -2936,6 +3047,8 @@ static LRESULT TAB_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
}
|
||||
|
||||
OpenThemeData (infoPtr->hwnd, themeClass);
|
||||
|
||||
/*
|
||||
* We need to get text information so we need a DC and we need to select
|
||||
* a font.
|
||||
|
@ -2955,8 +3068,10 @@ static LRESULT TAB_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
infoPtr->uVItemPadding;
|
||||
|
||||
/* Initialize the width of a tab. */
|
||||
infoPtr->tabWidth = DEFAULT_TAB_WIDTH;
|
||||
infoPtr->tabMinWidth = 0;
|
||||
if (dwStyle & TCS_FIXEDWIDTH)
|
||||
infoPtr->tabWidth = DEFAULT_TAB_WIDTH_FIXED;
|
||||
|
||||
infoPtr->tabMinWidth = -1;
|
||||
|
||||
TRACE("tabH=%d, tabW=%d\n", infoPtr->tabHeight, infoPtr->tabWidth);
|
||||
|
||||
|
@ -2993,10 +3108,21 @@ TAB_Destroy (TAB_INFO *infoPtr)
|
|||
if (infoPtr->iHotTracked >= 0)
|
||||
KillTimer(infoPtr->hwnd, TAB_HOTTRACK_TIMER);
|
||||
|
||||
CloseThemeData (GetWindowTheme (infoPtr->hwnd));
|
||||
|
||||
Free (infoPtr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* update theme after a WM_THEMECHANGED message */
|
||||
static LRESULT theme_changed (TAB_INFO* infoPtr)
|
||||
{
|
||||
HTHEME theme = GetWindowTheme (infoPtr->hwnd);
|
||||
CloseThemeData (theme);
|
||||
OpenThemeData (infoPtr->hwnd, themeClass);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static LRESULT TAB_NCCalcSize(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (!wParam)
|
||||
|
@ -3176,6 +3302,9 @@ TAB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
COMCTL32_RefreshSysColors();
|
||||
return 0;
|
||||
|
||||
case WM_THEMECHANGED:
|
||||
return theme_changed (infoPtr);
|
||||
|
||||
case WM_KILLFOCUS:
|
||||
case WM_SETFOCUS:
|
||||
TAB_FocusChanging(infoPtr);
|
||||
|
|
319
reactos/lib/comctl32/theme_combo.c
Normal file
319
reactos/lib/comctl32/theme_combo.c
Normal file
|
@ -0,0 +1,319 @@
|
|||
/*
|
||||
* Theming - Combo box control
|
||||
*
|
||||
* Copyright (c) 2005 by Frank Richter
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "uxtheme.h"
|
||||
#include "tmschema.h"
|
||||
#include "comctl32.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(themingcombo);
|
||||
|
||||
/* Subclass-private state flags */
|
||||
#define STATE_NOREDRAW 1
|
||||
#define STATE_HOT 2
|
||||
|
||||
/* some constants for metrics, same as in user32 */
|
||||
#define COMBO_XBORDERSIZE 2
|
||||
#define COMBO_YBORDERSIZE 2
|
||||
#define COMBO_EDITBUTTONSPACE 0
|
||||
#define EDIT_CONTROL_PADDING 1
|
||||
|
||||
/* paint text of combobox, needed for read-only drop downs. */
|
||||
static void paint_text (HWND hwnd, HDC hdc, DWORD dwStyle, COMBOBOXINFO* cbi)
|
||||
{
|
||||
INT id, size = 0;
|
||||
LPWSTR pText = NULL;
|
||||
UINT itemState = ODS_COMBOBOXEDIT;
|
||||
HFONT font = (HFONT)SendMessageW (hwnd, WM_GETFONT, 0, 0);
|
||||
HFONT hPrevFont = (font) ? SelectObject(hdc, font) : 0;
|
||||
RECT rectEdit;
|
||||
BOOL focused = GetFocus () == hwnd;
|
||||
BOOL dropped = cbi->stateButton == STATE_SYSTEM_PRESSED;
|
||||
|
||||
TRACE("\n");
|
||||
|
||||
/* follow Windows combobox that sends a bunch of text
|
||||
* inquiries to its listbox while processing WM_PAINT. */
|
||||
|
||||
if( (id = SendMessageW (cbi->hwndList, LB_GETCURSEL, 0, 0) ) != LB_ERR )
|
||||
{
|
||||
size = SendMessageW (cbi->hwndList, LB_GETTEXTLEN, id, 0);
|
||||
if (size == LB_ERR)
|
||||
FIXME("LB_ERR probably not handled yet\n");
|
||||
if( (pText = HeapAlloc( GetProcessHeap(), 0, (size + 1) * sizeof(WCHAR))) )
|
||||
{
|
||||
/* size from LB_GETTEXTLEN may be too large, from LB_GETTEXT is accurate */
|
||||
size=SendMessageW (cbi->hwndList, LB_GETTEXT, (WPARAM)id, (LPARAM)pText);
|
||||
pText[size] = '\0'; /* just in case */
|
||||
} else return;
|
||||
}
|
||||
else
|
||||
if( !(dwStyle & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)) )
|
||||
return;
|
||||
|
||||
/*
|
||||
* Give ourselves some space.
|
||||
*/
|
||||
CopyRect (&rectEdit, &cbi->rcItem);
|
||||
InflateRect( &rectEdit, -1, -1 );
|
||||
|
||||
if(dwStyle & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE))
|
||||
{
|
||||
DRAWITEMSTRUCT dis;
|
||||
HRGN clipRegion;
|
||||
UINT ctlid = (UINT)GetWindowLongPtrW( hwnd, GWLP_ID );
|
||||
|
||||
/* setup state for DRAWITEM message. Owner will highlight */
|
||||
if ( focused && !dropped )
|
||||
itemState |= ODS_SELECTED | ODS_FOCUS;
|
||||
|
||||
/*
|
||||
* Save the current clip region.
|
||||
* To retrieve the clip region, we need to create one "dummy"
|
||||
* clip region.
|
||||
*/
|
||||
clipRegion = CreateRectRgnIndirect(&rectEdit);
|
||||
|
||||
if (GetClipRgn(hdc, clipRegion)!=1)
|
||||
{
|
||||
DeleteObject(clipRegion);
|
||||
clipRegion=NULL;
|
||||
}
|
||||
|
||||
if (!IsWindowEnabled(hwnd) & WS_DISABLED) itemState |= ODS_DISABLED;
|
||||
|
||||
dis.CtlType = ODT_COMBOBOX;
|
||||
dis.CtlID = ctlid;
|
||||
dis.hwndItem = hwnd;
|
||||
dis.itemAction = ODA_DRAWENTIRE;
|
||||
dis.itemID = id;
|
||||
dis.itemState = itemState;
|
||||
dis.hDC = hdc;
|
||||
dis.rcItem = rectEdit;
|
||||
dis.itemData = SendMessageW(cbi->hwndList, LB_GETITEMDATA,
|
||||
(WPARAM)id, 0 );
|
||||
|
||||
/*
|
||||
* Clip the DC and have the parent draw the item.
|
||||
*/
|
||||
IntersectClipRect(hdc,
|
||||
rectEdit.left, rectEdit.top,
|
||||
rectEdit.right, rectEdit.bottom);
|
||||
|
||||
SendMessageW(GetParent (hwnd), WM_DRAWITEM, ctlid, (LPARAM)&dis );
|
||||
|
||||
/*
|
||||
* Reset the clipping region.
|
||||
*/
|
||||
SelectClipRgn(hdc, clipRegion);
|
||||
}
|
||||
else
|
||||
{
|
||||
static const WCHAR empty_stringW[] = { 0 };
|
||||
|
||||
if ( focused && !dropped ) {
|
||||
|
||||
/* highlight */
|
||||
FillRect( hdc, &rectEdit, GetSysColorBrush(COLOR_HIGHLIGHT) );
|
||||
SetBkColor( hdc, GetSysColor( COLOR_HIGHLIGHT ) );
|
||||
SetTextColor( hdc, GetSysColor( COLOR_HIGHLIGHTTEXT ) );
|
||||
}
|
||||
|
||||
ExtTextOutW( hdc,
|
||||
rectEdit.left + 1,
|
||||
rectEdit.top + 1,
|
||||
ETO_OPAQUE | ETO_CLIPPED,
|
||||
&rectEdit,
|
||||
pText ? pText : empty_stringW , size, NULL );
|
||||
|
||||
if ( focused && !dropped )
|
||||
DrawFocusRect( hdc, &rectEdit );
|
||||
}
|
||||
|
||||
if( hPrevFont )
|
||||
SelectObject(hdc, hPrevFont );
|
||||
|
||||
HeapFree( GetProcessHeap(), 0, pText );
|
||||
}
|
||||
|
||||
/* paint the combobox */
|
||||
static LRESULT paint (HTHEME theme, HWND hwnd, HDC hParamDC, ULONG state)
|
||||
{
|
||||
PAINTSTRUCT ps;
|
||||
HDC hDC;
|
||||
COMBOBOXINFO cbi;
|
||||
DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE);
|
||||
|
||||
hDC = (hParamDC) ? hParamDC
|
||||
: BeginPaint( hwnd, &ps);
|
||||
|
||||
TRACE("hdc=%p\n", hDC);
|
||||
|
||||
if( hDC && !(state & STATE_NOREDRAW) )
|
||||
{
|
||||
RECT frameRect;
|
||||
int buttonState;
|
||||
|
||||
cbi.cbSize = sizeof (cbi);
|
||||
SendMessageW (hwnd, CB_GETCOMBOBOXINFO, 0, (LPARAM)&cbi);
|
||||
|
||||
/* paint border */
|
||||
if ((dwStyle & CBS_DROPDOWNLIST) != CBS_SIMPLE)
|
||||
GetClientRect (hwnd, &frameRect);
|
||||
else
|
||||
{
|
||||
CopyRect (&frameRect, &cbi.rcItem);
|
||||
|
||||
InflateRect(&frameRect,
|
||||
EDIT_CONTROL_PADDING + COMBO_XBORDERSIZE,
|
||||
EDIT_CONTROL_PADDING + COMBO_YBORDERSIZE);
|
||||
}
|
||||
|
||||
DrawThemeBackground (theme, hDC, 0,
|
||||
IsWindowEnabled (hwnd) ? CBXS_NORMAL : CBXS_DISABLED, &frameRect, NULL);
|
||||
|
||||
/* paint button */
|
||||
if (cbi.stateButton != STATE_SYSTEM_INVISIBLE)
|
||||
{
|
||||
if (!IsWindowEnabled (hwnd))
|
||||
buttonState = CBXS_DISABLED;
|
||||
else if (cbi.stateButton == STATE_SYSTEM_PRESSED)
|
||||
buttonState = CBXS_PRESSED;
|
||||
else if (state & STATE_HOT)
|
||||
buttonState = CBXS_HOT;
|
||||
else
|
||||
buttonState = CBXS_NORMAL;
|
||||
DrawThemeBackground (theme, hDC, CP_DROPDOWNBUTTON, buttonState,
|
||||
&cbi.rcButton, NULL);
|
||||
}
|
||||
|
||||
/* paint text, if we need to */
|
||||
if ((dwStyle & CBS_DROPDOWNLIST) == CBS_DROPDOWNLIST)
|
||||
paint_text (hwnd, hDC, dwStyle, &cbi);
|
||||
}
|
||||
|
||||
if( !hParamDC )
|
||||
EndPaint(hwnd, &ps);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* The combo control subclass window proc.
|
||||
*/
|
||||
LRESULT CALLBACK THEMING_ComboSubclassProc (HWND hwnd, UINT msg,
|
||||
WPARAM wParam, LPARAM lParam,
|
||||
ULONG_PTR dwRefData)
|
||||
{
|
||||
const WCHAR* themeClass = WC_COMBOBOXW;
|
||||
HTHEME theme;
|
||||
LRESULT result;
|
||||
|
||||
switch (msg)
|
||||
{
|
||||
case WM_CREATE:
|
||||
result = THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
|
||||
OpenThemeData( hwnd, themeClass );
|
||||
return result;
|
||||
|
||||
case WM_DESTROY:
|
||||
theme = GetWindowTheme( hwnd );
|
||||
CloseThemeData ( theme );
|
||||
return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
|
||||
|
||||
case WM_THEMECHANGED:
|
||||
theme = GetWindowTheme( hwnd );
|
||||
CloseThemeData ( theme );
|
||||
OpenThemeData( hwnd, themeClass );
|
||||
break;
|
||||
|
||||
case WM_SYSCOLORCHANGE:
|
||||
theme = GetWindowTheme( hwnd );
|
||||
if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
|
||||
/* Do nothing. When themed, a WM_THEMECHANGED will be received, too,
|
||||
* which will do the repaint. */
|
||||
break;
|
||||
|
||||
case WM_PAINT:
|
||||
theme = GetWindowTheme( hwnd );
|
||||
if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
|
||||
return paint (theme, hwnd, (HDC)wParam, dwRefData);
|
||||
|
||||
case WM_SETREDRAW:
|
||||
/* Since there doesn't seem to be WM_GETREDRAW, do redraw tracking in
|
||||
* the subclass as well. */
|
||||
if( wParam )
|
||||
dwRefData &= ~STATE_NOREDRAW;
|
||||
else
|
||||
dwRefData |= STATE_NOREDRAW;
|
||||
THEMING_SetSubclassData (hwnd, dwRefData);
|
||||
return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
|
||||
|
||||
case WM_MOUSEMOVE:
|
||||
{
|
||||
/* Dropdown button hot-tracking */
|
||||
COMBOBOXINFO cbi;
|
||||
POINT pt = {LOWORD(lParam), HIWORD(lParam)};
|
||||
|
||||
cbi.cbSize = sizeof (cbi);
|
||||
SendMessageW (hwnd, CB_GETCOMBOBOXINFO, 0, (LPARAM)&cbi);
|
||||
|
||||
if (cbi.stateButton != STATE_SYSTEM_INVISIBLE)
|
||||
{
|
||||
if (PtInRect (&cbi.rcButton, pt))
|
||||
{
|
||||
if (!(dwRefData & STATE_HOT))
|
||||
{
|
||||
dwRefData |= STATE_HOT;
|
||||
THEMING_SetSubclassData (hwnd, dwRefData);
|
||||
RedrawWindow (hwnd, &cbi.rcButton, 0,
|
||||
RDW_INVALIDATE | RDW_UPDATENOW);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dwRefData & STATE_HOT)
|
||||
{
|
||||
dwRefData &= ~STATE_HOT;
|
||||
THEMING_SetSubclassData (hwnd, dwRefData);
|
||||
RedrawWindow (hwnd, &cbi.rcButton, 0,
|
||||
RDW_INVALIDATE | RDW_UPDATENOW);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
|
||||
|
||||
default:
|
||||
/* Call old proc */
|
||||
return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
}
|
142
reactos/lib/comctl32/theme_dialog.c
Normal file
142
reactos/lib/comctl32/theme_dialog.c
Normal file
|
@ -0,0 +1,142 @@
|
|||
/*
|
||||
* Theming - Dialogs
|
||||
*
|
||||
* Copyright (c) 2005 by Frank Richter
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "uxtheme.h"
|
||||
#include "tmschema.h"
|
||||
#include "comctl32.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(themingdialog);
|
||||
|
||||
/**********************************************************************
|
||||
* The dialog subclass window proc.
|
||||
*/
|
||||
LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg,
|
||||
WPARAM wParam, LPARAM lParam,
|
||||
ULONG_PTR dwRefData)
|
||||
{
|
||||
HTHEME theme = GetWindowTheme ( hWnd );
|
||||
static const WCHAR themeClass[] = { 'W','i','n','d','o','w',0 };
|
||||
BOOL themingActive = IsThemeDialogTextureEnabled (hWnd);
|
||||
BOOL doTheming = themingActive && (theme != NULL);
|
||||
LRESULT result;
|
||||
|
||||
switch (msg)
|
||||
{
|
||||
case WM_CREATE:
|
||||
result = THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
|
||||
theme = OpenThemeData( hWnd, themeClass );
|
||||
return result;
|
||||
|
||||
case WM_DESTROY:
|
||||
CloseThemeData ( theme );
|
||||
return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
|
||||
|
||||
case WM_THEMECHANGED:
|
||||
CloseThemeData ( theme );
|
||||
OpenThemeData( hWnd, themeClass );
|
||||
InvalidateRect( hWnd, NULL, TRUE );
|
||||
return 0;
|
||||
|
||||
case WM_SYSCOLORCHANGE:
|
||||
if (!doTheming) return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
|
||||
/* Do nothing. When themed, a WM_THEMECHANGED will be received, too,
|
||||
* which will do the repaint. */
|
||||
break;
|
||||
|
||||
case WM_ERASEBKGND:
|
||||
if (!doTheming) return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
|
||||
{
|
||||
RECT rc;
|
||||
DLGPROC dlgp = (DLGPROC)GetWindowLongPtrW (hWnd, DWLP_DLGPROC);
|
||||
if (!dlgp (hWnd, msg, wParam, lParam))
|
||||
{
|
||||
/* Draw background*/
|
||||
GetClientRect (hWnd, &rc);
|
||||
if (IsThemePartDefined (theme, WP_DIALOG, 0))
|
||||
/* Although there is a theme for the WINDOW class/DIALOG part,
|
||||
* but I[res] haven't seen Windows using it yet... Even when
|
||||
* dialog theming is activated, the good ol' BTNFACE
|
||||
* background seems to be used. */
|
||||
#if 0
|
||||
DrawThemeBackground (theme, (HDC)wParam, WP_DIALOG, 0, &rc,
|
||||
NULL);
|
||||
#endif
|
||||
return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
|
||||
else
|
||||
/* We might have gotten a TAB theme class, so check if we can
|
||||
* draw as a tab page. */
|
||||
if (IsThemePartDefined (theme, TABP_BODY, 0))
|
||||
DrawThemeBackground (theme, (HDC)wParam, TABP_BODY, 0, &rc,
|
||||
NULL);
|
||||
else
|
||||
return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
case WM_CTLCOLORSTATIC:
|
||||
if (!doTheming) return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
|
||||
{
|
||||
DLGPROC dlgp = (DLGPROC)GetWindowLongPtrW (hWnd, DWLP_DLGPROC);
|
||||
LRESULT result = (LRESULT)dlgp (hWnd, msg, wParam, lParam);
|
||||
if (!result)
|
||||
{
|
||||
/* Override defaults with more suitable values when themed */
|
||||
HDC controlDC = (HDC)wParam;
|
||||
HWND controlWnd = (HWND)lParam;
|
||||
WCHAR controlClass[32];
|
||||
RECT rc;
|
||||
|
||||
GetClassNameW (controlWnd, controlClass,
|
||||
sizeof(controlClass) / sizeof(controlClass[0]));
|
||||
if (lstrcmpiW (controlClass, WC_STATICW) == 0)
|
||||
{
|
||||
/* Static control - draw parent background and set text to
|
||||
* transparent, so it looks right on tab pages. */
|
||||
GetClientRect (controlWnd, &rc);
|
||||
DrawThemeParentBackground (controlWnd, controlDC, &rc);
|
||||
SetBkMode (controlDC, TRANSPARENT);
|
||||
|
||||
/* Return NULL brush since we painted the BG already */
|
||||
return (LRESULT)GetStockObject (NULL_BRUSH);
|
||||
}
|
||||
else
|
||||
return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
default:
|
||||
/* Call old proc */
|
||||
return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
}
|
134
reactos/lib/comctl32/theme_edit.c
Normal file
134
reactos/lib/comctl32/theme_edit.c
Normal file
|
@ -0,0 +1,134 @@
|
|||
/*
|
||||
* Theming - Edit control
|
||||
*
|
||||
* Copyright (c) 2005 by Frank Richter
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "uxtheme.h"
|
||||
#include "tmschema.h"
|
||||
#include "comctl32.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(themingedit);
|
||||
|
||||
/* Draw themed border */
|
||||
static void nc_paint (HTHEME theme, HWND hwnd, HRGN region)
|
||||
{
|
||||
HRGN cliprgn = region;
|
||||
DWORD exStyle = GetWindowLongW (hwnd, GWL_EXSTYLE);
|
||||
if (exStyle & WS_EX_CLIENTEDGE)
|
||||
{
|
||||
HDC dc;
|
||||
RECT r;
|
||||
int cxEdge = GetSystemMetrics (SM_CXEDGE),
|
||||
cyEdge = GetSystemMetrics (SM_CYEDGE);
|
||||
int part = EP_EDITTEXT;
|
||||
int state = ETS_NORMAL;
|
||||
DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE);
|
||||
|
||||
if (!IsWindowEnabled (hwnd))
|
||||
state = ETS_DISABLED;
|
||||
else if (dwStyle & ES_READONLY)
|
||||
state = ETS_READONLY;
|
||||
else if (GetFocus() == hwnd)
|
||||
state = ETS_FOCUSED;
|
||||
|
||||
GetWindowRect(hwnd, &r);
|
||||
|
||||
/* New clipping region passed to default proc to exclude border */
|
||||
cliprgn = CreateRectRgn (r.left + cxEdge, r.top + cyEdge,
|
||||
r.right - cxEdge, r.bottom - cyEdge);
|
||||
if (region != (HRGN)1)
|
||||
CombineRgn (cliprgn, cliprgn, region, RGN_AND);
|
||||
OffsetRect(&r, -r.left, -r.top);
|
||||
|
||||
dc = GetDCEx(hwnd, region, DCX_WINDOW|DCX_INTERSECTRGN);
|
||||
OffsetRect(&r, -r.left, -r.top);
|
||||
|
||||
if (IsThemeBackgroundPartiallyTransparent (theme, part, state))
|
||||
DrawThemeParentBackground(hwnd, dc, &r);
|
||||
DrawThemeBackground (theme, dc, part, state, &r, 0);
|
||||
ReleaseDC(hwnd, dc);
|
||||
}
|
||||
|
||||
/* Call default proc to get the scrollbars etc. also painted */
|
||||
DefWindowProcW (hwnd, WM_NCPAINT, (WPARAM)cliprgn, 0);
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* The edit control subclass window proc.
|
||||
*/
|
||||
LRESULT CALLBACK THEMING_EditSubclassProc (HWND hwnd, UINT msg,
|
||||
WPARAM wParam, LPARAM lParam,
|
||||
ULONG_PTR dwRefData)
|
||||
{
|
||||
const WCHAR* themeClass = WC_EDITW;
|
||||
HTHEME theme;
|
||||
LRESULT result;
|
||||
|
||||
switch (msg)
|
||||
{
|
||||
case WM_CREATE:
|
||||
result = THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
|
||||
OpenThemeData( hwnd, themeClass );
|
||||
return result;
|
||||
|
||||
case WM_DESTROY:
|
||||
theme = GetWindowTheme( hwnd );
|
||||
CloseThemeData ( theme );
|
||||
return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
|
||||
|
||||
case WM_THEMECHANGED:
|
||||
theme = GetWindowTheme( hwnd );
|
||||
CloseThemeData ( theme );
|
||||
OpenThemeData( hwnd, themeClass );
|
||||
break;
|
||||
|
||||
case WM_SYSCOLORCHANGE:
|
||||
theme = GetWindowTheme( hwnd );
|
||||
if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
|
||||
/* Do nothing. When themed, a WM_THEMECHANGED will be received, too,
|
||||
* which will do the repaint. */
|
||||
break;
|
||||
|
||||
case WM_NCPAINT:
|
||||
theme = GetWindowTheme( hwnd );
|
||||
if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
|
||||
nc_paint (theme, hwnd, (HRGN)wParam);
|
||||
break;
|
||||
|
||||
case WM_ENABLE:
|
||||
theme = GetWindowTheme( hwnd );
|
||||
if (theme) RedrawWindow (hwnd, NULL, NULL,
|
||||
RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW);
|
||||
return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
|
||||
|
||||
default:
|
||||
/* Call old proc */
|
||||
return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
}
|
118
reactos/lib/comctl32/theme_listbox.c
Normal file
118
reactos/lib/comctl32/theme_listbox.c
Normal file
|
@ -0,0 +1,118 @@
|
|||
/*
|
||||
* Theming - List box control
|
||||
*
|
||||
* Copyright (c) 2005 by Frank Richter
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "uxtheme.h"
|
||||
#include "tmschema.h"
|
||||
#include "comctl32.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(theminglistbox);
|
||||
|
||||
/* Draw themed border */
|
||||
static void nc_paint (HTHEME theme, HWND hwnd, HRGN region)
|
||||
{
|
||||
HRGN cliprgn = region;
|
||||
DWORD exStyle = GetWindowLongW (hwnd, GWL_EXSTYLE);
|
||||
if (exStyle & WS_EX_CLIENTEDGE)
|
||||
{
|
||||
HDC dc;
|
||||
RECT r;
|
||||
int cxEdge = GetSystemMetrics (SM_CXEDGE),
|
||||
cyEdge = GetSystemMetrics (SM_CYEDGE);
|
||||
|
||||
GetWindowRect(hwnd, &r);
|
||||
|
||||
/* New clipping region passed to default proc to exclude border */
|
||||
cliprgn = CreateRectRgn (r.left + cxEdge, r.top + cyEdge,
|
||||
r.right - cxEdge, r.bottom - cyEdge);
|
||||
if (region != (HRGN)1)
|
||||
CombineRgn (cliprgn, cliprgn, region, RGN_AND);
|
||||
OffsetRect(&r, -r.left, -r.top);
|
||||
|
||||
dc = GetDCEx(hwnd, region, DCX_WINDOW|DCX_INTERSECTRGN);
|
||||
OffsetRect(&r, -r.left, -r.top);
|
||||
|
||||
if (IsThemeBackgroundPartiallyTransparent (theme, 0, 0))
|
||||
DrawThemeParentBackground(hwnd, dc, &r);
|
||||
DrawThemeBackground (theme, dc, 0, 0, &r, 0);
|
||||
ReleaseDC(hwnd, dc);
|
||||
}
|
||||
|
||||
/* Call default proc to get the scrollbars etc. painted */
|
||||
DefWindowProcW (hwnd, WM_NCPAINT, (WPARAM)cliprgn, 0);
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* The list control subclass window proc.
|
||||
*/
|
||||
LRESULT CALLBACK THEMING_ListBoxSubclassProc (HWND hwnd, UINT msg,
|
||||
WPARAM wParam, LPARAM lParam,
|
||||
ULONG_PTR dwRefData)
|
||||
{
|
||||
const WCHAR* themeClass = WC_LISTBOXW;
|
||||
HTHEME theme;
|
||||
LRESULT result;
|
||||
|
||||
switch (msg)
|
||||
{
|
||||
case WM_CREATE:
|
||||
result = THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
|
||||
OpenThemeData( hwnd, themeClass );
|
||||
return result;
|
||||
|
||||
case WM_DESTROY:
|
||||
theme = GetWindowTheme( hwnd );
|
||||
CloseThemeData ( theme );
|
||||
return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
|
||||
|
||||
case WM_THEMECHANGED:
|
||||
theme = GetWindowTheme( hwnd );
|
||||
CloseThemeData ( theme );
|
||||
OpenThemeData( hwnd, themeClass );
|
||||
break;
|
||||
|
||||
case WM_SYSCOLORCHANGE:
|
||||
theme = GetWindowTheme( hwnd );
|
||||
if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
|
||||
/* Do nothing. When themed, a WM_THEMECHANGED will be received, too,
|
||||
* which will do the repaint. */
|
||||
break;
|
||||
|
||||
case WM_NCPAINT:
|
||||
theme = GetWindowTheme( hwnd );
|
||||
if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
|
||||
nc_paint (theme, hwnd, (HRGN)wParam);
|
||||
break;
|
||||
|
||||
default:
|
||||
/* Call old proc */
|
||||
return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
}
|
169
reactos/lib/comctl32/theming.c
Normal file
169
reactos/lib/comctl32/theming.c
Normal file
|
@ -0,0 +1,169 @@
|
|||
/*
|
||||
* Theming - Initialization
|
||||
*
|
||||
* Copyright (c) 2005 by Frank Richter
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "comctl32.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(theming);
|
||||
|
||||
typedef LRESULT (CALLBACK* THEMING_SUBCLASSPROC)(HWND, UINT, WPARAM, LPARAM,
|
||||
ULONG_PTR);
|
||||
|
||||
extern LRESULT CALLBACK THEMING_ComboSubclassProc (HWND, UINT, WPARAM, LPARAM,
|
||||
ULONG_PTR);
|
||||
extern LRESULT CALLBACK THEMING_DialogSubclassProc (HWND, UINT, WPARAM, LPARAM,
|
||||
ULONG_PTR);
|
||||
extern LRESULT CALLBACK THEMING_EditSubclassProc (HWND, UINT, WPARAM, LPARAM,
|
||||
ULONG_PTR);
|
||||
extern LRESULT CALLBACK THEMING_ListBoxSubclassProc (HWND, UINT, WPARAM, LPARAM,
|
||||
ULONG_PTR);
|
||||
|
||||
static const WCHAR dialogClass[] = {'#','3','2','7','7','0',0};
|
||||
static const WCHAR comboLboxClass[] = {'C','o','m','b','o','L','b','o','x',0};
|
||||
|
||||
static const struct ThemingSubclass
|
||||
{
|
||||
const WCHAR* className;
|
||||
THEMING_SUBCLASSPROC subclassProc;
|
||||
} subclasses[] = {
|
||||
/* Note: list must be sorted by class name */
|
||||
{dialogClass, THEMING_DialogSubclassProc},
|
||||
{WC_COMBOBOXW, THEMING_ComboSubclassProc},
|
||||
{comboLboxClass, THEMING_ListBoxSubclassProc},
|
||||
{WC_EDITW, THEMING_EditSubclassProc},
|
||||
{WC_LISTBOXW, THEMING_ListBoxSubclassProc}
|
||||
};
|
||||
|
||||
#define NUM_SUBCLASSES (sizeof(subclasses)/sizeof(subclasses[0]))
|
||||
|
||||
static WNDPROC originalProcs[NUM_SUBCLASSES];
|
||||
static ATOM atRefDataProp;
|
||||
static ATOM atSubclassProp;
|
||||
|
||||
/* Generate a number of subclass window procs.
|
||||
* With a single proc alone, we can't really reliably find out the superclass,
|
||||
* so have one for each subclass. The subclass number is also stored in a prop
|
||||
* since it's needed by THEMING_CallOriginalClass(). Then, the the subclass
|
||||
* proc and ref data are fetched and the proc called.
|
||||
*/
|
||||
#define MAKE_SUBCLASS_PROC(N) \
|
||||
static LRESULT CALLBACK subclass_proc ## N (HWND wnd, UINT msg, \
|
||||
WPARAM wParam, LPARAM lParam) \
|
||||
{ \
|
||||
LRESULT result; \
|
||||
ULONG_PTR refData; \
|
||||
SetPropW (wnd, MAKEINTATOMW (atSubclassProp), (HANDLE)N); \
|
||||
refData = (ULONG_PTR)GetPropW (wnd, MAKEINTATOMW (atRefDataProp)); \
|
||||
TRACE ("%d; (%p, %x, %x, %lx, %lx)\n", N, wnd, msg, wParam, lParam, \
|
||||
refData); \
|
||||
result = subclasses[N].subclassProc (wnd, msg, wParam, lParam, refData);\
|
||||
TRACE ("result = %lx\n", result); \
|
||||
return result; \
|
||||
}
|
||||
|
||||
MAKE_SUBCLASS_PROC(0)
|
||||
MAKE_SUBCLASS_PROC(1)
|
||||
MAKE_SUBCLASS_PROC(2)
|
||||
MAKE_SUBCLASS_PROC(3)
|
||||
MAKE_SUBCLASS_PROC(4)
|
||||
|
||||
const static WNDPROC subclassProcs[NUM_SUBCLASSES] = {
|
||||
subclass_proc0,
|
||||
subclass_proc1,
|
||||
subclass_proc2,
|
||||
subclass_proc3,
|
||||
subclass_proc4
|
||||
};
|
||||
|
||||
/***********************************************************************
|
||||
* THEMING_Initialize
|
||||
*
|
||||
* Register classes for standard controls that will shadow the system
|
||||
* classes.
|
||||
*/
|
||||
void THEMING_Initialize (void)
|
||||
{
|
||||
int i;
|
||||
static const WCHAR subclassPropName[] =
|
||||
{ 'C','C','3','2','T','h','e','m','i','n','g','S','u','b','C','l',0 };
|
||||
static const WCHAR refDataPropName[] =
|
||||
{ 'C','C','3','2','T','h','e','m','i','n','g','D','a','t','a',0 };
|
||||
|
||||
atSubclassProp = GlobalAddAtomW (subclassPropName);
|
||||
atRefDataProp = GlobalAddAtomW (refDataPropName);
|
||||
|
||||
for (i = 0; i < NUM_SUBCLASSES; i++)
|
||||
{
|
||||
WNDCLASSEXW class;
|
||||
|
||||
class.cbSize = sizeof(class);
|
||||
class.style |= CS_GLOBALCLASS;
|
||||
GetClassInfoExW (NULL, subclasses[i].className, &class);
|
||||
originalProcs[i] = class.lpfnWndProc;
|
||||
class.lpfnWndProc = subclassProcs[i];
|
||||
|
||||
if (!class.lpfnWndProc)
|
||||
{
|
||||
ERR("Missing proc for class %s\n",
|
||||
debugstr_w (subclasses[i].className));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!RegisterClassExW (&class))
|
||||
{
|
||||
ERR("Could not re-register class %s: %lx\n",
|
||||
debugstr_w (subclasses[i].className), GetLastError ());
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE("Re-registered class %s\n",
|
||||
debugstr_w (subclasses[i].className));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* THEMING_CallOriginalClass
|
||||
*
|
||||
* Determines the original window proc and calls it.
|
||||
*/
|
||||
LRESULT THEMING_CallOriginalClass (HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
INT_PTR subclass = (INT_PTR)GetPropW (wnd, MAKEINTATOMW (atSubclassProp));
|
||||
WNDPROC oldProc = originalProcs[subclass];
|
||||
return CallWindowProcW (oldProc, wnd, msg, wParam, lParam);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* THEMING_SetSubclassData
|
||||
*
|
||||
* Update the "refData" value of the subclassed window.
|
||||
*/
|
||||
void THEMING_SetSubclassData (HWND wnd, ULONG_PTR refData)
|
||||
{
|
||||
SetPropW (wnd, MAKEINTATOMW (atRefDataProp), (HANDLE)refData);
|
||||
}
|
|
@ -81,6 +81,8 @@
|
|||
#include "winnls.h"
|
||||
#include "commctrl.h"
|
||||
#include "comctl32.h"
|
||||
#include "uxtheme.h"
|
||||
#include "tmschema.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(toolbar);
|
||||
|
@ -96,7 +98,7 @@ typedef struct
|
|||
BYTE bHot;
|
||||
BYTE bDropDownPressed;
|
||||
DWORD dwData;
|
||||
INT iString;
|
||||
INT_PTR iString;
|
||||
INT nRow;
|
||||
RECT rect;
|
||||
INT cx; /* manually set size */
|
||||
|
@ -238,6 +240,8 @@ typedef enum
|
|||
#define GETHOTIMAGELIST(infoPtr, id) TOOLBAR_GetImageList(infoPtr->himlHot, infoPtr->cimlHot, id)
|
||||
#define GETDISIMAGELIST(infoPtr, id) TOOLBAR_GetImageList(infoPtr->himlDis, infoPtr->cimlDis, id)
|
||||
|
||||
static const WCHAR themeClass[] = { 'T','o','o','l','b','a','r',0 };
|
||||
|
||||
static BOOL TOOLBAR_GetButtonInfo(TOOLBAR_INFO *infoPtr, NMTOOLBARW *nmtb);
|
||||
static BOOL TOOLBAR_IsButtonRemovable(TOOLBAR_INFO *infoPtr, int iItem, PCUSTOMBUTTON btnInfo);
|
||||
static HIMAGELIST TOOLBAR_GetImageList(PIMLENTRY *pies, INT cies, INT id);
|
||||
|
@ -693,7 +697,8 @@ TOOLBAR_DrawImage(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, INT left, INT top
|
|||
draw_masked = TRUE;
|
||||
}
|
||||
}
|
||||
else if ((tbcd->nmcd.uItemState & CDIS_HOT) && (infoPtr->dwStyle & TBSTYLE_FLAT))
|
||||
else if ((tbcd->nmcd.uItemState & CDIS_HOT)
|
||||
&& ((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf)))
|
||||
{
|
||||
/* if hot, attempt to draw with hot image list, if fails,
|
||||
use default image list */
|
||||
|
@ -814,6 +819,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
|
|||
DWORD ntfret;
|
||||
INT offset;
|
||||
INT oldBkMode;
|
||||
HTHEME theme = GetWindowTheme (hwnd);
|
||||
|
||||
rc = btnPtr->rect;
|
||||
CopyRect (&rcArrow, &rc);
|
||||
|
@ -937,6 +943,13 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
|
|||
|
||||
/* separator */
|
||||
if (btnPtr->fsStyle & BTNS_SEP) {
|
||||
if (theme)
|
||||
{
|
||||
DrawThemeBackground (theme, hdc,
|
||||
(dwStyle & CCS_VERT) ? TP_SEPARATORVERT : TP_SEPARATOR, 0,
|
||||
&tbcd.nmcd.rc, NULL);
|
||||
}
|
||||
else
|
||||
/* with the FLAT style, iBitmap is the width and has already */
|
||||
/* been taken into consideration in calculating the width */
|
||||
/* so now we need to draw the vertical separator */
|
||||
|
@ -963,7 +976,8 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
|
|||
((tbcd.nmcd.uItemState & CDIS_CHECKED) || (tbcd.nmcd.uItemState & CDIS_INDETERMINATE)))
|
||||
TOOLBAR_DrawPattern (&rc, &tbcd);
|
||||
|
||||
if ((dwStyle & TBSTYLE_FLAT) && (tbcd.nmcd.uItemState & CDIS_HOT))
|
||||
if (((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf))
|
||||
&& (tbcd.nmcd.uItemState & CDIS_HOT))
|
||||
{
|
||||
if ( infoPtr->dwItemCDFlag & TBCDRF_HILITEHOTTRACK )
|
||||
{
|
||||
|
@ -977,10 +991,47 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
|
|||
}
|
||||
}
|
||||
|
||||
TOOLBAR_DrawFrame(infoPtr, &tbcd);
|
||||
if (theme)
|
||||
{
|
||||
int partId = drawSepDropDownArrow ? TP_SPLITBUTTON : TP_BUTTON;
|
||||
int stateId = TS_NORMAL;
|
||||
|
||||
if (tbcd.nmcd.uItemState & CDIS_DISABLED)
|
||||
stateId = TS_DISABLED;
|
||||
else if (tbcd.nmcd.uItemState & CDIS_SELECTED)
|
||||
stateId = TS_PRESSED;
|
||||
else if (tbcd.nmcd.uItemState & CDIS_CHECKED)
|
||||
stateId = (tbcd.nmcd.uItemState & CDIS_HOT) ? TS_HOTCHECKED : TS_HOT;
|
||||
else if ((tbcd.nmcd.uItemState & CDIS_HOT)
|
||||
|| (drawSepDropDownArrow && btnPtr->bDropDownPressed))
|
||||
stateId = TS_HOT;
|
||||
|
||||
DrawThemeBackground (theme, hdc, partId, stateId, &tbcd.nmcd.rc, NULL);
|
||||
}
|
||||
else
|
||||
TOOLBAR_DrawFrame(infoPtr, &tbcd);
|
||||
|
||||
if (drawSepDropDownArrow)
|
||||
TOOLBAR_DrawSepDDArrow(infoPtr, &tbcd, &rcArrow, btnPtr->bDropDownPressed);
|
||||
{
|
||||
if (theme)
|
||||
{
|
||||
int stateId = TS_NORMAL;
|
||||
|
||||
if (tbcd.nmcd.uItemState & CDIS_DISABLED)
|
||||
stateId = TS_DISABLED;
|
||||
else if (btnPtr->bDropDownPressed || (tbcd.nmcd.uItemState & CDIS_SELECTED))
|
||||
stateId = TS_PRESSED;
|
||||
else if (tbcd.nmcd.uItemState & CDIS_CHECKED)
|
||||
stateId = (tbcd.nmcd.uItemState & CDIS_HOT) ? TS_HOTCHECKED : TS_HOT;
|
||||
else if (tbcd.nmcd.uItemState & CDIS_HOT)
|
||||
stateId = TS_HOT;
|
||||
|
||||
DrawThemeBackground (theme, hdc, TP_DROPDOWNBUTTON, stateId, &rcArrow, NULL);
|
||||
DrawThemeBackground (theme, hdc, TP_SPLITBUTTONDROPDOWN, stateId, &rcArrow, NULL);
|
||||
}
|
||||
else
|
||||
TOOLBAR_DrawSepDDArrow(infoPtr, &tbcd, &rcArrow, btnPtr->bDropDownPressed);
|
||||
}
|
||||
|
||||
oldBkMode = SetBkMode (hdc, tbcd.nStringBkMode);
|
||||
if (!(infoPtr->dwExStyle & TBSTYLE_EX_MIXEDBUTTONS) || (btnPtr->fsStyle & BTNS_SHOWTEXT))
|
||||
|
@ -2152,8 +2203,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
return FALSE;
|
||||
|
||||
/* UNDOCUMENTED: dialog hwnd immediately follows NMHDR */
|
||||
/* FIXME: this hack won't work on 64-bit - we need to declare a structure for this */
|
||||
nmtb.iItem = (int)hwnd;
|
||||
memcpy(&nmtb.iItem, &hwnd, sizeof(hwnd));
|
||||
/* Send TBN_INITCUSTOMIZE notification */
|
||||
if (TOOLBAR_SendNotify ((NMHDR *) &nmtb, infoPtr, TBN_INITCUSTOMIZE) ==
|
||||
TBNRF_HIDEHELP)
|
||||
|
@ -2454,7 +2504,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
/* draw button */
|
||||
if (!(infoPtr->dwStyle & TBSTYLE_FLAT))
|
||||
DrawEdge (lpdis->hDC, &rcButton, EDGE_RAISED, BF_RECT|BF_MIDDLE|BF_SOFT);
|
||||
DrawEdge (lpdis->hDC, &rcButton, EDGE_RAISED, BF_RECT|BF_MIDDLE|BF_SOFT);
|
||||
|
||||
/* draw image and text */
|
||||
if ((btnInfo->btn.fsStyle & BTNS_SEP) == 0) {
|
||||
|
@ -3602,7 +3652,7 @@ TOOLBAR_GetHotItem (HWND hwnd)
|
|||
{
|
||||
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
|
||||
|
||||
if (!(infoPtr->dwStyle & TBSTYLE_FLAT))
|
||||
if (!((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf)))
|
||||
return -1;
|
||||
|
||||
if (infoPtr->nHotItem < 0)
|
||||
|
@ -4668,7 +4718,7 @@ TOOLBAR_SetBitmapSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
FIXME("wParam is %d. Perhaps image list index?\n", wParam);
|
||||
|
||||
if ((LOWORD(lParam) <= 0) || (HIWORD(lParam)<=0))
|
||||
return FALSE;
|
||||
lParam = MAKELPARAM(16, 15);
|
||||
|
||||
if (infoPtr->nNumButtons > 0)
|
||||
WARN("%d buttons, undoc increase to bitmap size : %d-%d -> %d-%d\n",
|
||||
|
@ -4724,7 +4774,7 @@ TOOLBAR_SetButtonInfoA (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
if (lptbbi->dwMask & TBIF_STYLE)
|
||||
btnPtr->fsStyle = lptbbi->fsStyle;
|
||||
|
||||
if ((lptbbi->dwMask & TBIF_TEXT) && ((INT)lptbbi->pszText != -1)) {
|
||||
if ((lptbbi->dwMask & TBIF_TEXT) && ((INT_PTR)lptbbi->pszText != -1)) {
|
||||
if ((HIWORD(btnPtr->iString) == 0) || (btnPtr->iString == -1))
|
||||
/* iString is index, zero it to make Str_SetPtr succeed */
|
||||
btnPtr->iString=0;
|
||||
|
@ -4778,7 +4828,7 @@ TOOLBAR_SetButtonInfoW (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
if (lptbbi->dwMask & TBIF_STYLE)
|
||||
btnPtr->fsStyle = lptbbi->fsStyle;
|
||||
|
||||
if ((lptbbi->dwMask & TBIF_TEXT) && ((INT)lptbbi->pszText != -1)) {
|
||||
if ((lptbbi->dwMask & TBIF_TEXT) && ((INT_PTR)lptbbi->pszText != -1)) {
|
||||
if ((HIWORD(btnPtr->iString) == 0) || (btnPtr->iString == -1))
|
||||
/* iString is index, zero it to make Str_SetPtr succeed */
|
||||
btnPtr->iString=0;
|
||||
|
@ -5037,7 +5087,7 @@ TOOLBAR_SetHotItem (HWND hwnd, WPARAM wParam)
|
|||
/* NOTE: an application can still remove the hot item even if anchor
|
||||
* highlighting is enabled */
|
||||
|
||||
if (infoPtr->dwStyle & TBSTYLE_FLAT)
|
||||
if ((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf))
|
||||
TOOLBAR_SetHotItemEx(infoPtr, wParam, HICF_OTHER);
|
||||
|
||||
if (nOldHotItem < 0)
|
||||
|
@ -5591,6 +5641,8 @@ TOOLBAR_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
TOOLBAR_SendNotify (&nmttc.hdr, infoPtr, NM_TOOLTIPSCREATED);
|
||||
}
|
||||
}
|
||||
|
||||
OpenThemeData (hwnd, themeClass);
|
||||
|
||||
TOOLBAR_CheckStyle (hwnd, dwStyle);
|
||||
|
||||
|
@ -5637,6 +5689,8 @@ TOOLBAR_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
/* delete default font */
|
||||
if (infoPtr->hFont)
|
||||
DeleteObject (infoPtr->hDefaultFont);
|
||||
|
||||
CloseThemeData (GetWindowTheme (hwnd));
|
||||
|
||||
/* free toolbar info data */
|
||||
Free (infoPtr);
|
||||
|
@ -5653,6 +5707,7 @@ TOOLBAR_EraseBackground (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
NMTBCUSTOMDRAW tbcd;
|
||||
INT ret = FALSE;
|
||||
DWORD ntfret;
|
||||
HTHEME theme = GetWindowTheme (hwnd);
|
||||
|
||||
/* the app has told us not to redraw the toolbar */
|
||||
if (!infoPtr->bDoRedraw)
|
||||
|
@ -5681,7 +5736,7 @@ TOOLBAR_EraseBackground (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
/* If the toolbar is "transparent" then pass the WM_ERASEBKGND up
|
||||
* to my parent for processing.
|
||||
*/
|
||||
if (infoPtr->dwStyle & TBSTYLE_TRANSPARENT) {
|
||||
if (theme || (infoPtr->dwStyle & TBSTYLE_TRANSPARENT)) {
|
||||
POINT pt, ptorig;
|
||||
HDC hdc = (HDC)wParam;
|
||||
HWND parent;
|
||||
|
@ -6168,7 +6223,7 @@ TOOLBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
INT nHit;
|
||||
TBUTTON_INFO *btnPtr;
|
||||
|
||||
if (infoPtr->dwStyle & TBSTYLE_FLAT) {
|
||||
if ((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf)) {
|
||||
/* fill in the TRACKMOUSEEVENT struct */
|
||||
trackinfo.cbSize = sizeof(TRACKMOUSEEVENT);
|
||||
trackinfo.dwFlags = TME_QUERY;
|
||||
|
@ -6197,7 +6252,8 @@ TOOLBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
nHit = TOOLBAR_InternalHitTest (hwnd, &pt);
|
||||
|
||||
if ((infoPtr->dwStyle & TBSTYLE_FLAT) && (!infoPtr->bAnchor || (nHit >= 0)))
|
||||
if (((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf))
|
||||
&& (!infoPtr->bAnchor || (nHit >= 0)))
|
||||
TOOLBAR_SetHotItemEx(infoPtr, nHit, HICF_MOUSE);
|
||||
|
||||
if (infoPtr->nOldHit != nHit)
|
||||
|
@ -6316,7 +6372,8 @@ TOOLBAR_NCCreate (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
* (Guy Albertelli 9/2001)
|
||||
*
|
||||
*/
|
||||
if ((cs->style & TBSTYLE_FLAT) && !(cs->style & TBSTYLE_TRANSPARENT))
|
||||
if (((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf))
|
||||
&& !(cs->style & TBSTYLE_TRANSPARENT))
|
||||
styleadd |= TBSTYLE_TRANSPARENT;
|
||||
if (!(cs->style & (CCS_TOP | CCS_NOMOVEY))) {
|
||||
styleadd |= CCS_TOP; /* default to top */
|
||||
|
@ -6702,6 +6759,15 @@ TOOLBAR_SysColorChange (HWND hwnd)
|
|||
}
|
||||
|
||||
|
||||
/* update theme after a WM_THEMECHANGED message */
|
||||
static LRESULT theme_changed (HWND hwnd)
|
||||
{
|
||||
HTHEME theme = GetWindowTheme (hwnd);
|
||||
CloseThemeData (theme);
|
||||
OpenThemeData (hwnd, themeClass);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT WINAPI
|
||||
ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
|
@ -7084,6 +7150,9 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
case WM_SYSCOLORCHANGE:
|
||||
return TOOLBAR_SysColorChange (hwnd);
|
||||
|
||||
case WM_THEMECHANGED:
|
||||
return theme_changed (hwnd);
|
||||
|
||||
/* case WM_WININICHANGE: */
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ typedef struct
|
|||
UINT uFlags;
|
||||
HWND hwnd;
|
||||
BOOL bNotifyUnicode;
|
||||
UINT uId;
|
||||
UINT_PTR uId;
|
||||
RECT rect;
|
||||
HINSTANCE hinst;
|
||||
LPWSTR lpszText;
|
||||
|
@ -323,8 +323,8 @@ static void TOOLTIPS_GetDispInfoA(HWND hwnd, TOOLTIPS_INFO *infoPtr, TTTOOL_INFO
|
|||
SendMessageW(toolPtr->hwnd, WM_NOTIFY,
|
||||
(WPARAM)toolPtr->uId, (LPARAM)&ttnmdi);
|
||||
|
||||
if (HIWORD((UINT)ttnmdi.lpszText) == 0) {
|
||||
LoadStringW(ttnmdi.hinst, (UINT)ttnmdi.lpszText,
|
||||
if (IS_INTRESOURCE(ttnmdi.lpszText)) {
|
||||
LoadStringW(ttnmdi.hinst, LOWORD(ttnmdi.lpszText),
|
||||
infoPtr->szTipText, INFOTIPSIZE);
|
||||
if (ttnmdi.uFlags & TTF_DI_SETITEM) {
|
||||
toolPtr->hinst = ttnmdi.hinst;
|
||||
|
@ -372,8 +372,8 @@ static void TOOLTIPS_GetDispInfoW(HWND hwnd, TOOLTIPS_INFO *infoPtr, TTTOOL_INFO
|
|||
SendMessageW(toolPtr->hwnd, WM_NOTIFY,
|
||||
(WPARAM)toolPtr->uId, (LPARAM)&ttnmdi);
|
||||
|
||||
if (HIWORD((UINT)ttnmdi.lpszText) == 0) {
|
||||
LoadStringW(ttnmdi.hinst, (UINT)ttnmdi.lpszText,
|
||||
if (IS_INTRESOURCE(ttnmdi.lpszText)) {
|
||||
LoadStringW(ttnmdi.hinst, LOWORD(ttnmdi.lpszText),
|
||||
infoPtr->szTipText, INFOTIPSIZE);
|
||||
if (ttnmdi.uFlags & TTF_DI_SETITEM) {
|
||||
toolPtr->hinst = ttnmdi.hinst;
|
||||
|
@ -406,11 +406,11 @@ TOOLTIPS_GetTipText (HWND hwnd, TOOLTIPS_INFO *infoPtr, INT nTool)
|
|||
{
|
||||
TTTOOL_INFO *toolPtr = &infoPtr->tools[nTool];
|
||||
|
||||
if (HIWORD((UINT)toolPtr->lpszText) == 0 && toolPtr->hinst) {
|
||||
if (IS_INTRESOURCE(toolPtr->lpszText) && toolPtr->hinst) {
|
||||
/* load a resource */
|
||||
TRACE("load res string %p %x\n",
|
||||
toolPtr->hinst, (int)toolPtr->lpszText);
|
||||
LoadStringW (toolPtr->hinst, (UINT)toolPtr->lpszText,
|
||||
toolPtr->hinst, LOWORD(toolPtr->lpszText));
|
||||
LoadStringW (toolPtr->hinst, LOWORD(toolPtr->lpszText),
|
||||
infoPtr->szTipText, INFOTIPSIZE);
|
||||
}
|
||||
else if (toolPtr->lpszText) {
|
||||
|
@ -1015,8 +1015,8 @@ TOOLTIPS_AddToolA (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
toolPtr->rect = lpToolInfo->rect;
|
||||
toolPtr->hinst = lpToolInfo->hinst;
|
||||
|
||||
if (HIWORD(lpToolInfo->lpszText) == 0) {
|
||||
TRACE("add string id %x!\n", (int)lpToolInfo->lpszText);
|
||||
if (IS_INTRESOURCE(lpToolInfo->lpszText)) {
|
||||
TRACE("add string id %x!\n", LOWORD(lpToolInfo->lpszText));
|
||||
toolPtr->lpszText = (LPWSTR)lpToolInfo->lpszText;
|
||||
}
|
||||
else if (lpToolInfo->lpszText) {
|
||||
|
@ -1106,8 +1106,8 @@ TOOLTIPS_AddToolW (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
toolPtr->rect = lpToolInfo->rect;
|
||||
toolPtr->hinst = lpToolInfo->hinst;
|
||||
|
||||
if (HIWORD(lpToolInfo->lpszText) == 0) {
|
||||
TRACE("add string id %x!\n", (int)lpToolInfo->lpszText);
|
||||
if (IS_INTRESOURCE(lpToolInfo->lpszText)) {
|
||||
TRACE("add string id %x\n", LOWORD(lpToolInfo->lpszText));
|
||||
toolPtr->lpszText = (LPWSTR)lpToolInfo->lpszText;
|
||||
}
|
||||
else if (lpToolInfo->lpszText) {
|
||||
|
@ -1173,7 +1173,7 @@ TOOLTIPS_DelToolCommon (HWND hwnd, TOOLTIPS_INFO *infoPtr, INT nTool)
|
|||
toolPtr = &infoPtr->tools[nTool];
|
||||
if (toolPtr->lpszText) {
|
||||
if ( (toolPtr->lpszText != LPSTR_TEXTCALLBACKW) &&
|
||||
(HIWORD((INT)toolPtr->lpszText) != 0) )
|
||||
!IS_INTRESOURCE(toolPtr->lpszText) )
|
||||
Free (toolPtr->lpszText);
|
||||
}
|
||||
|
||||
|
@ -2015,8 +2015,8 @@ TOOLTIPS_SetToolInfoA (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
toolPtr->rect = lpToolInfo->rect;
|
||||
toolPtr->hinst = lpToolInfo->hinst;
|
||||
|
||||
if (HIWORD(lpToolInfo->lpszText) == 0) {
|
||||
TRACE("set string id %x!\n", (INT)lpToolInfo->lpszText);
|
||||
if (IS_INTRESOURCE(lpToolInfo->lpszText)) {
|
||||
TRACE("set string id %x\n", LOWORD(lpToolInfo->lpszText));
|
||||
toolPtr->lpszText = (LPWSTR)lpToolInfo->lpszText;
|
||||
}
|
||||
else if (lpToolInfo->lpszText) {
|
||||
|
@ -2024,7 +2024,7 @@ TOOLTIPS_SetToolInfoA (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
toolPtr->lpszText = LPSTR_TEXTCALLBACKW;
|
||||
else {
|
||||
if ( (toolPtr->lpszText) &&
|
||||
(HIWORD((INT)toolPtr->lpszText) != 0) ) {
|
||||
!IS_INTRESOURCE(toolPtr->lpszText) ) {
|
||||
Free (toolPtr->lpszText);
|
||||
toolPtr->lpszText = NULL;
|
||||
}
|
||||
|
@ -2072,8 +2072,8 @@ TOOLTIPS_SetToolInfoW (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
toolPtr->rect = lpToolInfo->rect;
|
||||
toolPtr->hinst = lpToolInfo->hinst;
|
||||
|
||||
if (HIWORD(lpToolInfo->lpszText) == 0) {
|
||||
TRACE("set string id %x!\n", (INT)lpToolInfo->lpszText);
|
||||
if (IS_INTRESOURCE(lpToolInfo->lpszText)) {
|
||||
TRACE("set string id %x!\n", LOWORD(lpToolInfo->lpszText));
|
||||
toolPtr->lpszText = lpToolInfo->lpszText;
|
||||
}
|
||||
else {
|
||||
|
@ -2081,7 +2081,7 @@ TOOLTIPS_SetToolInfoW (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
toolPtr->lpszText = LPSTR_TEXTCALLBACKW;
|
||||
else {
|
||||
if ( (toolPtr->lpszText) &&
|
||||
(HIWORD((INT)toolPtr->lpszText) != 0) ) {
|
||||
!IS_INTRESOURCE(toolPtr->lpszText) ) {
|
||||
Free (toolPtr->lpszText);
|
||||
toolPtr->lpszText = NULL;
|
||||
}
|
||||
|
@ -2199,7 +2199,7 @@ TOOLTIPS_UpdateTipTextA (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
/* copy tool text */
|
||||
toolPtr->hinst = lpToolInfo->hinst;
|
||||
|
||||
if (HIWORD(lpToolInfo->lpszText) == 0){
|
||||
if (IS_INTRESOURCE(lpToolInfo->lpszText)){
|
||||
toolPtr->lpszText = (LPWSTR)lpToolInfo->lpszText;
|
||||
}
|
||||
else if (lpToolInfo->lpszText) {
|
||||
|
@ -2207,7 +2207,7 @@ TOOLTIPS_UpdateTipTextA (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
toolPtr->lpszText = LPSTR_TEXTCALLBACKW;
|
||||
else {
|
||||
if ( (toolPtr->lpszText) &&
|
||||
(HIWORD((INT)toolPtr->lpszText) != 0) ) {
|
||||
!IS_INTRESOURCE(toolPtr->lpszText) ) {
|
||||
Free (toolPtr->lpszText);
|
||||
toolPtr->lpszText = NULL;
|
||||
}
|
||||
|
@ -2256,7 +2256,7 @@ TOOLTIPS_UpdateTipTextW (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
/* copy tool text */
|
||||
toolPtr->hinst = lpToolInfo->hinst;
|
||||
|
||||
if (HIWORD(lpToolInfo->lpszText) == 0){
|
||||
if (IS_INTRESOURCE(lpToolInfo->lpszText)){
|
||||
toolPtr->lpszText = lpToolInfo->lpszText;
|
||||
}
|
||||
else if (lpToolInfo->lpszText) {
|
||||
|
@ -2264,7 +2264,7 @@ TOOLTIPS_UpdateTipTextW (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
toolPtr->lpszText = LPSTR_TEXTCALLBACKW;
|
||||
else {
|
||||
if ( (toolPtr->lpszText) &&
|
||||
(HIWORD((INT)toolPtr->lpszText) != 0) ) {
|
||||
!IS_INTRESOURCE(toolPtr->lpszText) ) {
|
||||
Free (toolPtr->lpszText);
|
||||
toolPtr->lpszText = NULL;
|
||||
}
|
||||
|
@ -2337,7 +2337,7 @@ TOOLTIPS_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
toolPtr = &infoPtr->tools[i];
|
||||
if (toolPtr->lpszText) {
|
||||
if ( (toolPtr->lpszText != LPSTR_TEXTCALLBACKW) &&
|
||||
(HIWORD((INT)toolPtr->lpszText) != 0) )
|
||||
!IS_INTRESOURCE(toolPtr->lpszText) )
|
||||
{
|
||||
Free (toolPtr->lpszText);
|
||||
toolPtr->lpszText = NULL;
|
||||
|
|
|
@ -41,6 +41,8 @@
|
|||
#include "winuser.h"
|
||||
#include "winnls.h"
|
||||
#include "commctrl.h"
|
||||
#include "uxtheme.h"
|
||||
#include "tmschema.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
#include "comctl32.h"
|
||||
|
@ -90,6 +92,7 @@ typedef struct
|
|||
#define TB_AUTO_PAGE_LEFT 16
|
||||
#define TB_AUTO_PAGE_RIGHT 32
|
||||
#define TB_AUTO_PAGE (TB_AUTO_PAGE_LEFT | TB_AUTO_PAGE_RIGHT)
|
||||
#define TB_THUMB_HOT 64 /* mouse hovers above thumb */
|
||||
|
||||
/* helper defines for TRACKBAR_DrawTic */
|
||||
#define TIC_EDGE 0x20
|
||||
|
@ -97,6 +100,8 @@ typedef struct
|
|||
#define TIC_SELECTIONMARKMIN 0x100
|
||||
#define TIC_SELECTIONMARK (TIC_SELECTIONMARKMAX | TIC_SELECTIONMARKMIN)
|
||||
|
||||
static const WCHAR themeClass[] = { 'T','r','a','c','k','b','a','r',0 };
|
||||
|
||||
static inline int
|
||||
notify_customdraw(TRACKBAR_INFO *infoPtr, NMCUSTOMDRAW *pnmcd, int stage)
|
||||
{
|
||||
|
@ -466,12 +471,22 @@ static void
|
|||
TRACKBAR_DrawChannel (TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
|
||||
{
|
||||
RECT rcChannel = infoPtr->rcChannel;
|
||||
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
|
||||
|
||||
DrawEdge (hdc, &rcChannel, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
|
||||
if (dwStyle & TBS_ENABLESELRANGE) { /* fill the channel */
|
||||
FillRect (hdc, &rcChannel, GetStockObject(WHITE_BRUSH));
|
||||
if (TRACKBAR_HasSelection(infoPtr))
|
||||
FillRect (hdc, &infoPtr->rcSelection, GetSysColorBrush(COLOR_HIGHLIGHT));
|
||||
if (theme)
|
||||
{
|
||||
DrawThemeBackground (theme, hdc,
|
||||
(GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TBS_VERT) ?
|
||||
TKP_TRACKVERT : TKP_TRACK, TKS_NORMAL, &rcChannel, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawEdge (hdc, &rcChannel, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
|
||||
if (dwStyle & TBS_ENABLESELRANGE) { /* fill the channel */
|
||||
FillRect (hdc, &rcChannel, GetStockObject(WHITE_BRUSH));
|
||||
if (TRACKBAR_HasSelection(infoPtr))
|
||||
FillRect (hdc, &infoPtr->rcSelection, GetSysColorBrush(COLOR_HIGHLIGHT));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -567,8 +582,14 @@ TRACKBAR_DrawTics (TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
|
|||
int ticFlags = dwStyle & 0x0f;
|
||||
LOGPEN ticPen = { PS_SOLID, {1, 0}, GetSysColor (COLOR_3DDKSHADOW) };
|
||||
HPEN hOldPen, hTicPen;
|
||||
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
|
||||
|
||||
/* create the pen to draw the tics with */
|
||||
if (theme)
|
||||
{
|
||||
int part = (dwStyle & TBS_VERT) ? TKP_TICSVERT : TKP_TICS;
|
||||
GetThemeColor (theme, part, TSS_NORMAL, TMT_COLOR, &ticPen.lopnColor);
|
||||
}
|
||||
/* create the pen to draw the tics with */
|
||||
hTicPen = CreatePenIndirect(&ticPen);
|
||||
hOldPen = hTicPen ? SelectObject(hdc, hTicPen) : 0;
|
||||
|
||||
|
@ -604,6 +625,32 @@ TRACKBAR_DrawThumb(TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
|
|||
POINT points[6];
|
||||
int fillClr;
|
||||
int PointDepth;
|
||||
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
|
||||
|
||||
if (theme)
|
||||
{
|
||||
int partId;
|
||||
int stateId;
|
||||
if (dwStyle & TBS_BOTH)
|
||||
partId = (dwStyle & TBS_VERT) ? TKP_THUMBVERT : TKP_THUMB;
|
||||
else if (dwStyle & TBS_LEFT)
|
||||
partId = (dwStyle & TBS_VERT) ? TKP_THUMBLEFT : TKP_THUMBTOP;
|
||||
else
|
||||
partId = (dwStyle & TBS_VERT) ? TKP_THUMBRIGHT : TKP_THUMBBOTTOM;
|
||||
|
||||
if (dwStyle & WS_DISABLED)
|
||||
stateId = TUS_DISABLED;
|
||||
else if (infoPtr->flags & TB_DRAG_MODE)
|
||||
stateId = TUS_PRESSED;
|
||||
else if (infoPtr->flags & TB_THUMB_HOT)
|
||||
stateId = TUS_HOT;
|
||||
else
|
||||
stateId = TUS_NORMAL;
|
||||
|
||||
DrawThemeBackground (theme, hdc, partId, stateId, &thumb, 0);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
fillClr = infoPtr->flags & TB_DRAG_MODE ? COLOR_BTNHILIGHT : COLOR_BTNFACE;
|
||||
oldbr = SelectObject (hdc, GetSysColorBrush(fillClr));
|
||||
|
@ -822,7 +869,10 @@ TRACKBAR_Refresh (TRACKBAR_INFO *infoPtr, HDC hdcDst)
|
|||
/* Erase backbround */
|
||||
if (gcdrf == CDRF_DODEFAULT ||
|
||||
notify_customdraw(infoPtr, &nmcd, CDDS_PREERASE) != CDRF_SKIPDEFAULT) {
|
||||
FillRect (hdc, &rcClient, GetSysColorBrush(COLOR_BTNFACE));
|
||||
if (GetWindowTheme (infoPtr->hwndSelf))
|
||||
DrawThemeParentBackground (infoPtr->hwndSelf, hdc, &rcClient);
|
||||
else
|
||||
FillRect (hdc, &rcClient, GetSysColorBrush(COLOR_BTNFACE));
|
||||
if (gcdrf != CDRF_DODEFAULT)
|
||||
notify_customdraw(infoPtr, &nmcd, CDDS_POSTERASE);
|
||||
}
|
||||
|
@ -1380,6 +1430,8 @@ TRACKBAR_Create (HWND hwnd, LPCREATESTRUCTW lpcs)
|
|||
SendMessageW (infoPtr->hwndToolTip, TTM_ADDTOOLW, 0, (LPARAM)&ti);
|
||||
}
|
||||
}
|
||||
|
||||
OpenThemeData (hwnd, themeClass);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1394,6 +1446,7 @@ TRACKBAR_Destroy (TRACKBAR_INFO *infoPtr)
|
|||
|
||||
Free (infoPtr);
|
||||
SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0);
|
||||
CloseThemeData (GetWindowTheme (infoPtr->hwndSelf));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1519,6 +1572,16 @@ TRACKBAR_Timer (TRACKBAR_INFO *infoPtr, INT wTimerID, TIMERPROC *tmrpc)
|
|||
}
|
||||
|
||||
|
||||
/* update theme after a WM_THEMECHANGED message */
|
||||
static LRESULT theme_changed (TRACKBAR_INFO* infoPtr)
|
||||
{
|
||||
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
|
||||
CloseThemeData (theme);
|
||||
theme = OpenThemeData (infoPtr->hwndSelf, themeClass);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_MouseMove (TRACKBAR_INFO *infoPtr, DWORD fwKeys, INT x, INT y)
|
||||
{
|
||||
|
@ -1536,7 +1599,36 @@ TRACKBAR_MouseMove (TRACKBAR_INFO *infoPtr, DWORD fwKeys, INT x, INT y)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
if (!(infoPtr->flags & TB_DRAG_MODE)) return TRUE;
|
||||
if (!(infoPtr->flags & TB_DRAG_MODE))
|
||||
{
|
||||
if (GetWindowTheme (infoPtr->hwndSelf))
|
||||
{
|
||||
DWORD oldFlags = infoPtr->flags;
|
||||
POINT pt;
|
||||
pt.x = x;
|
||||
pt.y = y;
|
||||
if (PtInRect (&infoPtr->rcThumb, pt))
|
||||
{
|
||||
TRACKMOUSEEVENT tme;
|
||||
tme.cbSize = sizeof( tme );
|
||||
tme.dwFlags = TME_LEAVE;
|
||||
tme.hwndTrack = infoPtr->hwndSelf;
|
||||
TrackMouseEvent( &tme );
|
||||
infoPtr->flags |= TB_THUMB_HOT;
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACKMOUSEEVENT tme;
|
||||
tme.cbSize = sizeof( tme );
|
||||
tme.dwFlags = TME_CANCEL;
|
||||
tme.hwndTrack = infoPtr->hwndSelf;
|
||||
TrackMouseEvent( &tme );
|
||||
infoPtr->flags &= ~TB_THUMB_HOT;
|
||||
}
|
||||
if (oldFlags != infoPtr->flags) InvalidateRect (infoPtr->hwndSelf, &infoPtr->rcThumb, FALSE);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
dragPos = TRACKBAR_ConvertPlaceToPosition (infoPtr, clickPlace,
|
||||
dwStyle & TBS_VERT);
|
||||
|
@ -1778,6 +1870,11 @@ TRACKBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
case WM_LBUTTONUP:
|
||||
return TRACKBAR_LButtonUp (infoPtr, wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
|
||||
|
||||
case WM_MOUSELEAVE:
|
||||
infoPtr->flags &= ~TB_THUMB_HOT;
|
||||
InvalidateRect (infoPtr->hwndSelf, &infoPtr->rcThumb, FALSE);
|
||||
return 0;
|
||||
|
||||
case WM_MOUSEMOVE:
|
||||
return TRACKBAR_MouseMove (infoPtr, wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
|
||||
|
||||
|
@ -1790,6 +1887,9 @@ TRACKBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
case WM_SIZE:
|
||||
return TRACKBAR_Size (infoPtr, wParam, LOWORD(lParam), HIWORD(lParam));
|
||||
|
||||
case WM_THEMECHANGED:
|
||||
return theme_changed (infoPtr);
|
||||
|
||||
case WM_TIMER:
|
||||
return TRACKBAR_Timer (infoPtr, (INT)wParam, (TIMERPROC *)lParam);
|
||||
|
||||
|
|
|
@ -59,6 +59,8 @@
|
|||
#include "winnls.h"
|
||||
#include "commctrl.h"
|
||||
#include "comctl32.h"
|
||||
#include "uxtheme.h"
|
||||
#include "tmschema.h"
|
||||
#include "wine/unicode.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
|
@ -196,6 +198,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(treeview);
|
|||
#define ISVISIBLE(x) ((x)->visibleOrder >= 0)
|
||||
|
||||
|
||||
static const WCHAR themeClass[] = { 'T','r','e','e','v','i','e','w',0 };
|
||||
|
||||
|
||||
typedef VOID (*TREEVIEW_ItemEnumFunc)(TREEVIEW_INFO *, TREEVIEW_ITEM *,LPVOID);
|
||||
|
||||
|
||||
|
@ -654,12 +659,13 @@ TREEVIEW_SendCustomDrawItemNotify(TREEVIEW_INFO *infoPtr, HDC hdc,
|
|||
{
|
||||
HWND hwnd = infoPtr->hwnd;
|
||||
LPNMCUSTOMDRAW nmcd;
|
||||
DWORD dwDrawStage, dwItemSpec;
|
||||
DWORD dwDrawStage;
|
||||
DWORD_PTR dwItemSpec;
|
||||
UINT uItemState;
|
||||
INT retval;
|
||||
|
||||
dwDrawStage = CDDS_ITEM | uItemDrawState;
|
||||
dwItemSpec = (DWORD)wineItem;
|
||||
dwItemSpec = (DWORD_PTR)wineItem;
|
||||
uItemState = 0;
|
||||
if (wineItem->state & TVIS_SELECTED)
|
||||
uItemState |= CDIS_SELECTED;
|
||||
|
@ -1233,11 +1239,11 @@ TREEVIEW_InsertItemT(TREEVIEW_INFO *infoPtr, const TVINSERTSTRUCTW *ptdi, BOOL i
|
|||
insertAfter = ptdi->hInsertAfter;
|
||||
|
||||
/* Validate this now for convenience. */
|
||||
switch ((DWORD)insertAfter)
|
||||
switch ((DWORD_PTR)insertAfter)
|
||||
{
|
||||
case (DWORD)TVI_FIRST:
|
||||
case (DWORD)TVI_LAST:
|
||||
case (DWORD)TVI_SORT:
|
||||
case (DWORD_PTR)TVI_FIRST:
|
||||
case (DWORD_PTR)TVI_LAST:
|
||||
case (DWORD_PTR)TVI_SORT:
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -1269,9 +1275,9 @@ TREEVIEW_InsertItemT(TREEVIEW_INFO *infoPtr, const TVINSERTSTRUCTW *ptdi, BOOL i
|
|||
|
||||
infoPtr->uNumItems++;
|
||||
|
||||
switch ((DWORD)insertAfter)
|
||||
switch ((DWORD_PTR)insertAfter)
|
||||
{
|
||||
case (DWORD)TVI_FIRST:
|
||||
case (DWORD_PTR)TVI_FIRST:
|
||||
{
|
||||
TREEVIEW_ITEM *originalFirst = parentItem->firstChild;
|
||||
TREEVIEW_InsertBefore(newItem, parentItem->firstChild, parentItem);
|
||||
|
@ -1280,7 +1286,7 @@ TREEVIEW_InsertItemT(TREEVIEW_INFO *infoPtr, const TVINSERTSTRUCTW *ptdi, BOOL i
|
|||
}
|
||||
break;
|
||||
|
||||
case (DWORD)TVI_LAST:
|
||||
case (DWORD_PTR)TVI_LAST:
|
||||
TREEVIEW_InsertAfter(newItem, parentItem->lastChild, parentItem);
|
||||
break;
|
||||
|
||||
|
@ -1289,7 +1295,7 @@ TREEVIEW_InsertItemT(TREEVIEW_INFO *infoPtr, const TVINSERTSTRUCTW *ptdi, BOOL i
|
|||
TREEVIEW_InsertAfter(newItem, insertAfter, insertAfter->parent);
|
||||
break;
|
||||
|
||||
case (DWORD)TVI_SORT:
|
||||
case (DWORD_PTR)TVI_SORT:
|
||||
{
|
||||
TREEVIEW_ITEM *aChild;
|
||||
TREEVIEW_ITEM *previousChild = NULL;
|
||||
|
@ -2361,45 +2367,58 @@ TREEVIEW_DrawItemLines(TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *item)
|
|||
{
|
||||
if (item->cChildren)
|
||||
{
|
||||
LONG height = item->rect.bottom - item->rect.top;
|
||||
LONG width = item->stateOffset - item->linesOffset;
|
||||
LONG rectsize = min(height, width) / 4;
|
||||
/* plussize = ceil(rectsize * 3/4) */
|
||||
LONG plussize = (rectsize + 1) * 3 / 4;
|
||||
|
||||
HPEN hNewPen = CreatePen(PS_SOLID, 0, infoPtr->clrLine);
|
||||
HPEN hOldPen = SelectObject(hdc, hNewPen);
|
||||
|
||||
Rectangle(hdc, centerx - rectsize - 1, centery - rectsize - 1,
|
||||
centerx + rectsize + 2, centery + rectsize + 2);
|
||||
|
||||
SelectObject(hdc, hOldPen);
|
||||
DeleteObject(hNewPen);
|
||||
|
||||
if (height < 18 || width < 18)
|
||||
{
|
||||
MoveToEx(hdc, centerx - plussize + 1, centery, NULL);
|
||||
LineTo(hdc, centerx + plussize, centery);
|
||||
|
||||
if (!(item->state & TVIS_EXPANDED))
|
||||
{
|
||||
MoveToEx(hdc, centerx, centery - plussize + 1, NULL);
|
||||
LineTo(hdc, centerx, centery + plussize);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Rectangle(hdc, centerx - plussize + 1, centery - 1,
|
||||
centerx + plussize, centery + 2);
|
||||
|
||||
if (!(item->state & TVIS_EXPANDED))
|
||||
{
|
||||
Rectangle(hdc, centerx - 1, centery - plussize + 1,
|
||||
centerx + 2, centery + plussize);
|
||||
SetPixel(hdc, centerx - 1, centery, infoPtr->clrBk);
|
||||
SetPixel(hdc, centerx + 1, centery, infoPtr->clrBk);
|
||||
}
|
||||
}
|
||||
HTHEME theme = GetWindowTheme(infoPtr->hwnd);
|
||||
if (theme)
|
||||
{
|
||||
RECT glyphRect = item->rect;
|
||||
glyphRect.left = item->linesOffset;
|
||||
glyphRect.right = item->stateOffset;
|
||||
DrawThemeBackground (theme, hdc, TVP_GLYPH,
|
||||
(item->state & TVIS_EXPANDED) ? GLPS_OPENED : GLPS_CLOSED,
|
||||
&glyphRect, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
LONG height = item->rect.bottom - item->rect.top;
|
||||
LONG width = item->stateOffset - item->linesOffset;
|
||||
LONG rectsize = min(height, width) / 4;
|
||||
/* plussize = ceil(rectsize * 3/4) */
|
||||
LONG plussize = (rectsize + 1) * 3 / 4;
|
||||
|
||||
HPEN hNewPen = CreatePen(PS_SOLID, 0, infoPtr->clrLine);
|
||||
HPEN hOldPen = SelectObject(hdc, hNewPen);
|
||||
|
||||
Rectangle(hdc, centerx - rectsize - 1, centery - rectsize - 1,
|
||||
centerx + rectsize + 2, centery + rectsize + 2);
|
||||
|
||||
SelectObject(hdc, hOldPen);
|
||||
DeleteObject(hNewPen);
|
||||
|
||||
if (height < 18 || width < 18)
|
||||
{
|
||||
MoveToEx(hdc, centerx - plussize + 1, centery, NULL);
|
||||
LineTo(hdc, centerx + plussize, centery);
|
||||
|
||||
if (!(item->state & TVIS_EXPANDED))
|
||||
{
|
||||
MoveToEx(hdc, centerx, centery - plussize + 1, NULL);
|
||||
LineTo(hdc, centerx, centery + plussize);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Rectangle(hdc, centerx - plussize + 1, centery - 1,
|
||||
centerx + plussize, centery + 2);
|
||||
|
||||
if (!(item->state & TVIS_EXPANDED))
|
||||
{
|
||||
Rectangle(hdc, centerx - 1, centery - plussize + 1,
|
||||
centerx + 2, centery + plussize);
|
||||
SetPixel(hdc, centerx - 1, centery, infoPtr->clrBk);
|
||||
SetPixel(hdc, centerx + 1, centery, infoPtr->clrBk);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
SelectObject(hdc, hbrOld);
|
||||
|
@ -2573,9 +2592,9 @@ TREEVIEW_DrawItem(TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *wineItem)
|
|||
/* Draw insertion mark if necessary */
|
||||
|
||||
if (infoPtr->insertMarkItem)
|
||||
TRACE("item:%d,mark:%d\n",
|
||||
TRACE("item:%d,mark:%p\n",
|
||||
TREEVIEW_GetItemIndex(infoPtr, wineItem),
|
||||
(int)infoPtr->insertMarkItem);
|
||||
infoPtr->insertMarkItem);
|
||||
|
||||
if (wineItem == infoPtr->insertMarkItem)
|
||||
{
|
||||
|
@ -2954,7 +2973,7 @@ TREEVIEW_Sort(TREEVIEW_INFO *infoPtr, BOOL fRecurse, HTREEITEM parent,
|
|||
/* Check for a valid handle to the parent item */
|
||||
if (!TREEVIEW_ValidItem(infoPtr, parent))
|
||||
{
|
||||
ERR("invalid item hParent=%x\n", (INT)parent);
|
||||
ERR("invalid item hParent=%p\n", parent);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -3625,7 +3644,7 @@ TREEVIEW_EditLabel(TREEVIEW_INFO *infoPtr, HTREEITEM hItem)
|
|||
TEXTMETRICW textMetric;
|
||||
static const WCHAR EditW[] = {'E','d','i','t',0};
|
||||
|
||||
TRACE("%x %p\n", (unsigned)hwnd, hItem);
|
||||
TRACE("%p %p\n", hwnd, hItem);
|
||||
if (!TREEVIEW_ValidItem(infoPtr, editItem))
|
||||
return NULL;
|
||||
|
||||
|
@ -4952,6 +4971,8 @@ TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
|
|||
/* Make sure actual scrollbar state is consistent with uInternalStatus */
|
||||
ShowScrollBar(hwnd, SB_VERT, FALSE);
|
||||
ShowScrollBar(hwnd, SB_HORZ, FALSE);
|
||||
|
||||
OpenThemeData (hwnd, themeClass);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -4971,9 +4992,12 @@ TREEVIEW_Destroy(TREEVIEW_INFO *infoPtr)
|
|||
SetWindowLongPtrW(infoPtr->hwndEdit, GWLP_WNDPROC,
|
||||
(DWORD_PTR)infoPtr->wpEditOrig);
|
||||
|
||||
CloseThemeData (GetWindowTheme (infoPtr->hwnd));
|
||||
|
||||
/* Deassociate treeview from the window before doing anything drastic. */
|
||||
SetWindowLongPtrW(infoPtr->hwnd, 0, (DWORD_PTR)NULL);
|
||||
|
||||
|
||||
DeleteObject(infoPtr->hDefaultFont);
|
||||
DeleteObject(infoPtr->hBoldFont);
|
||||
DeleteObject(infoPtr->hUnderlineFont);
|
||||
|
@ -5201,6 +5225,40 @@ TREEVIEW_MouseMove (TREEVIEW_INFO * infoPtr, WPARAM wParam, LPARAM lParam)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* Draw themed border */
|
||||
static BOOL nc_paint (TREEVIEW_INFO *infoPtr, HRGN region)
|
||||
{
|
||||
HTHEME theme = GetWindowTheme (infoPtr->hwnd);
|
||||
HDC dc;
|
||||
RECT r;
|
||||
HRGN cliprgn;
|
||||
int cxEdge = GetSystemMetrics (SM_CXEDGE),
|
||||
cyEdge = GetSystemMetrics (SM_CYEDGE);
|
||||
|
||||
if (!theme) return FALSE;
|
||||
|
||||
GetWindowRect(infoPtr->hwnd, &r);
|
||||
|
||||
cliprgn = CreateRectRgn (r.left + cxEdge, r.top + cyEdge,
|
||||
r.right - cxEdge, r.bottom - cyEdge);
|
||||
if (region != (HRGN)1)
|
||||
CombineRgn (cliprgn, cliprgn, region, RGN_AND);
|
||||
OffsetRect(&r, -r.left, -r.top);
|
||||
|
||||
dc = GetDCEx(infoPtr->hwnd, region, DCX_WINDOW|DCX_INTERSECTRGN);
|
||||
OffsetRect(&r, -r.left, -r.top);
|
||||
|
||||
if (IsThemeBackgroundPartiallyTransparent (theme, 0, 0))
|
||||
DrawThemeParentBackground(infoPtr->hwnd, dc, &r);
|
||||
DrawThemeBackground (theme, dc, 0, 0, &r, 0);
|
||||
ReleaseDC(infoPtr->hwnd, dc);
|
||||
|
||||
/* Call default proc to get the scrollbars etc. painted */
|
||||
DefWindowProcW (infoPtr->hwnd, WM_NCPAINT, (WPARAM)cliprgn, 0);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static LRESULT
|
||||
TREEVIEW_Notify(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
|
@ -5346,6 +5404,15 @@ TREEVIEW_KillFocus(TREEVIEW_INFO *infoPtr)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* update theme after a WM_THEMECHANGED message */
|
||||
static LRESULT theme_changed (TREEVIEW_INFO* infoPtr)
|
||||
{
|
||||
HTHEME theme = GetWindowTheme (infoPtr->hwnd);
|
||||
CloseThemeData (theme);
|
||||
OpenThemeData (infoPtr->hwnd, themeClass);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT WINAPI
|
||||
TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
|
@ -5551,6 +5618,11 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
else
|
||||
return 0;
|
||||
|
||||
case WM_NCPAINT:
|
||||
if (nc_paint (infoPtr, (HRGN)wParam))
|
||||
return 0;
|
||||
goto def;
|
||||
|
||||
case WM_NOTIFY:
|
||||
return TREEVIEW_Notify(infoPtr, wParam, lParam);
|
||||
|
||||
|
@ -5590,6 +5662,9 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
case WM_TIMER:
|
||||
return TREEVIEW_HandleTimer(infoPtr, wParam);
|
||||
|
||||
case WM_THEMECHANGED:
|
||||
return theme_changed (infoPtr);
|
||||
|
||||
case WM_VSCROLL:
|
||||
return TREEVIEW_VScroll(infoPtr, wParam);
|
||||
|
||||
|
|
|
@ -1564,6 +1564,7 @@ extern "C" {
|
|||
#define CB_DIR 325
|
||||
#define CB_FINDSTRING 332
|
||||
#define CB_FINDSTRINGEXACT 344
|
||||
#define CB_GETCOMBOBOXINFO 356
|
||||
#define CB_GETCOUNT 326
|
||||
#define CB_GETCURSEL 327
|
||||
#define CB_GETDROPPEDCONTROLRECT 338
|
||||
|
|
Loading…
Reference in a new issue