Autosyncing with Wine HEAD

svn path=/trunk/; revision=30936
This commit is contained in:
The Wine Synchronizer 2007-12-01 18:28:50 +00:00
parent 98f79299bd
commit 5be02c6da0
51 changed files with 1102 additions and 2179 deletions

View file

@ -24,11 +24,11 @@
* *
* This code was audited for completeness against the documented features * This code was audited for completeness against the documented features
* of Comctl32.dll version 6.0 on Mar. 15, 2005, by Dimitrie O. Paun. * of Comctl32.dll version 6.0 on Mar. 15, 2005, by Dimitrie O. Paun.
* *
* Unless otherwise noted, we believe this code to be complete, as per * Unless otherwise noted, we believe this code to be complete, as per
* the specification mentioned above. * the specification mentioned above.
* If you discover missing features, or bugs, please note them below. * If you discover missing features, or bugs, please note them below.
* *
* TODO: * TODO:
* - check for the 'rec ' list in some AVI files * - check for the 'rec ' list in some AVI files
*/ */
@ -124,7 +124,7 @@ static BOOL ANIMATE_LoadResW(ANIMATE_INFO *infoPtr, HINSTANCE hInst, LPCWSTR lpN
mminfo.pchBuffer = (LPSTR)lpAvi; mminfo.pchBuffer = (LPSTR)lpAvi;
mminfo.cchBuffer = SizeofResource(hInst, hrsrc); mminfo.cchBuffer = SizeofResource(hInst, hrsrc);
infoPtr->hMMio = mmioOpenW(NULL, &mminfo, MMIO_READ); infoPtr->hMMio = mmioOpenW(NULL, &mminfo, MMIO_READ);
if (!infoPtr->hMMio) if (!infoPtr->hMMio)
{ {
FreeResource(infoPtr->hRes); FreeResource(infoPtr->hRes);
return FALSE; return FALSE;
@ -270,7 +270,7 @@ static BOOL ANIMATE_PaintFrame(ANIMATE_INFO* infoPtr, HDC hDC)
nWidth = infoPtr->outbih->biWidth; nWidth = infoPtr->outbih->biWidth;
nHeight = infoPtr->outbih->biHeight; nHeight = infoPtr->outbih->biHeight;
} }
else else
{ {
pBitmapData = infoPtr->indata; pBitmapData = infoPtr->indata;
@ -435,14 +435,14 @@ static LRESULT ANIMATE_Play(ANIMATE_INFO *infoPtr, UINT cRepeat, WORD wFrom, WOR
infoPtr->currFrame = infoPtr->nFromFrame; infoPtr->currFrame = infoPtr->nFromFrame;
if (infoPtr->dwStyle & ACS_TIMER) if (infoPtr->dwStyle & ACS_TIMER)
{ {
TRACE("Using a timer\n"); TRACE("Using a timer\n");
/* create a timer to display AVI */ /* create a timer to display AVI */
infoPtr->uTimer = SetTimer(infoPtr->hwndSelf, 1, infoPtr->uTimer = SetTimer(infoPtr->hwndSelf, 1,
infoPtr->mah.dwMicroSecPerFrame / 1000, NULL); infoPtr->mah.dwMicroSecPerFrame / 1000, NULL);
} }
else else
{ {
if(infoPtr->dwStyle & ACS_TRANSPARENT) if(infoPtr->dwStyle & ACS_TRANSPARENT)
infoPtr->hbrushBG = (HBRUSH)SendMessageW(infoPtr->hwndNotify, infoPtr->hbrushBG = (HBRUSH)SendMessageW(infoPtr->hwndNotify,
@ -602,7 +602,7 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr)
/* FIXME: should handle the 'rec ' LIST when present */ /* FIXME: should handle the 'rec ' LIST when present */
infoPtr->lpIndex = Alloc(infoPtr->mah.dwTotalFrames * sizeof(DWORD)); infoPtr->lpIndex = Alloc(infoPtr->mah.dwTotalFrames * sizeof(DWORD));
if (!infoPtr->lpIndex) if (!infoPtr->lpIndex)
return FALSE; return FALSE;
numFrame = insize = 0; numFrame = insize = 0;
@ -624,7 +624,7 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr)
} }
infoPtr->indata = Alloc(infoPtr->ash.dwSuggestedBufferSize); infoPtr->indata = Alloc(infoPtr->ash.dwSuggestedBufferSize);
if (!infoPtr->indata) if (!infoPtr->indata)
return FALSE; return FALSE;
return TRUE; return TRUE;
@ -659,14 +659,14 @@ static BOOL ANIMATE_GetAviCodec(ANIMATE_INFO *infoPtr)
return FALSE; return FALSE;
if (fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_GET_FORMAT, if (fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_GET_FORMAT,
(DWORD_PTR)infoPtr->inbih, (DWORD_PTR)infoPtr->outbih) != ICERR_OK) (DWORD_PTR)infoPtr->inbih, (DWORD_PTR)infoPtr->outbih) != ICERR_OK)
{ {
WARN("Can't get output BIH\n"); WARN("Can't get output BIH\n");
return FALSE; return FALSE;
} }
infoPtr->outdata = Alloc(infoPtr->outbih->biSizeImage); infoPtr->outdata = Alloc(infoPtr->outbih->biSizeImage);
if (!infoPtr->outdata) if (!infoPtr->outdata)
return FALSE; return FALSE;
if (fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_BEGIN, if (fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_BEGIN,
@ -683,7 +683,7 @@ static BOOL ANIMATE_OpenW(ANIMATE_INFO *infoPtr, HINSTANCE hInstance, LPWSTR lps
{ {
ANIMATE_Free(infoPtr); ANIMATE_Free(infoPtr);
if (!lpszName) if (!lpszName)
{ {
TRACE("Closing avi!\n"); TRACE("Closing avi!\n");
/* installer of thebat! v1.62 requires FALSE here */ /* installer of thebat! v1.62 requires FALSE here */
@ -697,17 +697,17 @@ static BOOL ANIMATE_OpenW(ANIMATE_INFO *infoPtr, HINSTANCE hInstance, LPWSTR lps
if (HIWORD(lpszName)) if (HIWORD(lpszName))
{ {
if (!ANIMATE_LoadResW(infoPtr, hInstance, lpszName)) if (!ANIMATE_LoadResW(infoPtr, hInstance, lpszName))
{ {
TRACE("No AVI resource found!\n"); TRACE("No AVI resource found!\n");
if (!ANIMATE_LoadFileW(infoPtr, lpszName)) if (!ANIMATE_LoadFileW(infoPtr, lpszName))
{ {
WARN("No AVI file found!\n"); WARN("No AVI file found!\n");
return FALSE; return FALSE;
} }
} }
} }
else else
{ {
if (!ANIMATE_LoadResW(infoPtr, hInstance, lpszName)) if (!ANIMATE_LoadResW(infoPtr, hInstance, lpszName))
{ {
@ -716,14 +716,14 @@ static BOOL ANIMATE_OpenW(ANIMATE_INFO *infoPtr, HINSTANCE hInstance, LPWSTR lps
} }
} }
if (!ANIMATE_GetAviInfo(infoPtr)) if (!ANIMATE_GetAviInfo(infoPtr))
{ {
WARN("Can't get AVI information\n"); WARN("Can't get AVI information\n");
ANIMATE_Free(infoPtr); ANIMATE_Free(infoPtr);
return FALSE; return FALSE;
} }
if (!ANIMATE_GetAviCodec(infoPtr)) if (!ANIMATE_GetAviCodec(infoPtr))
{ {
WARN("Can't get AVI Codec\n"); WARN("Can't get AVI Codec\n");
ANIMATE_Free(infoPtr); ANIMATE_Free(infoPtr);
@ -734,7 +734,7 @@ static BOOL ANIMATE_OpenW(ANIMATE_INFO *infoPtr, HINSTANCE hInstance, LPWSTR lps
SetWindowPos(infoPtr->hwndSelf, 0, 0, 0, infoPtr->mah.dwWidth, infoPtr->mah.dwHeight, SetWindowPos(infoPtr->hwndSelf, 0, 0, 0, infoPtr->mah.dwWidth, infoPtr->mah.dwHeight,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER); SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER);
if (infoPtr->dwStyle & ACS_AUTOPLAY) if (infoPtr->dwStyle & ACS_AUTOPLAY)
return ANIMATE_Play(infoPtr, -1, 0, infoPtr->mah.dwTotalFrames - 1); return ANIMATE_Play(infoPtr, -1, 0, infoPtr->mah.dwTotalFrames - 1);
return TRUE; return TRUE;
@ -849,7 +849,7 @@ static LRESULT ANIMATE_StyleChanged(ANIMATE_INFO *infoPtr, WPARAM wStyleType, co
wStyleType, lpss->styleOld, lpss->styleNew); wStyleType, lpss->styleOld, lpss->styleNew);
if (wStyleType != GWL_STYLE) return 0; if (wStyleType != GWL_STYLE) return 0;
infoPtr->dwStyle = lpss->styleNew; infoPtr->dwStyle = lpss->styleNew;
InvalidateRect(infoPtr->hwndSelf, NULL, TRUE); InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
@ -939,7 +939,7 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP
break; break;
case WM_SIZE: case WM_SIZE:
if (infoPtr->dwStyle & ACS_CENTER) if (infoPtr->dwStyle & ACS_CENTER)
InvalidateRect(infoPtr->hwndSelf, NULL, TRUE); InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
return DefWindowProcW(hWnd, uMsg, wParam, lParam); return DefWindowProcW(hWnd, uMsg, wParam, lParam);

View file

@ -20,14 +20,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
* *
* NOTE * NOTE
* *
* This code was audited for completeness against the documented features * This code was audited for completeness against the documented features
* of Comctl32.dll version 6.0 on Sep. 9, 2002, by Dimitrie O. Paun. * of Comctl32.dll version 6.0 on Sep. 9, 2002, by Dimitrie O. Paun.
* *
* Unless otherwise noted, we believe this code to be complete, as per * Unless otherwise noted, we believe this code to be complete, as per
* the specification mentioned above. * the specification mentioned above.
* If you discover missing features, or bugs, please note them below. * If you discover missing features, or bugs, please note them below.
* *
*/ */
#include <stdarg.h> #include <stdarg.h>
@ -731,7 +731,7 @@ COMBOEX_SetExtendedStyle (COMBOEX_INFO *infoPtr, DWORD mask, DWORD style)
/* see if we need to change the word break proc on the edit */ /* see if we need to change the word break proc on the edit */
if ((infoPtr->dwExtStyle ^ dwTemp) & CBES_EX_PATHWORDBREAKPROC) if ((infoPtr->dwExtStyle ^ dwTemp) & CBES_EX_PATHWORDBREAKPROC)
SetPathWordBreakProc(infoPtr->hwndEdit, SetPathWordBreakProc(infoPtr->hwndEdit,
(infoPtr->dwExtStyle & CBES_EX_PATHWORDBREAKPROC) ? TRUE : FALSE); (infoPtr->dwExtStyle & CBES_EX_PATHWORDBREAKPROC) ? TRUE : FALSE);
/* test if the control's appearance has changed */ /* test if the control's appearance has changed */
@ -1240,6 +1240,7 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam, LPARAM lPa
return SendMessageW (parent, WM_COMMAND, wParam, (LPARAM)infoPtr->hwndSelf); return SendMessageW (parent, WM_COMMAND, wParam, (LPARAM)infoPtr->hwndSelf);
case CBN_SELENDOK: case CBN_SELENDOK:
case CBN_SELENDCANCEL:
/* /*
* We have to change the handle since we are the control * We have to change the handle since we are the control
* issuing the message. IE4 depends on this. * issuing the message. IE4 depends on this.
@ -1577,6 +1578,27 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT const *di
} }
static void COMBOEX_ResetContent (COMBOEX_INFO *infoPtr)
{
if (infoPtr->items)
{
CBE_ITEMDATA *item, *next;
item = infoPtr->items;
while (item) {
next = item->next;
COMBOEX_FreeText (item);
Free (item);
item = next;
}
infoPtr->items = 0;
}
infoPtr->selected = -1;
infoPtr->nb_items = 0;
}
static LRESULT COMBOEX_Destroy (COMBOEX_INFO *infoPtr) static LRESULT COMBOEX_Destroy (COMBOEX_INFO *infoPtr)
{ {
if (infoPtr->hwndCombo) if (infoPtr->hwndCombo)
@ -1585,18 +1607,7 @@ static LRESULT COMBOEX_Destroy (COMBOEX_INFO *infoPtr)
Free (infoPtr->edit); Free (infoPtr->edit);
infoPtr->edit = 0; infoPtr->edit = 0;
if (infoPtr->items) { COMBOEX_ResetContent (infoPtr);
CBE_ITEMDATA *item, *next;
item = infoPtr->items;
while (item) {
next = item->next;
COMBOEX_FreeText (item);
Free (item);
item = next;
}
infoPtr->items = 0;
}
if (infoPtr->defaultFont) if (infoPtr->defaultFont)
DeleteObject (infoPtr->defaultFont); DeleteObject (infoPtr->defaultFont);
@ -2225,6 +2236,7 @@ COMBOEX_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_SETTEXT: case WM_SETTEXT:
case WM_GETTEXT: case WM_GETTEXT:
case WM_GETTEXTLENGTH:
return SendMessageW(infoPtr->hwndEdit, uMsg, wParam, lParam); return SendMessageW(infoPtr->hwndEdit, uMsg, wParam, lParam);
case CB_GETLBTEXT: case CB_GETLBTEXT:
@ -2233,12 +2245,15 @@ COMBOEX_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case CB_GETLBTEXTLEN: case CB_GETLBTEXTLEN:
return COMBOEX_GetListboxText(infoPtr, wParam, NULL); return COMBOEX_GetListboxText(infoPtr, wParam, NULL);
case CB_RESETCONTENT:
COMBOEX_ResetContent(infoPtr);
/* fall through */
/* Combo messages we are not sure if we need to process or just forward */ /* Combo messages we are not sure if we need to process or just forward */
case CB_GETDROPPEDCONTROLRECT: case CB_GETDROPPEDCONTROLRECT:
case CB_GETITEMHEIGHT: case CB_GETITEMHEIGHT:
case CB_GETEXTENDEDUI: case CB_GETEXTENDEDUI:
case CB_LIMITTEXT: case CB_LIMITTEXT:
case CB_RESETCONTENT:
case CB_SELECTSTRING: case CB_SELECTSTRING:
/* Combo messages OK to just forward to the regular COMBO */ /* Combo messages OK to just forward to the regular COMBO */

View file

@ -5,12 +5,9 @@
<importlibrary definition="comctl32.spec.def" /> <importlibrary definition="comctl32.spec.def" />
<include base="comctl32">.</include> <include base="comctl32">.</include>
<include base="ReactOS">include/reactos/wine</include> <include base="ReactOS">include/reactos/wine</include>
<define name="__REACTOS__" />
<define name="__WINESRC__" /> <define name="__WINESRC__" />
<define name="__USE_W32API" /> <define name="WINVER">0x600</define>
<define name="_WIN32_IE">0x600</define> <define name="_WIN32_WINNT">0x600</define>
<define name="_WIN32_WINNT">0x501</define>
<define name="WINVER">0x501</define>
<library>wine</library> <library>wine</library>
<library>user32</library> <library>user32</library>
<library>gdi32</library> <library>gdi32</library>

View file

@ -82,7 +82,7 @@ Index: propsheet.c
} }
/****************************************************************************** /******************************************************************************
@@ -3555,6 +3558,8 @@ @@ -3521,6 +3525,8 @@
* from which to switch to the next page */ * from which to switch to the next page */
SendMessageW(hwndTabCtrl, TCM_SETCURSEL, psInfo->active_page, 0); SendMessageW(hwndTabCtrl, TCM_SETCURSEL, psInfo->active_page, 0);
@ -95,7 +95,7 @@ Index: tooltips.c
=================================================================== ===================================================================
--- tooltips.c (revision 25790) --- tooltips.c (revision 25790)
+++ tooltips.c (working copy) +++ tooltips.c (working copy)
@@ -2471,7 +2471,34 @@ @@ -2440,7 +2440,34 @@
TOOLTIPS_NotifyFormat (HWND hwnd, WPARAM wParam, LPARAM lParam) TOOLTIPS_NotifyFormat (HWND hwnd, WPARAM wParam, LPARAM lParam)
{ {
FIXME ("hwnd=%p wParam=%lx lParam=%lx\n", hwnd, wParam, lParam); FIXME ("hwnd=%p wParam=%lx lParam=%lx\n", hwnd, wParam, lParam);
@ -170,7 +170,7 @@ Index: monthcal.c
=================================================================== ===================================================================
--- monthcal.c (revision 29360) --- monthcal.c (revision 29360)
+++ monthcal.c (working copy) +++ monthcal.c (working copy)
@@ -1703,11 +1703,12 @@ @@ -1719,11 +1719,12 @@
static LRESULT static LRESULT
@ -185,7 +185,7 @@ Index: monthcal.c
return 0; return 0;
} }
@@ -2015,7 +2016,7 @@ @@ -2031,7 +2032,7 @@
return DLGC_WANTARROWS | DLGC_WANTCHARS; return DLGC_WANTARROWS | DLGC_WANTCHARS;
case WM_KILLFOCUS: case WM_KILLFOCUS:

View file

@ -159,7 +159,7 @@ DWORD WINAPI GetSize (LPVOID lpMem)
* Items are re-ordered by changing the order of the values in the MRUList * Items are re-ordered by changing the order of the values in the MRUList
* value. When a new item is added, it becomes the new value of the oldest * value. When a new item is added, it becomes the new value of the oldest
* identifier, and that identifier is moved to the front of the MRUList value. * identifier, and that identifier is moved to the front of the MRUList value.
* *
* Wine stores MRU-lists in the same registry format as Windows, so when * Wine stores MRU-lists in the same registry format as Windows, so when
* switching between the builtin and native comctl32.dll no problems or * switching between the builtin and native comctl32.dll no problems or
* incompatibilities should occur. * incompatibilities should occur.

View file

@ -1,6 +1,6 @@
/* /*
* Copyright 2002 Won-kyu Park <wkpark@kldp.org> * Copyright 2002 Won-kyu Park <wkpark@kldp.org>
* Copyright 2005 YunSong Hwang * Copyright 2005,2007 YunSong Hwang
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -57,11 +57,11 @@ BEGIN
PUSHBUTTON "다시(&E)", IDC_RESET_BTN,308,23,44,14 PUSHBUTTON "다시(&E)", IDC_RESET_BTN,308,23,44,14
PUSHBUTTON "도움말(&H)", IDC_HELP_BTN,308,40,44,14 PUSHBUTTON "도움말(&H)", IDC_HELP_BTN,308,40,44,14
PUSHBUTTON "위로 이동(&U)", IDC_MOVEUP_BTN,308,74,44,14 PUSHBUTTON "위로 이동(&U)", IDC_MOVEUP_BTN,308,74,44,14
PUSHBUTTON "아래로 이동(&D)", IDC_MOVEDN_BTN,308,91,44,14 PUSHBUTTON "아래로이동(&D)", IDC_MOVEDN_BTN,308,91,49,14
LTEXT "가능한 버튼(&V)", -1,4,5,84,10 LTEXT "가능한 버튼(&V)", -1,4,5,84,10
LISTBOX IDC_AVAILBTN_LBOX,4,17,120,100, LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP LISTBOX IDC_AVAILBTN_LBOX,4,17,120,100, LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
PUSHBUTTON "더하기(&A) ->", IDOK, 131, 42, 44, 14 PUSHBUTTON "더하기(&A) ->", IDOK, 131, 42, 44, 14
PUSHBUTTON "<- 제거하기(&R)", IDC_REMOVE_BTN,131,62,44,14 PUSHBUTTON "<-지우기(&R)", IDC_REMOVE_BTN,131,62,44,14
LTEXT "도구바 버튼(&T):", -1,182,5,78,10 LTEXT "도구바 버튼(&T):", -1,182,5,78,10
LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
END END

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
* *
* NOTES * NOTES
* *
* This code was audited for completeness against the documented features * This code was audited for completeness against the documented features
* of Comctl32.dll version 6.0 on Oct. 21, 2002, by Christian Neumair. * of Comctl32.dll version 6.0 on Oct. 21, 2002, by Christian Neumair.
* *
@ -74,7 +74,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(commctrl);
#define NAME "microsoft.windows.common-controls" #define NAME "microsoft.windows.common-controls"
#define FILE "comctl32.dll" #define FILE "comctl32.dll"
#define VERSION "6.0.0.0" #define VERSION "6.0.2600.2982"
#define PUBLIC_KEY "6595b64144ccf1df" #define PUBLIC_KEY "6595b64144ccf1df"
#ifdef __i386__ #ifdef __i386__
@ -248,7 +248,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
break; break;
case DLL_PROCESS_DETACH: case DLL_PROCESS_DETACH:
/* clean up subclassing */ /* clean up subclassing */
THEMING_Uninitialize(); THEMING_Uninitialize();
/* unregister all common control classes */ /* unregister all common control classes */
@ -875,7 +875,7 @@ CreateMappedBitmap (HINSTANCE hInstance, INT_PTR idBitmap, UINT wFlags,
if (lpBitmap->biSize >= sizeof(BITMAPINFOHEADER) && lpBitmap->biClrUsed) if (lpBitmap->biSize >= sizeof(BITMAPINFOHEADER) && lpBitmap->biClrUsed)
nColorTableSize = lpBitmap->biClrUsed; nColorTableSize = lpBitmap->biClrUsed;
else if (lpBitmap->biBitCount <= 8) else if (lpBitmap->biBitCount <= 8)
nColorTableSize = (1 << lpBitmap->biBitCount); nColorTableSize = (1 << lpBitmap->biBitCount);
else else
nColorTableSize = 0; nColorTableSize = 0;
@ -1090,7 +1090,7 @@ VOID WINAPI InitMUILanguage (LANGID uiLang)
* *
* BUGS * BUGS
* If an application manually subclasses a window after subclassing it with * If an application manually subclasses a window after subclassing it with
* this API and then with this API again, then none of the previous * this API and then with this API again, then none of the previous
* subclasses get called or the origional window procedure. * subclasses get called or the origional window procedure.
*/ */
@ -1139,7 +1139,7 @@ BOOL WINAPI SetWindowSubclass (HWND hWnd, SUBCLASSPROC pfnSubclass,
proc = proc->next; proc = proc->next;
} }
} }
proc = Alloc(sizeof(SUBCLASSPROCS)); proc = Alloc(sizeof(SUBCLASSPROCS));
if (!proc) { if (!proc) {
ERR ("Failed to allocate subclass entry in stack\n"); ERR ("Failed to allocate subclass entry in stack\n");
@ -1151,7 +1151,7 @@ BOOL WINAPI SetWindowSubclass (HWND hWnd, SUBCLASSPROC pfnSubclass,
RemovePropW( hWnd, COMCTL32_wSubclass ); RemovePropW( hWnd, COMCTL32_wSubclass );
return FALSE; return FALSE;
} }
proc->subproc = pfnSubclass; proc->subproc = pfnSubclass;
proc->ref = dwRef; proc->ref = dwRef;
proc->id = uIDSubclass; proc->id = uIDSubclass;
@ -1238,15 +1238,15 @@ BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR u
while (proc) { while (proc) {
if ((proc->id == uID) && if ((proc->id == uID) &&
(proc->subproc == pfnSubclass)) { (proc->subproc == pfnSubclass)) {
if (!prevproc) if (!prevproc)
stack->SubclassProcs = proc->next; stack->SubclassProcs = proc->next;
else else
prevproc->next = proc->next; prevproc->next = proc->next;
if (stack->stackpos == proc) if (stack->stackpos == proc)
stack->stackpos = stack->stackpos->next; stack->stackpos = stack->stackpos->next;
Free (proc); Free (proc);
ret = TRUE; ret = TRUE;
break; break;
@ -1254,7 +1254,7 @@ BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR u
prevproc = proc; prevproc = proc;
proc = proc->next; proc = proc->next;
} }
if (!stack->SubclassProcs && !stack->running) { if (!stack->SubclassProcs && !stack->running) {
TRACE("Last Subclass removed, cleaning up\n"); TRACE("Last Subclass removed, cleaning up\n");
/* clean up our heap and reset the origional window procedure */ /* clean up our heap and reset the origional window procedure */
@ -1265,14 +1265,14 @@ BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR u
Free (stack); Free (stack);
RemovePropW( hWnd, COMCTL32_wSubclass ); RemovePropW( hWnd, COMCTL32_wSubclass );
} }
return ret; return ret;
} }
/*********************************************************************** /***********************************************************************
* COMCTL32_SubclassProc (internal) * COMCTL32_SubclassProc (internal)
* *
* Window procedure for all subclassed windows. * Window procedure for all subclassed windows.
* Saves the current subclassing stack position to support nested messages * Saves the current subclassing stack position to support nested messages
*/ */
LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
@ -1280,7 +1280,7 @@ LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
LPSUBCLASS_INFO stack; LPSUBCLASS_INFO stack;
LPSUBCLASSPROCS proc; LPSUBCLASSPROCS proc;
LRESULT ret; LRESULT ret;
TRACE ("(%p, 0x%08x, 0x%08lx, 0x%08lx)\n", hWnd, uMsg, wParam, lParam); TRACE ("(%p, 0x%08x, 0x%08lx, 0x%08lx)\n", hWnd, uMsg, wParam, lParam);
stack = (LPSUBCLASS_INFO)GetPropW (hWnd, COMCTL32_wSubclass); stack = (LPSUBCLASS_INFO)GetPropW (hWnd, COMCTL32_wSubclass);
@ -1288,7 +1288,7 @@ LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
ERR ("Our sub classing stack got erased for %p!! Nothing we can do\n", hWnd); ERR ("Our sub classing stack got erased for %p!! Nothing we can do\n", hWnd);
return 0; return 0;
} }
/* Save our old stackpos to properly handle nested messages */ /* Save our old stackpos to properly handle nested messages */
proc = stack->stackpos; proc = stack->stackpos;
stack->stackpos = stack->SubclassProcs; stack->stackpos = stack->SubclassProcs;
@ -1296,7 +1296,7 @@ LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
ret = DefSubclassProc(hWnd, uMsg, wParam, lParam); ret = DefSubclassProc(hWnd, uMsg, wParam, lParam);
stack->running--; stack->running--;
stack->stackpos = proc; stack->stackpos = proc;
if (!stack->SubclassProcs && !stack->running) { if (!stack->SubclassProcs && !stack->running) {
TRACE("Last Subclass removed, cleaning up\n"); TRACE("Last Subclass removed, cleaning up\n");
/* clean up our heap and reset the origional window procedure */ /* clean up our heap and reset the origional window procedure */
@ -1330,7 +1330,7 @@ LRESULT WINAPI DefSubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
{ {
LPSUBCLASS_INFO stack; LPSUBCLASS_INFO stack;
LRESULT ret; LRESULT ret;
TRACE ("(%p, 0x%08x, 0x%08lx, 0x%08lx)\n", hWnd, uMsg, wParam, lParam); TRACE ("(%p, 0x%08x, 0x%08lx, 0x%08lx)\n", hWnd, uMsg, wParam, lParam);
/* retrieve our little stack from the Properties */ /* retrieve our little stack from the Properties */
@ -1349,7 +1349,7 @@ LRESULT WINAPI DefSubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
ret = CallWindowProcA (stack->origproc, hWnd, uMsg, wParam, lParam); ret = CallWindowProcA (stack->origproc, hWnd, uMsg, wParam, lParam);
} else { } else {
const SUBCLASSPROCS *proc = stack->stackpos; const SUBCLASSPROCS *proc = stack->stackpos;
stack->stackpos = stack->stackpos->next; stack->stackpos = stack->stackpos->next;
/* call the Subclass procedure from the stack */ /* call the Subclass procedure from the stack */
ret = proc->subproc (hWnd, uMsg, wParam, lParam, ret = proc->subproc (hWnd, uMsg, wParam, lParam,
proc->id, proc->ref); proc->id, proc->ref);
@ -1461,8 +1461,8 @@ void COMCTL32_DrawInsertMark(HDC hDC, const RECT *lpRect, COLORREF clrInsertMark
HPEN hPen = CreatePen(PS_SOLID, 1, clrInsertMark); HPEN hPen = CreatePen(PS_SOLID, 1, clrInsertMark);
HPEN hOldPen; HPEN hOldPen;
static const DWORD adwPolyPoints[] = {4,4,4}; static const DWORD adwPolyPoints[] = {4,4,4};
LONG lCentre = (bHorizontal ? LONG lCentre = (bHorizontal ?
lpRect->top + (lpRect->bottom - lpRect->top)/2 : lpRect->top + (lpRect->bottom - lpRect->top)/2 :
lpRect->left + (lpRect->right - lpRect->left)/2); lpRect->left + (lpRect->right - lpRect->left)/2);
LONG l1 = (bHorizontal ? lpRect->left : lpRect->top); LONG l1 = (bHorizontal ? lpRect->left : lpRect->top);
LONG l2 = (bHorizontal ? lpRect->right : lpRect->bottom); LONG l2 = (bHorizontal ? lpRect->right : lpRect->bottom);
@ -1546,7 +1546,7 @@ void COMCTL32_EnsureBitmapSize(HBITMAP *pBitmap, int cxMinWidth, int cyMinHeight
SelectObject(hdcOld, hOldDCBitmap); SelectObject(hdcOld, hOldDCBitmap);
DeleteDC(hdcOld); DeleteDC(hdcOld);
DeleteObject(*pBitmap); DeleteObject(*pBitmap);
*pBitmap = hNewBitmap; *pBitmap = hNewBitmap;
return; return;
} }

View file

@ -20,14 +20,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
* *
* NOTE * NOTE
* *
* This code was audited for completeness against the documented features * This code was audited for completeness against the documented features
* of Comctl32.dll version 6.0 on Oct. 20, 2004, by Dimitrie O. Paun. * of Comctl32.dll version 6.0 on Oct. 20, 2004, by Dimitrie O. Paun.
* *
* Unless otherwise noted, we believe this code to be complete, as per * Unless otherwise noted, we believe this code to be complete, as per
* the specification mentioned above. * the specification mentioned above.
* If you discover missing features, or bugs, please note them below. * If you discover missing features, or bugs, please note them below.
* *
* TODO: * TODO:
* -- DTS_APPCANPARSE * -- DTS_APPCANPARSE
* -- DTS_SHORTDATECENTURYFORMAT * -- DTS_SHORTDATECENTURYFORMAT
@ -72,6 +72,7 @@ typedef struct
RECT checkbox; /* checkbox allowing the control to be enabled/disabled */ RECT checkbox; /* checkbox allowing the control to be enabled/disabled */
RECT calbutton; /* button that toggles the dropdown of the monthcal control */ RECT calbutton; /* button that toggles the dropdown of the monthcal control */
BOOL bCalDepressed; /* TRUE = cal button is depressed */ BOOL bCalDepressed; /* TRUE = cal button is depressed */
int bDropdownEnabled;
int select; int select;
HFONT hFont; HFONT hFont;
int nrFieldsAllocated; int nrFieldsAllocated;
@ -395,7 +396,7 @@ DATETIME_ReturnTxt (const DATETIME_INFO *infoPtr, int count, LPWSTR result, int
wsprintfW (result, fmt__2dW, date.wMonth); wsprintfW (result, fmt__2dW, date.wMonth);
break; break;
case THREECHARMONTH: case THREECHARMONTH:
GetLocaleInfoW(GetSystemDefaultLCID(), LOCALE_SMONTHNAME1+date.wMonth -1, GetLocaleInfoW(GetSystemDefaultLCID(), LOCALE_SMONTHNAME1+date.wMonth -1,
buffer, sizeof(buffer)/sizeof(buffer[0])); buffer, sizeof(buffer)/sizeof(buffer[0]));
wsprintfW (result, fmt__3sW, buffer); wsprintfW (result, fmt__3sW, buffer);
break; break;
@ -440,7 +441,7 @@ static const int DayOfWeekTable[] = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4};
static int DATETIME_CalculateDayOfWeek(DWORD day, DWORD month, DWORD year) static int DATETIME_CalculateDayOfWeek(DWORD day, DWORD month, DWORD year)
{ {
year-=(month < 3); year-=(month < 3);
return((year + year/4 - year/100 + year/400 + return((year + year/4 - year/100 + year/400 +
DayOfWeekTable[month-1] + day ) % 7); DayOfWeekTable[month-1] + day ) % 7);
} }
@ -611,7 +612,7 @@ DATETIME_ReturnFieldWidth (const DATETIME_INFO *infoPtr, HDC hdc, int count, SHO
*fieldWidthPtr = size.cx; *fieldWidthPtr = size.cx;
} }
static void static void
DATETIME_Refresh (DATETIME_INFO *infoPtr, HDC hdc) DATETIME_Refresh (DATETIME_INFO *infoPtr, HDC hdc)
{ {
int i,prevright; int i,prevright;
@ -720,7 +721,7 @@ DATETIME_LButtonDown (DATETIME_INFO *infoPtr, WORD wKey, INT x, INT y)
/* recalculate the position of the monthcal popup */ /* recalculate the position of the monthcal popup */
if(infoPtr->dwStyle & DTS_RIGHTALIGN) if(infoPtr->dwStyle & DTS_RIGHTALIGN)
infoPtr->monthcal_pos.x = infoPtr->calbutton.left - infoPtr->monthcal_pos.x = infoPtr->calbutton.left -
(rcMonthCal.right - rcMonthCal.left); (rcMonthCal.right - rcMonthCal.left);
else else
/* FIXME: this should be after the area reserved for the checkbox */ /* FIXME: this should be after the area reserved for the checkbox */
@ -736,10 +737,13 @@ DATETIME_LButtonDown (DATETIME_INFO *infoPtr, WORD wKey, INT x, INT y)
ShowWindow(infoPtr->hMonthCal, SW_HIDE); ShowWindow(infoPtr->hMonthCal, SW_HIDE);
} else { } else {
const SYSTEMTIME *lprgSysTimeArray = &infoPtr->date; const SYSTEMTIME *lprgSysTimeArray = &infoPtr->date;
TRACE("update calendar %04d/%02d/%02d\n", TRACE("update calendar %04d/%02d/%02d\n",
lprgSysTimeArray->wYear, lprgSysTimeArray->wMonth, lprgSysTimeArray->wDay); lprgSysTimeArray->wYear, lprgSysTimeArray->wMonth, lprgSysTimeArray->wDay);
SendMessageW(infoPtr->hMonthCal, MCM_SETCURSEL, 0, (LPARAM)(&infoPtr->date)); SendMessageW(infoPtr->hMonthCal, MCM_SETCURSEL, 0, (LPARAM)(&infoPtr->date));
ShowWindow(infoPtr->hMonthCal, SW_SHOW);
if (infoPtr->bDropdownEnabled)
ShowWindow(infoPtr->hMonthCal, SW_SHOW);
infoPtr->bDropdownEnabled = TRUE;
} }
TRACE ("dt:%p mc:%p mc parent:%p, desktop:%p\n", TRACE ("dt:%p mc:%p mc parent:%p, desktop:%p\n",
@ -776,6 +780,10 @@ DATETIME_Paint (DATETIME_INFO *infoPtr, HDC hdc)
} else { } else {
DATETIME_Refresh (infoPtr, hdc); DATETIME_Refresh (infoPtr, hdc);
} }
/* Not a click on the dropdown box, enabled it */
infoPtr->bDropdownEnabled = TRUE;
return 0; return 0;
} }
@ -790,9 +798,9 @@ DATETIME_Button_Command (DATETIME_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
} }
return 0; return 0;
} }
static LRESULT static LRESULT
DATETIME_Command (DATETIME_INFO *infoPtr, WPARAM wParam, LPARAM lParam) DATETIME_Command (DATETIME_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{ {
@ -855,7 +863,7 @@ DATETIME_Notify (DATETIME_INFO *infoPtr, int idCtrl, LPNMHDR lpnmh)
ShowWindow(infoPtr->hMonthCal, SW_HIDE); ShowWindow(infoPtr->hMonthCal, SW_HIDE);
infoPtr->dateValid = TRUE; infoPtr->dateValid = TRUE;
SendMessageW (infoPtr->hMonthCal, MCM_GETCURSEL, 0, (LPARAM)&infoPtr->date); SendMessageW (infoPtr->hMonthCal, MCM_GETCURSEL, 0, (LPARAM)&infoPtr->date);
TRACE("got from calendar %04d/%02d/%02d day of week %d\n", TRACE("got from calendar %04d/%02d/%02d day of week %d\n",
infoPtr->date.wYear, infoPtr->date.wMonth, infoPtr->date.wDay, infoPtr->date.wDayOfWeek); infoPtr->date.wYear, infoPtr->date.wMonth, infoPtr->date.wDay, infoPtr->date.wDayOfWeek);
SendMessageW (infoPtr->hwndCheckbut, BM_SETCHECK, BST_CHECKED, 0); SendMessageW (infoPtr->hwndCheckbut, BM_SETCHECK, BST_CHECKED, 0);
InvalidateRect(infoPtr->hwndSelf, NULL, TRUE); InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
@ -959,7 +967,7 @@ DATETIME_KeyDown (DATETIME_INFO *infoPtr, DWORD vkCode, LPARAM flags)
break; break;
} }
} }
switch (vkCode) { switch (vkCode) {
case VK_ADD: case VK_ADD:
case VK_UP: case VK_UP:
@ -1063,6 +1071,19 @@ DATETIME_SetFocus (DATETIME_INFO *infoPtr, HWND lostFocus)
{ {
TRACE("got focus from %p\n", lostFocus); TRACE("got focus from %p\n", lostFocus);
/* if monthcal is open and it loses focus, close monthcal */
if (infoPtr->hMonthCal && (lostFocus == infoPtr->hMonthCal) && \
IsWindowVisible(infoPtr->hMonthCal))
{
ShowWindow(infoPtr->hMonthCal, SW_HIDE);
DATETIME_SendSimpleNotify(infoPtr, DTN_CLOSEUP);
/* note: this get triggered even if monthcal loses focus to a dropdown
* box click, which occurs without an intermediate WM_PAINT call
*/
infoPtr->bDropdownEnabled = FALSE;
return 0;
}
if (infoPtr->haveFocus == 0) { if (infoPtr->haveFocus == 0) {
DATETIME_SendSimpleNotify (infoPtr, NM_SETFOCUS); DATETIME_SendSimpleNotify (infoPtr, NM_SETFOCUS);
infoPtr->haveFocus = DTHT_GOTFOCUS; infoPtr->haveFocus = DTHT_GOTFOCUS;
@ -1115,7 +1136,7 @@ DATETIME_Size (DATETIME_INFO *infoPtr, WORD flags, INT width, INT height)
TRACE("Height=%d, Width=%d\n", infoPtr->rcClient.bottom, infoPtr->rcClient.right); TRACE("Height=%d, Width=%d\n", infoPtr->rcClient.bottom, infoPtr->rcClient.right);
infoPtr->rcDraw = infoPtr->rcClient; infoPtr->rcDraw = infoPtr->rcClient;
if (infoPtr->dwStyle & DTS_UPDOWN) { if (infoPtr->dwStyle & DTS_UPDOWN) {
SetWindowPos(infoPtr->hUpdown, NULL, SetWindowPos(infoPtr->hUpdown, NULL,
infoPtr->rcClient.right-14, 0, infoPtr->rcClient.right-14, 0,
@ -1144,7 +1165,7 @@ DATETIME_Size (DATETIME_INFO *infoPtr, WORD flags, INT width, INT height)
} }
static LRESULT static LRESULT
DATETIME_StyleChanged(DATETIME_INFO *infoPtr, WPARAM wStyleType, const STYLESTRUCT *lpss) DATETIME_StyleChanged(DATETIME_INFO *infoPtr, WPARAM wStyleType, const STYLESTRUCT *lpss)
{ {
static const WCHAR buttonW[] = { 'b', 'u', 't', 't', 'o', 'n', 0 }; static const WCHAR buttonW[] = { 'b', 'u', 't', 't', 'o', 'n', 0 };
@ -1153,12 +1174,12 @@ DATETIME_StyleChanged(DATETIME_INFO *infoPtr, WPARAM wStyleType, const STYLESTRU
wStyleType, lpss->styleOld, lpss->styleNew); wStyleType, lpss->styleOld, lpss->styleNew);
if (wStyleType != GWL_STYLE) return 0; if (wStyleType != GWL_STYLE) return 0;
infoPtr->dwStyle = lpss->styleNew; infoPtr->dwStyle = lpss->styleNew;
if ( !(lpss->styleOld & DTS_SHOWNONE) && (lpss->styleNew & DTS_SHOWNONE) ) { if ( !(lpss->styleOld & DTS_SHOWNONE) && (lpss->styleNew & DTS_SHOWNONE) ) {
infoPtr->hwndCheckbut = CreateWindowExW (0, buttonW, 0, WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, infoPtr->hwndCheckbut = CreateWindowExW (0, buttonW, 0, WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
2, 2, 13, 13, infoPtr->hwndSelf, 0, 2, 2, 13, 13, infoPtr->hwndSelf, 0,
(HINSTANCE)GetWindowLongPtrW (infoPtr->hwndSelf, GWLP_HINSTANCE), 0); (HINSTANCE)GetWindowLongPtrW (infoPtr->hwndSelf, GWLP_HINSTANCE), 0);
SendMessageW (infoPtr->hwndCheckbut, BM_SETCHECK, 1, 0); SendMessageW (infoPtr->hwndCheckbut, BM_SETCHECK, 1, 0);
} }
@ -1167,7 +1188,7 @@ DATETIME_StyleChanged(DATETIME_INFO *infoPtr, WPARAM wStyleType, const STYLESTRU
infoPtr->hwndCheckbut = 0; infoPtr->hwndCheckbut = 0;
} }
if ( !(lpss->styleOld & DTS_UPDOWN) && (lpss->styleNew & DTS_UPDOWN) ) { if ( !(lpss->styleOld & DTS_UPDOWN) && (lpss->styleNew & DTS_UPDOWN) ) {
infoPtr->hUpdown = CreateUpDownControl (WS_CHILD | WS_BORDER | WS_VISIBLE, 120, 1, 20, 20, infoPtr->hUpdown = CreateUpDownControl (WS_CHILD | WS_BORDER | WS_VISIBLE, 120, 1, 20, 20,
infoPtr->hwndSelf, 1, 0, 0, UD_MAXVAL, UD_MINVAL, 0); infoPtr->hwndSelf, 1, 0, 0, UD_MAXVAL, UD_MINVAL, 0);
} }
if ( (lpss->styleOld & DTS_UPDOWN) && !(lpss->styleNew & DTS_UPDOWN) ) { if ( (lpss->styleOld & DTS_UPDOWN) && !(lpss->styleNew & DTS_UPDOWN) ) {
@ -1207,12 +1228,13 @@ DATETIME_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
infoPtr->buflen = (int *) Alloc (infoPtr->nrFieldsAllocated * sizeof(int)); infoPtr->buflen = (int *) Alloc (infoPtr->nrFieldsAllocated * sizeof(int));
infoPtr->hwndNotify = lpcs->hwndParent; infoPtr->hwndNotify = lpcs->hwndParent;
infoPtr->select = -1; /* initially, nothing is selected */ infoPtr->select = -1; /* initially, nothing is selected */
infoPtr->bDropdownEnabled = TRUE;
DATETIME_StyleChanged(infoPtr, GWL_STYLE, &ss); DATETIME_StyleChanged(infoPtr, GWL_STYLE, &ss);
DATETIME_SetFormatW (infoPtr, 0); DATETIME_SetFormatW (infoPtr, 0);
/* create the monthcal control */ /* create the monthcal control */
infoPtr->hMonthCal = CreateWindowExW (0, SysMonthCal32W, 0, WS_BORDER | WS_POPUP | WS_CLIPSIBLINGS, infoPtr->hMonthCal = CreateWindowExW (0, SysMonthCal32W, 0, WS_BORDER | WS_POPUP | WS_CLIPSIBLINGS,
0, 0, 0, 0, infoPtr->hwndSelf, 0, 0, 0); 0, 0, 0, 0, infoPtr->hwndSelf, 0, 0, 0);
/* initialize info structure */ /* initialize info structure */
@ -1234,7 +1256,7 @@ DATETIME_Destroy (DATETIME_INFO *infoPtr)
DestroyWindow(infoPtr->hwndCheckbut); DestroyWindow(infoPtr->hwndCheckbut);
if (infoPtr->hUpdown) if (infoPtr->hUpdown)
DestroyWindow(infoPtr->hUpdown); DestroyWindow(infoPtr->hUpdown);
if (infoPtr->hMonthCal) if (infoPtr->hMonthCal)
DestroyWindow(infoPtr->hMonthCal); DestroyWindow(infoPtr->hMonthCal);
SetWindowLongPtrW( infoPtr->hwndSelf, 0, 0 ); /* clear infoPtr */ SetWindowLongPtrW( infoPtr->hwndSelf, 0, 0 ); /* clear infoPtr */
Free (infoPtr); Free (infoPtr);

View file

@ -22,11 +22,11 @@
* NOTES * NOTES
* These functions were involuntarily documented by Microsoft in 2002 as * These functions were involuntarily documented by Microsoft in 2002 as
* the outcome of an anti-trust suit brought by various U.S. governments. * the outcome of an anti-trust suit brought by various U.S. governments.
* As a result the specifications on MSDN are inaccurate, incomplete * As a result the specifications on MSDN are inaccurate, incomplete
* and misleading. A much more complete (unofficial) documentation is * and misleading. A much more complete (unofficial) documentation is
* available at: * available at:
* *
* http://members.ozemail.com.au/~geoffch/samples/win32/shell/comctl32 * http://members.ozemail.com.au/~geoffch/samples/win32/shell/comctl32
*/ */
#define COBJMACROS #define COBJMACROS
@ -83,7 +83,7 @@ typedef HRESULT (CALLBACK *DPALOADPROC)(LPLOADDATA,IStream*,LPARAM);
* *
* RETURNS * RETURNS
* Success: TRUE * Success: TRUE
* Failure: FALSE * Failure: FALSE
* *
* NOTES * NOTES
* No more information available yet! * No more information available yet!
@ -181,7 +181,7 @@ HRESULT WINAPI DPA_LoadStream (HDPA *phDpa, DPALOADPROC loadProc,
* *
* RETURNS * RETURNS
* Success: TRUE * Success: TRUE
* Failure: FALSE * Failure: FALSE
* *
* NOTES * NOTES
* No more information available yet! * No more information available yet!
@ -212,7 +212,7 @@ HRESULT WINAPI DPA_SaveStream (const HDPA hDpa, DPALOADPROC loadProc,
* *
* RETURNS * RETURNS
* Success: TRUE * Success: TRUE
* Failure: FALSE * Failure: FALSE
* *
* NOTES * NOTES
* No more information available yet! * No more information available yet!
@ -545,11 +545,11 @@ INT WINAPI DPA_InsertPtr (const HDPA hdpa, INT i, LPVOID p)
/* create empty spot at the end */ /* create empty spot at the end */
if (!DPA_SetPtr(hdpa, hdpa->nItemCount, 0)) return -1; if (!DPA_SetPtr(hdpa, hdpa->nItemCount, 0)) return -1;
if (i != hdpa->nItemCount - 1) if (i != hdpa->nItemCount - 1)
memmove (hdpa->ptrs + i + 1, hdpa->ptrs + i, memmove (hdpa->ptrs + i + 1, hdpa->ptrs + i,
(hdpa->nItemCount - i - 1) * sizeof(LPVOID)); (hdpa->nItemCount - i - 1) * sizeof(LPVOID));
hdpa->ptrs[i] = p; hdpa->ptrs[i] = p;
return i; return i;
} }
@ -590,7 +590,7 @@ BOOL WINAPI DPA_SetPtr (const HDPA hdpa, INT i, LPVOID p)
lpTemp = HeapReAlloc (hdpa->hHeap, HEAP_ZERO_MEMORY, hdpa->ptrs, nSize); lpTemp = HeapReAlloc (hdpa->hHeap, HEAP_ZERO_MEMORY, hdpa->ptrs, nSize);
else else
lpTemp = HeapAlloc (hdpa->hHeap, HEAP_ZERO_MEMORY, nSize); lpTemp = HeapAlloc (hdpa->hHeap, HEAP_ZERO_MEMORY, nSize);
if (!lpTemp) if (!lpTemp)
return FALSE; return FALSE;

View file

@ -22,11 +22,11 @@
* *
* This code was audited for completeness against the documented features * This code was audited for completeness against the documented features
* of Comctl32.dll version 6.0 on Mar. 10, 2004, by Robert Shearman. * of Comctl32.dll version 6.0 on Mar. 10, 2004, by Robert Shearman.
* *
* Unless otherwise noted, we believe this code to be complete, as per * Unless otherwise noted, we believe this code to be complete, as per
* the specification mentioned above. * the specification mentioned above.
* If you discover missing features or bugs please note them below. * If you discover missing features or bugs please note them below.
* *
*/ */
#include <stdarg.h> #include <stdarg.h>

View file

@ -22,11 +22,11 @@
* NOTES * NOTES
* These functions were involuntarily documented by Microsoft in 2002 as * These functions were involuntarily documented by Microsoft in 2002 as
* the outcome of an anti-trust suit brought by various U.S. governments. * the outcome of an anti-trust suit brought by various U.S. governments.
* As a result the specifications on MSDN are inaccurate, incomplete * As a result the specifications on MSDN are inaccurate, incomplete
* and misleading. A much more complete (unofficial) documentation is * and misleading. A much more complete (unofficial) documentation is
* available at: * available at:
* *
* http://members.ozemail.com.au/~geoffch/samples/win32/shell/comctl32 * http://members.ozemail.com.au/~geoffch/samples/win32/shell/comctl32
*/ */
#include <stdarg.h> #include <stdarg.h>
@ -90,7 +90,7 @@ HDSA WINAPI DSA_Create (INT nSize, INT nGrow)
/************************************************************************** /**************************************************************************
* DSA_Destroy [COMCTL32.321] * DSA_Destroy [COMCTL32.321]
* *
* Destroys a dynamic storage array * Destroys a dynamic storage array
* *
* PARAMS * PARAMS

View file

@ -117,7 +117,7 @@ static void HEADER_StoreHDItemInHeader(HEADER_ITEM *lpItem, UINT mask, const HDI
{ {
if (mask & HDI_UNSUPPORTED_FIELDS) if (mask & HDI_UNSUPPORTED_FIELDS)
FIXME("unsupported header fields %x\n", (mask & HDI_UNSUPPORTED_FIELDS)); FIXME("unsupported header fields %x\n", (mask & HDI_UNSUPPORTED_FIELDS));
if (mask & HDI_BITMAP) if (mask & HDI_BITMAP)
lpItem->hbm = phdi->hbm; lpItem->hbm = phdi->hbm;
@ -130,7 +130,7 @@ static void HEADER_StoreHDItemInHeader(HEADER_ITEM *lpItem, UINT mask, const HDI
if (mask & HDI_WIDTH) if (mask & HDI_WIDTH)
lpItem->cxy = phdi->cxy; lpItem->cxy = phdi->cxy;
if (mask & HDI_IMAGE) if (mask & HDI_IMAGE)
{ {
lpItem->iImage = phdi->iImage; lpItem->iImage = phdi->iImage;
if (phdi->iImage == I_IMAGECALLBACK) if (phdi->iImage == I_IMAGECALLBACK)
@ -157,7 +157,7 @@ static void HEADER_StoreHDItemInHeader(HEADER_ITEM *lpItem, UINT mask, const HDI
{ {
lpItem->pszText = NULL; lpItem->pszText = NULL;
lpItem->callbackMask |= HDI_TEXT; lpItem->callbackMask |= HDI_TEXT;
} }
} }
} }
@ -263,7 +263,7 @@ static void HEADER_GetHotDividerRect(HWND hwnd, const HEADER_INFO *infoPtr, RECT
if (infoPtr->uNumItem > 0) if (infoPtr->uNumItem > 0)
{ {
HEADER_ITEM *lpItem; HEADER_ITEM *lpItem;
if (iDivider < infoPtr->uNumItem) if (iDivider < infoPtr->uNumItem)
{ {
lpItem = &infoPtr->items[iDivider]; lpItem = &infoPtr->items[iDivider];
@ -335,7 +335,7 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack, LRESULT lCDFlags
} }
else { else {
HBRUSH hbr; HBRUSH hbr;
if (GetWindowLongW (hwnd, GWL_STYLE) & HDS_BUTTONS) { if (GetWindowLongW (hwnd, GWL_STYLE) & HDS_BUTTONS) {
if (phdi->bDown) { if (phdi->bDown) {
DrawEdge (hdc, &r, BDR_RAISEDOUTER, DrawEdge (hdc, &r, BDR_RAISEDOUTER,
@ -413,7 +413,7 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack, LRESULT lCDFlags
} }
if (bw || iw) if (bw || iw)
cw += *w; cw += *w;
/* align cx using the unclipped cw */ /* align cx using the unclipped cw */
if ((phdi->fmt & HDF_JUSTIFYMASK) == HDF_LEFT) if ((phdi->fmt & HDF_JUSTIFYMASK) == HDF_LEFT)
@ -422,17 +422,17 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack, LRESULT lCDFlags
cx = r.left + rw / 2 - cw / 2; cx = r.left + rw / 2 - cw / 2;
else /* HDF_RIGHT */ else /* HDF_RIGHT */
cx = r.right - cw; cx = r.right - cw;
/* clip cx & cw */ /* clip cx & cw */
if (cx < r.left) if (cx < r.left)
cx = r.left; cx = r.left;
if (cx + cw > r.right) if (cx + cw > r.right)
cw = r.right - cx; cw = r.right - cx;
tx = cx + infoPtr->iMargin; tx = cx + infoPtr->iMargin;
/* since cw might have changed we have to recalculate tw */ /* since cw might have changed we have to recalculate tw */
tw = cw - infoPtr->iMargin * 2; tw = cw - infoPtr->iMargin * 2;
if (iw || bw) { if (iw || bw) {
tw -= *w; tw -= *w;
if (phdi->fmt & HDF_BITMAP_ON_RIGHT) { if (phdi->fmt & HDF_BITMAP_ON_RIGHT) {
@ -460,17 +460,17 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack, LRESULT lCDFlags
HDC hClipDC = GetDC(hwnd); HDC hClipDC = GetDC(hwnd);
HRGN hClipRgn = CreateRectRgn(r.left, r.top, r.right, r.bottom); HRGN hClipRgn = CreateRectRgn(r.left, r.top, r.right, r.bottom);
SelectClipRgn(hClipDC, hClipRgn); SelectClipRgn(hClipDC, hClipRgn);
if (bw) { if (bw) {
HDC hdcBitmap = CreateCompatibleDC (hClipDC); HDC hdcBitmap = CreateCompatibleDC (hClipDC);
SelectObject (hdcBitmap, phdi->hbm); SelectObject (hdcBitmap, phdi->hbm);
BitBlt (hClipDC, bx, r.top + ((INT)rh - bmp.bmHeight) / 2, BitBlt (hClipDC, bx, r.top + ((INT)rh - bmp.bmHeight) / 2,
bmp.bmWidth, bmp.bmHeight, hdcBitmap, 0, 0, SRCCOPY); bmp.bmWidth, bmp.bmHeight, hdcBitmap, 0, 0, SRCCOPY);
DeleteDC (hdcBitmap); DeleteDC (hdcBitmap);
} }
if (iw) { if (iw) {
ImageList_DrawEx (infoPtr->himl, phdi->iImage, hClipDC, ImageList_DrawEx (infoPtr->himl, phdi->iImage, hClipDC,
ix, r.top + ((INT)rh - infoPtr->himl->cy) / 2, ix, r.top + ((INT)rh - infoPtr->himl->cy) / 2,
infoPtr->himl->cx, infoPtr->himl->cy, CLR_DEFAULT, CLR_DEFAULT, 0); infoPtr->himl->cx, infoPtr->himl->cy, CLR_DEFAULT, CLR_DEFAULT, 0);
} }
@ -478,7 +478,7 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack, LRESULT lCDFlags
DeleteObject(hClipRgn); DeleteObject(hClipRgn);
ReleaseDC(hwnd, hClipDC); ReleaseDC(hwnd, hClipDC);
} }
if (((phdi->fmt & HDF_STRING) if (((phdi->fmt & HDF_STRING)
|| (!(phdi->fmt & (HDF_OWNERDRAW|HDF_STRING|HDF_BITMAP| || (!(phdi->fmt & (HDF_OWNERDRAW|HDF_STRING|HDF_BITMAP|
HDF_BITMAP_ON_RIGHT|HDF_IMAGE)))) /* no explicit format specified? */ HDF_BITMAP_ON_RIGHT|HDF_IMAGE)))) /* no explicit format specified? */
@ -503,7 +503,7 @@ HEADER_DrawHotDivider(HWND hwnd, HDC hdc)
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd); HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
HBRUSH brush; HBRUSH brush;
RECT r; RECT r;
HEADER_GetHotDividerRect(hwnd, infoPtr, &r); HEADER_GetHotDividerRect(hwnd, infoPtr, &r);
brush = CreateSolidBrush(GetSysColor(COLOR_HIGHLIGHT)); brush = CreateSolidBrush(GetSysColor(COLOR_HIGHLIGHT));
FillRect(hdc, &r, brush); FillRect(hdc, &r, brush);
@ -528,7 +528,7 @@ HEADER_Refresh (HWND hwnd, HDC hdc)
/* get rect for the bar, adjusted for the border */ /* get rect for the bar, adjusted for the border */
GetClientRect (hwnd, &rect); GetClientRect (hwnd, &rect);
lCDFlags = HEADER_SendCtrlCustomDraw(hwnd, CDDS_PREPAINT, hdc, &rect); lCDFlags = HEADER_SendCtrlCustomDraw(hwnd, CDDS_PREPAINT, hdc, &rect);
if (infoPtr->bDragging) if (infoPtr->bDragging)
ImageList_DragShowNolock(FALSE); ImageList_DragShowNolock(FALSE);
@ -562,14 +562,14 @@ HEADER_Refresh (HWND hwnd, HDC hdc)
DrawEdge (hdc, &rcRest, EDGE_ETCHED, BF_BOTTOM|BF_MIDDLE); DrawEdge (hdc, &rcRest, EDGE_ETCHED, BF_BOTTOM|BF_MIDDLE);
} }
} }
if (infoPtr->iHotDivider != -1) if (infoPtr->iHotDivider != -1)
HEADER_DrawHotDivider(hwnd, hdc); HEADER_DrawHotDivider(hwnd, hdc);
if (infoPtr->bDragging) if (infoPtr->bDragging)
ImageList_DragShowNolock(TRUE); ImageList_DragShowNolock(TRUE);
SelectObject (hdc, hOldFont); SelectObject (hdc, hOldFont);
if (lCDFlags & CDRF_NOTIFYPOSTPAINT) if (lCDFlags & CDRF_NOTIFYPOSTPAINT)
HEADER_SendCtrlCustomDraw(hwnd, CDDS_POSTPAINT, hdc, &rect); HEADER_SendCtrlCustomDraw(hwnd, CDDS_POSTPAINT, hdc, &rect);
} }
@ -737,7 +737,7 @@ HEADER_DrawTrackLine (HWND hwnd, HDC hdc, INT x)
* [I] fSourceUnicode : is src a HDITEMW or HDITEMA * [I] fSourceUnicode : is src a HDITEMW or HDITEMA
* [O] ppvScratch : a pointer to a scratch buffer that needs to be freed after * [O] ppvScratch : a pointer to a scratch buffer that needs to be freed after
* the HDITEM is no longer in use or NULL if none was needed * the HDITEM is no longer in use or NULL if none was needed
* *
* NOTE: We depend on HDITEMA and HDITEMW having the same structure * NOTE: We depend on HDITEMA and HDITEMW having the same structure
*/ */
static void HEADER_CopyHDItemForNotify(const HEADER_INFO *infoPtr, HDITEMW *dest, static void HEADER_CopyHDItemForNotify(const HEADER_INFO *infoPtr, HDITEMW *dest,
@ -745,7 +745,7 @@ static void HEADER_CopyHDItemForNotify(const HEADER_INFO *infoPtr, HDITEMW *dest
{ {
*ppvScratch = NULL; *ppvScratch = NULL;
*dest = *src; *dest = *src;
if (src->mask & HDI_TEXT && src->pszText != LPSTR_TEXTCALLBACKW) /* covers TEXTCALLBACKA as well */ if (src->mask & HDI_TEXT && src->pszText != LPSTR_TEXTCALLBACKW) /* covers TEXTCALLBACKA as well */
{ {
if (fSourceUnicode && infoPtr->nNotifyFormat != NFR_UNICODE) if (fSourceUnicode && infoPtr->nNotifyFormat != NFR_UNICODE)
@ -754,7 +754,7 @@ static void HEADER_CopyHDItemForNotify(const HEADER_INFO *infoPtr, HDITEMW *dest
Str_SetPtrWtoA((LPSTR *)&dest->pszText, src->pszText); Str_SetPtrWtoA((LPSTR *)&dest->pszText, src->pszText);
*ppvScratch = dest->pszText; *ppvScratch = dest->pszText;
} }
if (!fSourceUnicode && infoPtr->nNotifyFormat == NFR_UNICODE) if (!fSourceUnicode && infoPtr->nNotifyFormat == NFR_UNICODE)
{ {
dest->pszText = NULL; dest->pszText = NULL;
@ -812,7 +812,7 @@ HEADER_SendNotifyWithHDItemT(HWND hwnd, UINT code, INT iItem, HDITEMW *lpItem)
{ {
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd); HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
NMHEADERW nmhdr; NMHEADERW nmhdr;
if (infoPtr->nNotifyFormat != NFR_UNICODE) if (infoPtr->nNotifyFormat != NFR_UNICODE)
code = HEADER_NotifyCodeWtoA(code); code = HEADER_NotifyCodeWtoA(code);
nmhdr.iItem = iItem; nmhdr.iItem = iItem;
@ -856,9 +856,9 @@ HEADER_SendNotifyWithIntFieldT(HWND hwnd, UINT code, INT iItem, INT mask, INT iV
/** /**
* Prepare callback items * Prepare callback items
* depends on NMHDDISPINFOW having same structure as NMHDDISPINFOA * depends on NMHDDISPINFOW having same structure as NMHDDISPINFOA
* (so we handle the two cases only doing a specific cast for pszText). * (so we handle the two cases only doing a specific cast for pszText).
* Checks if any of the required field are callback. If there are sends a * Checks if any of the required field are callback. If there are sends a
* NMHDISPINFO notify to retrieve these items. The items are stored in the * NMHDISPINFO notify to retrieve these items. The items are stored in the
* HEADER_ITEM pszText and iImage fields. They should be freed with * HEADER_ITEM pszText and iImage fields. They should be freed with
* HEADER_FreeCallbackItems. * HEADER_FreeCallbackItems.
@ -886,7 +886,7 @@ HEADER_PrepareCallbackItems(HWND hwnd, INT iItem, INT reqMask)
Free(lpItem->pszText); Free(lpItem->pszText);
lpItem->pszText = NULL; lpItem->pszText = NULL;
} }
memset(&dispInfo, 0, sizeof(NMHDDISPINFOW)); memset(&dispInfo, 0, sizeof(NMHDDISPINFOW));
dispInfo.hdr.hwndFrom = hwnd; dispInfo.hdr.hwndFrom = hwnd;
dispInfo.hdr.idFrom = GetWindowLongPtrW (hwnd, GWLP_ID); dispInfo.hdr.idFrom = GetWindowLongPtrW (hwnd, GWLP_ID);
@ -907,17 +907,17 @@ HEADER_PrepareCallbackItems(HWND hwnd, INT iItem, INT reqMask)
dispInfo.iItem = iItem; dispInfo.iItem = iItem;
dispInfo.mask = mask; dispInfo.mask = mask;
dispInfo.lParam = lpItem->lParam; dispInfo.lParam = lpItem->lParam;
TRACE("Sending HDN_GETDISPINFO%c\n", infoPtr->nNotifyFormat == NFR_UNICODE?'W':'A'); TRACE("Sending HDN_GETDISPINFO%c\n", infoPtr->nNotifyFormat == NFR_UNICODE?'W':'A');
SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, SendMessageW(infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM) dispInfo.hdr.idFrom, (WPARAM) dispInfo.hdr.idFrom,
(LPARAM) &dispInfo); (LPARAM) &dispInfo);
TRACE("SendMessage returns(mask:0x%x,str:%s,lParam:%p)\n", TRACE("SendMessage returns(mask:0x%x,str:%s,lParam:%p)\n",
dispInfo.mask, dispInfo.mask,
(infoPtr->nNotifyFormat == NFR_UNICODE ? debugstr_w(dispInfo.pszText) : (LPSTR) dispInfo.pszText), (infoPtr->nNotifyFormat == NFR_UNICODE ? debugstr_w(dispInfo.pszText) : (LPSTR) dispInfo.pszText),
(void*) dispInfo.lParam); (void*) dispInfo.lParam);
if (mask & HDI_IMAGE) if (mask & HDI_IMAGE)
lpItem->iImage = dispInfo.iImage; lpItem->iImage = dispInfo.iImage;
if (mask & HDI_TEXT) if (mask & HDI_TEXT)
@ -936,13 +936,13 @@ HEADER_PrepareCallbackItems(HWND hwnd, INT iItem, INT reqMask)
Free(pvBuffer); Free(pvBuffer);
} }
} }
if (dispInfo.mask & HDI_DI_SETITEM) if (dispInfo.mask & HDI_DI_SETITEM)
{ {
/* make the items permanent */ /* make the items permanent */
lpItem->callbackMask &= ~dispInfo.mask; lpItem->callbackMask &= ~dispInfo.mask;
} }
return TRUE; return TRUE;
} }
@ -980,7 +980,7 @@ HEADER_CreateDragImage (HWND hwnd, WPARAM wParam)
HDC hDeviceDC; HDC hDeviceDC;
int height, width; int height, width;
HFONT hFont; HFONT hFont;
if (wParam < 0 || wParam >= infoPtr->uNumItem) if (wParam < 0 || wParam >= infoPtr->uNumItem)
return FALSE; return FALSE;
@ -990,7 +990,7 @@ HEADER_CreateDragImage (HWND hwnd, WPARAM wParam)
lpItem = &infoPtr->items[wParam]; lpItem = &infoPtr->items[wParam];
width = lpItem->rect.right - lpItem->rect.left; width = lpItem->rect.right - lpItem->rect.left;
height = lpItem->rect.bottom - lpItem->rect.top; height = lpItem->rect.bottom - lpItem->rect.top;
hDeviceDC = GetDC(NULL); hDeviceDC = GetDC(NULL);
hMemoryDC = CreateCompatibleDC(hDeviceDC); hMemoryDC = CreateCompatibleDC(hDeviceDC);
hMemory = CreateCompatibleBitmap(hDeviceDC, width, height); hMemory = CreateCompatibleBitmap(hDeviceDC, width, height);
@ -1005,13 +1005,13 @@ HEADER_CreateDragImage (HWND hwnd, WPARAM wParam)
HEADER_DrawItem(hwnd, hMemoryDC, wParam, FALSE, lCDFlags); HEADER_DrawItem(hwnd, hMemoryDC, wParam, FALSE, lCDFlags);
if (lCDFlags & CDRF_NOTIFYPOSTPAINT) if (lCDFlags & CDRF_NOTIFYPOSTPAINT)
HEADER_SendCtrlCustomDraw(hwnd, CDDS_POSTPAINT, hMemoryDC, &rc); HEADER_SendCtrlCustomDraw(hwnd, CDDS_POSTPAINT, hMemoryDC, &rc);
hMemory = SelectObject(hMemoryDC, hOldBitmap); hMemory = SelectObject(hMemoryDC, hOldBitmap);
DeleteDC(hMemoryDC); DeleteDC(hMemoryDC);
if (hMemory == NULL) /* if anything failed */ if (hMemory == NULL) /* if anything failed */
return FALSE; return FALSE;
himl = ImageList_Create(width, height, ILC_COLORDDB, 1, 1); himl = ImageList_Create(width, height, ILC_COLORDDB, 1, 1);
ImageList_Add(himl, hMemory, NULL); ImageList_Add(himl, hMemory, NULL);
DeleteObject(hMemory); DeleteObject(hMemory);
@ -1024,7 +1024,7 @@ HEADER_SetHotDivider(HWND hwnd, WPARAM wParam, LPARAM lParam)
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(hwnd); HEADER_INFO *infoPtr = HEADER_GetInfoPtr(hwnd);
INT iDivider; INT iDivider;
RECT r; RECT r;
if (wParam) if (wParam)
{ {
POINT pt; POINT pt;
@ -1032,7 +1032,7 @@ HEADER_SetHotDivider(HWND hwnd, WPARAM wParam, LPARAM lParam)
pt.x = (INT)(SHORT)LOWORD(lParam); pt.x = (INT)(SHORT)LOWORD(lParam);
pt.y = 0; pt.y = 0;
HEADER_InternalHitTest (hwnd, &pt, &flags, &iDivider); HEADER_InternalHitTest (hwnd, &pt, &flags, &iDivider);
if (flags & HHT_TOLEFT) if (flags & HHT_TOLEFT)
iDivider = 0; iDivider = 0;
else if (flags & HHT_NOWHERE || flags & HHT_TORIGHT) else if (flags & HHT_NOWHERE || flags & HHT_TORIGHT)
@ -1046,7 +1046,7 @@ HEADER_SetHotDivider(HWND hwnd, WPARAM wParam, LPARAM lParam)
} }
else else
iDivider = (INT)lParam; iDivider = (INT)lParam;
/* Note; wParam==FALSE, lParam==-1 is valid and is used to clear the hot divider */ /* Note; wParam==FALSE, lParam==-1 is valid and is used to clear the hot divider */
if (iDivider<-1 || iDivider>(int)infoPtr->uNumItem) if (iDivider<-1 || iDivider>(int)infoPtr->uNumItem)
return iDivider; return iDivider;
@ -1094,7 +1094,7 @@ HEADER_DeleteItem (HWND hwnd, WPARAM wParam)
(infoPtr->uNumItem - iOrder) * sizeof(INT)); (infoPtr->uNumItem - iOrder) * sizeof(INT));
infoPtr->items = ReAlloc(infoPtr->items, sizeof(HEADER_ITEM) * infoPtr->uNumItem); infoPtr->items = ReAlloc(infoPtr->items, sizeof(HEADER_ITEM) * infoPtr->uNumItem);
infoPtr->order = ReAlloc(infoPtr->order, sizeof(INT) * infoPtr->uNumItem); infoPtr->order = ReAlloc(infoPtr->order, sizeof(INT) * infoPtr->uNumItem);
/* Correct the orders */ /* Correct the orders */
for (i = 0; i < infoPtr->uNumItem; i++) for (i = 0; i < infoPtr->uNumItem; i++)
{ {
@ -1146,7 +1146,7 @@ HEADER_GetItemT (HWND hwnd, INT nItem, LPHDITEMW phdi, BOOL bUnicode)
TRACE("mask %x contains unknown fields. Using only comctl32 4.0 fields\n", mask); TRACE("mask %x contains unknown fields. Using only comctl32 4.0 fields\n", mask);
mask &= HDI_COMCTL32_4_0_FIELDS; mask &= HDI_COMCTL32_4_0_FIELDS;
} }
lpItem = &infoPtr->items[nItem]; lpItem = &infoPtr->items[nItem];
HEADER_PrepareCallbackItems(hwnd, nItem, mask); HEADER_PrepareCallbackItems(hwnd, nItem, mask);
@ -1162,7 +1162,7 @@ HEADER_GetItemT (HWND hwnd, INT nItem, LPHDITEMW phdi, BOOL bUnicode)
if (mask & HDI_LPARAM) if (mask & HDI_LPARAM)
phdi->lParam = lpItem->lParam; phdi->lParam = lpItem->lParam;
if (mask & HDI_IMAGE) if (mask & HDI_IMAGE)
phdi->iImage = lpItem->iImage; phdi->iImage = lpItem->iImage;
if (mask & HDI_ORDER) if (mask & HDI_ORDER)
@ -1288,7 +1288,7 @@ HEADER_InsertItemT (HWND hwnd, INT nItem, const HDITEMW *phdi, BOOL bUnicode)
infoPtr->uNumItem++; infoPtr->uNumItem++;
infoPtr->items = ReAlloc(infoPtr->items, sizeof(HEADER_ITEM) * infoPtr->uNumItem); infoPtr->items = ReAlloc(infoPtr->items, sizeof(HEADER_ITEM) * infoPtr->uNumItem);
infoPtr->order = ReAlloc(infoPtr->order, sizeof(INT) * infoPtr->uNumItem); infoPtr->order = ReAlloc(infoPtr->order, sizeof(INT) * infoPtr->uNumItem);
/* make space for the new item */ /* make space for the new item */
memmove(&infoPtr->items[nItem + 1], &infoPtr->items[nItem], memmove(&infoPtr->items[nItem + 1], &infoPtr->items[nItem],
(infoPtr->uNumItem - nItem - 1) * sizeof(HEADER_ITEM)); (infoPtr->uNumItem - nItem - 1) * sizeof(HEADER_ITEM));
@ -1381,7 +1381,7 @@ static LRESULT
HEADER_GetBitmapMargin(HWND hwnd) HEADER_GetBitmapMargin(HWND hwnd)
{ {
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(hwnd); HEADER_INFO *infoPtr = HEADER_GetInfoPtr(hwnd);
return infoPtr->iMargin; return infoPtr->iMargin;
} }
@ -1639,11 +1639,11 @@ HEADER_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
{ {
HEADER_ITEM *lpItem = &infoPtr->items[infoPtr->iMoveItem]; HEADER_ITEM *lpItem = &infoPtr->items[infoPtr->iMoveItem];
INT iNewOrder; INT iNewOrder;
ImageList_DragShowNolock(FALSE); ImageList_DragShowNolock(FALSE);
ImageList_EndDrag(); ImageList_EndDrag();
lpItem->bDown=FALSE; lpItem->bDown=FALSE;
if (infoPtr->iHotDivider == -1) if (infoPtr->iHotDivider == -1)
iNewOrder = -1; iNewOrder = -1;
else if (infoPtr->iHotDivider == infoPtr->uNumItem) else if (infoPtr->iHotDivider == infoPtr->uNumItem)
@ -1664,7 +1664,7 @@ HEADER_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
} }
else else
InvalidateRect(hwnd, &infoPtr->items[infoPtr->iMoveItem].rect, FALSE); InvalidateRect(hwnd, &infoPtr->items[infoPtr->iMoveItem].rect, FALSE);
HEADER_SetHotDivider(hwnd, FALSE, -1); HEADER_SetHotDivider(hwnd, FALSE, -1);
} }
else if (!(dwStyle&HDS_DRAGDROP) || !HEADER_IsDragDistance(infoPtr, &pt)) else if (!(dwStyle&HDS_DRAGDROP) || !HEADER_IsDragDistance(infoPtr, &pt))
@ -1694,7 +1694,7 @@ HEADER_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
HEADER_DrawTrackLine (hwnd, hdc, infoPtr->xOldTrack); HEADER_DrawTrackLine (hwnd, hdc, infoPtr->xOldTrack);
ReleaseDC (hwnd, hdc); ReleaseDC (hwnd, hdc);
} }
if (!HEADER_SendNotifyWithIntFieldT(hwnd, HDN_ITEMCHANGINGW, infoPtr->iMoveItem, HDI_WIDTH, iNewWidth)) if (!HEADER_SendNotifyWithIntFieldT(hwnd, HDN_ITEMCHANGINGW, infoPtr->iMoveItem, HDI_WIDTH, iNewWidth))
{ {
infoPtr->items[infoPtr->iMoveItem].cxy = iNewWidth; infoPtr->items[infoPtr->iMoveItem].cxy = iNewWidth;
@ -1796,7 +1796,7 @@ HEADER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
} }
} }
} }
if (infoPtr->bDragging) if (infoPtr->bDragging)
{ {
POINT drag; POINT drag;
@ -1806,7 +1806,7 @@ HEADER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
ImageList_DragMove(drag.x, drag.y); ImageList_DragMove(drag.x, drag.y);
HEADER_SetHotDivider(hwnd, TRUE, lParam); HEADER_SetHotDivider(hwnd, TRUE, lParam);
} }
if (infoPtr->bPressed && !infoPtr->bDragging) { if (infoPtr->bPressed && !infoPtr->bDragging) {
BOOL oldState = infoPtr->items[infoPtr->iMoveItem].bDown; BOOL oldState = infoPtr->items[infoPtr->iMoveItem].bDown;
if ((nItem == infoPtr->iMoveItem) && (flags == HHT_ONHEADER)) if ((nItem == infoPtr->iMoveItem) && (flags == HHT_ONHEADER))
@ -1830,18 +1830,18 @@ HEADER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
INT nOldWidth = lpItem->rect.right - lpItem->rect.left; INT nOldWidth = lpItem->rect.right - lpItem->rect.left;
RECT rcClient; RECT rcClient;
RECT rcScroll; RECT rcScroll;
if (nWidth < 0) nWidth = 0; if (nWidth < 0) nWidth = 0;
infoPtr->items[infoPtr->iMoveItem].cxy = nWidth; infoPtr->items[infoPtr->iMoveItem].cxy = nWidth;
HEADER_SetItemBounds(hwnd); HEADER_SetItemBounds(hwnd);
GetClientRect(hwnd, &rcClient); GetClientRect(hwnd, &rcClient);
rcScroll = rcClient; rcScroll = rcClient;
rcScroll.left = lpItem->rect.left + nOldWidth; rcScroll.left = lpItem->rect.left + nOldWidth;
ScrollWindowEx(hwnd, nWidth - nOldWidth, 0, &rcScroll, &rcClient, NULL, NULL, 0); ScrollWindowEx(hwnd, nWidth - nOldWidth, 0, &rcScroll, &rcClient, NULL, NULL, 0);
InvalidateRect(hwnd, &lpItem->rect, FALSE); InvalidateRect(hwnd, &lpItem->rect, FALSE);
UpdateWindow(hwnd); UpdateWindow(hwnd);
HEADER_SendNotifyWithIntFieldT(hwnd, HDN_ITEMCHANGEDW, infoPtr->iMoveItem, HDI_WIDTH, nWidth); HEADER_SendNotifyWithIntFieldT(hwnd, HDN_ITEMCHANGEDW, infoPtr->iMoveItem, HDI_WIDTH, nWidth);
} }
} }

View file

@ -21,7 +21,7 @@
* *
* This code was audited for completeness against the documented features * This code was audited for completeness against the documented features
* of Comctl32.dll version 6.0 on Sep. 21, 2004, by Robert Shearman. * of Comctl32.dll version 6.0 on Sep. 21, 2004, by Robert Shearman.
* *
* Unless otherwise noted, we believe this code to be complete, as per * Unless otherwise noted, we believe this code to be complete, as per
* the specification mentioned above. * the specification mentioned above.
* If you discover missing features or bugs please note them below. * If you discover missing features or bugs please note them below.
@ -74,15 +74,15 @@ HOTKEY_IsCombInv(const HOTKEY_INFO *infoPtr)
return TRUE; return TRUE;
if((infoPtr->InvComb & HKCOMB_A) && IsOnlySet(HOTKEYF_ALT)) if((infoPtr->InvComb & HKCOMB_A) && IsOnlySet(HOTKEYF_ALT))
return TRUE; return TRUE;
if((infoPtr->InvComb & HKCOMB_SC) && if((infoPtr->InvComb & HKCOMB_SC) &&
IsOnlySet(HOTKEYF_SHIFT | HOTKEYF_CONTROL)) IsOnlySet(HOTKEYF_SHIFT | HOTKEYF_CONTROL))
return TRUE; return TRUE;
if((infoPtr->InvComb & HKCOMB_SA) && IsOnlySet(HOTKEYF_SHIFT | HOTKEYF_ALT)) if((infoPtr->InvComb & HKCOMB_SA) && IsOnlySet(HOTKEYF_SHIFT | HOTKEYF_ALT))
return TRUE; return TRUE;
if((infoPtr->InvComb & HKCOMB_CA) && if((infoPtr->InvComb & HKCOMB_CA) &&
IsOnlySet(HOTKEYF_CONTROL | HOTKEYF_ALT)) IsOnlySet(HOTKEYF_CONTROL | HOTKEYF_ALT))
return TRUE; return TRUE;
if((infoPtr->InvComb & HKCOMB_SCA) && if((infoPtr->InvComb & HKCOMB_SCA) &&
IsOnlySet(HOTKEYF_SHIFT | HOTKEYF_CONTROL | HOTKEYF_ALT)) IsOnlySet(HOTKEYF_SHIFT | HOTKEYF_CONTROL | HOTKEYF_ALT))
return TRUE; return TRUE;
@ -130,7 +130,7 @@ HOTKEY_DrawHotKey(HOTKEY_INFO *infoPtr, HDC hdc, LPCWSTR KeyName, WORD NameLen)
} }
/* Draw the names of the keys in the control */ /* Draw the names of the keys in the control */
static void static void
HOTKEY_Refresh(HOTKEY_INFO *infoPtr, HDC hdc) HOTKEY_Refresh(HOTKEY_INFO *infoPtr, HDC hdc)
{ {
WCHAR KeyName[64]; WCHAR KeyName[64];
@ -143,10 +143,10 @@ HOTKEY_Refresh(HOTKEY_INFO *infoPtr, HDC hdc)
HOTKEY_DrawHotKey (infoPtr, hdc, infoPtr->strNone, 4); HOTKEY_DrawHotKey (infoPtr, hdc, infoPtr->strNone, 4);
return; return;
} }
if(infoPtr->HotKey) if(infoPtr->HotKey)
Modifier = HIBYTE(infoPtr->HotKey); Modifier = HIBYTE(infoPtr->HotKey);
else if(HOTKEY_IsCombInv(infoPtr)) else if(HOTKEY_IsCombInv(infoPtr))
Modifier = infoPtr->InvMod; Modifier = infoPtr->InvMod;
else else
Modifier = infoPtr->CurrMod; Modifier = infoPtr->CurrMod;
@ -199,7 +199,7 @@ HOTKEY_Paint(HOTKEY_INFO *infoPtr, HDC hdc)
static LRESULT static LRESULT
HOTKEY_GetHotKey(const HOTKEY_INFO *infoPtr) HOTKEY_GetHotKey(const HOTKEY_INFO *infoPtr)
{ {
TRACE("(infoPtr=%p) Modifiers: 0x%x, Virtual Key: %d\n", infoPtr, TRACE("(infoPtr=%p) Modifiers: 0x%x, Virtual Key: %d\n", infoPtr,
HIBYTE(infoPtr->HotKey), LOBYTE(infoPtr->HotKey)); HIBYTE(infoPtr->HotKey), LOBYTE(infoPtr->HotKey));
return (LRESULT)infoPtr->HotKey; return (LRESULT)infoPtr->HotKey;
} }
@ -208,14 +208,14 @@ static void
HOTKEY_SetHotKey(HOTKEY_INFO *infoPtr, WORD hotKey) HOTKEY_SetHotKey(HOTKEY_INFO *infoPtr, WORD hotKey)
{ {
infoPtr->HotKey = hotKey; infoPtr->HotKey = hotKey;
infoPtr->ScanCode = infoPtr->ScanCode =
MAKELPARAM(0, MapVirtualKeyW(LOBYTE(infoPtr->HotKey), 0)); MAKELPARAM(0, MapVirtualKeyW(LOBYTE(infoPtr->HotKey), 0));
TRACE("(infoPtr=%p hotKey=%x) Modifiers: 0x%x, Virtual Key: %d\n", infoPtr, TRACE("(infoPtr=%p hotKey=%x) Modifiers: 0x%x, Virtual Key: %d\n", infoPtr,
hotKey, HIBYTE(infoPtr->HotKey), LOBYTE(infoPtr->HotKey)); hotKey, HIBYTE(infoPtr->HotKey), LOBYTE(infoPtr->HotKey));
InvalidateRect(infoPtr->hwndSelf, NULL, TRUE); InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
} }
static void static void
HOTKEY_SetRules(HOTKEY_INFO *infoPtr, WORD invComb, WORD invMod) HOTKEY_SetRules(HOTKEY_INFO *infoPtr, WORD invComb, WORD invMod)
{ {
infoPtr->InvComb = invComb; infoPtr->InvComb = invComb;
@ -407,7 +407,7 @@ HOTKEY_NCCreate (HWND hwnd, const CREATESTRUCTW *lpcs)
{ {
HOTKEY_INFO *infoPtr; HOTKEY_INFO *infoPtr;
DWORD dwExStyle = GetWindowLongW (hwnd, GWL_EXSTYLE); DWORD dwExStyle = GetWindowLongW (hwnd, GWL_EXSTYLE);
SetWindowLongW (hwnd, GWL_EXSTYLE, SetWindowLongW (hwnd, GWL_EXSTYLE,
dwExStyle | WS_EX_CLIENTEDGE); dwExStyle | WS_EX_CLIENTEDGE);
/* allocate memory for info structure */ /* allocate memory for info structure */

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 B

View file

@ -910,7 +910,7 @@ ImageList_DragMove (INT x, INT y)
BitBlt(hdcBg, 0, 0, InternalDrag.himl->cx, InternalDrag.himl->cy, BitBlt(hdcBg, 0, 0, InternalDrag.himl->cx, InternalDrag.himl->cy,
hdcOffScreen, origNewX - origRegX, origNewY - origRegY, SRCCOPY); hdcOffScreen, origNewX - origRegX, origNewY - origRegY, SRCCOPY);
/* draw the image */ /* draw the image */
ImageList_InternalDragDraw(hdcOffScreen, origNewX - origRegX, ImageList_InternalDragDraw(hdcOffScreen, origNewX - origRegX,
origNewY - origRegY); origNewY - origRegY);
/* draw the update region to the screen */ /* draw the update region to the screen */
BitBlt(hdcDrag, origRegX, origRegY, sizeRegX, sizeRegY, BitBlt(hdcDrag, origRegX, origRegY, sizeRegX, sizeRegY,
@ -955,7 +955,7 @@ ImageList_DragShowNolock (BOOL bShow)
if (!is_valid(InternalDrag.himl)) if (!is_valid(InternalDrag.himl))
return FALSE; return FALSE;
TRACE("bShow=0x%X!\n", bShow); TRACE("bShow=0x%X!\n", bShow);
/* DragImage is already visible/hidden */ /* DragImage is already visible/hidden */
@ -1024,7 +1024,7 @@ ImageList_DragShowNolock (BOOL bShow)
BOOL WINAPI BOOL WINAPI
ImageList_Draw (HIMAGELIST himl, INT i, HDC hdc, INT x, INT y, UINT fStyle) ImageList_Draw (HIMAGELIST himl, INT i, HDC hdc, INT x, INT y, UINT fStyle)
{ {
return ImageList_DrawEx (himl, i, hdc, x, y, 0, 0, return ImageList_DrawEx (himl, i, hdc, x, y, 0, 0,
CLR_DEFAULT, CLR_DEFAULT, fStyle); CLR_DEFAULT, CLR_DEFAULT, fStyle);
} }
@ -1144,9 +1144,9 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
if (!hImageListDC || !hImageDC || !hImageBmp || if (!hImageListDC || !hImageDC || !hImageBmp ||
(bBlend && !hBlendMaskBmp) || (himl->hbmMask && !hMaskListDC)) (bBlend && !hBlendMaskBmp) || (himl->hbmMask && !hMaskListDC))
goto cleanup; goto cleanup;
hOldImageBmp = SelectObject(hImageDC, hImageBmp); hOldImageBmp = SelectObject(hImageDC, hImageBmp);
/* /*
* To obtain a transparent look, background color should be set * To obtain a transparent look, background color should be set
* to white and foreground color to black when blting the * to white and foreground color to black when blting the
@ -2291,8 +2291,6 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT nIndex, HICON hIcon)
return -1; return -1;
} }
if (ii.hbmColor == 0)
ERR("no color!\n");
ret = GetObjectW (ii.hbmMask, sizeof(BITMAP), (LPVOID)&bmp); ret = GetObjectW (ii.hbmMask, sizeof(BITMAP), (LPVOID)&bmp);
if (!ret) { if (!ret) {
ERR("couldn't get mask bitmap info\n"); ERR("couldn't get mask bitmap info\n");
@ -2317,18 +2315,32 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT nIndex, HICON hIcon)
if (hdcImage == 0) if (hdcImage == 0)
ERR("invalid hdcImage!\n"); ERR("invalid hdcImage!\n");
imagelist_point_from_index(himl, nIndex, &pt);
SetTextColor(himl->hdcImage, RGB(0,0,0)); SetTextColor(himl->hdcImage, RGB(0,0,0));
SetBkColor (himl->hdcImage, RGB(255,255,255)); SetBkColor (himl->hdcImage, RGB(255,255,255));
hbmOldSrc = SelectObject (hdcImage, ii.hbmColor);
imagelist_point_from_index(himl, nIndex, &pt); if (ii.hbmColor)
StretchBlt (himl->hdcImage, pt.x, pt.y, himl->cx, himl->cy, {
hdcImage, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY); hbmOldSrc = SelectObject (hdcImage, ii.hbmColor);
StretchBlt (himl->hdcImage, pt.x, pt.y, himl->cx, himl->cy,
if (himl->hbmMask) { hdcImage, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY);
SelectObject (hdcImage, ii.hbmMask); if (himl->hbmMask)
StretchBlt (himl->hdcMask, pt.x, pt.y, himl->cx, himl->cy, {
hdcImage, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY); SelectObject (hdcImage, ii.hbmMask);
StretchBlt (himl->hdcMask, pt.x, pt.y, himl->cx, himl->cy,
hdcImage, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY);
}
}
else
{
UINT height = bmp.bmHeight / 2;
hbmOldSrc = SelectObject (hdcImage, ii.hbmMask);
StretchBlt (himl->hdcImage, pt.x, pt.y, himl->cx, himl->cy,
hdcImage, 0, height, bmp.bmWidth, height, SRCCOPY);
if (himl->hbmMask)
StretchBlt (himl->hdcMask, pt.x, pt.y, himl->cx, himl->cy,
hdcImage, 0, 0, bmp.bmWidth, height, SRCCOPY);
} }
SelectObject (hdcImage, hbmOldSrc); SelectObject (hdcImage, hbmOldSrc);
@ -2570,8 +2582,6 @@ ImageList_SetImageCount (HIMAGELIST himl, UINT iImageCount)
if (!is_valid(himl)) if (!is_valid(himl))
return FALSE; return FALSE;
if (iImageCount < 0)
return FALSE;
if (himl->cMaxImage > iImageCount) if (himl->cMaxImage > iImageCount)
{ {
himl->cCurImage = iImageCount; himl->cCurImage = iImageCount;

View file

@ -22,14 +22,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
* *
* NOTE * NOTE
* *
* This code was audited for completeness against the documented features * This code was audited for completeness against the documented features
* of Comctl32.dll version 6.0 on Sep. 9, 2002, by Dimitrie O. Paun. * of Comctl32.dll version 6.0 on Sep. 9, 2002, by Dimitrie O. Paun.
* *
* Unless otherwise noted, we believe this code to be complete, as per * Unless otherwise noted, we believe this code to be complete, as per
* the specification mentioned above. * the specification mentioned above.
* If you discover missing features, or bugs, please note them below. * If you discover missing features, or bugs, please note them below.
* *
*/ */
#include <ctype.h> #include <ctype.h>
@ -66,7 +66,7 @@ typedef struct
IPPART_INFO Part[4]; IPPART_INFO Part[4];
} IPADDRESS_INFO; } IPADDRESS_INFO;
static const WCHAR IP_SUBCLASS_PROP[] = static const WCHAR IP_SUBCLASS_PROP[] =
{ 'C', 'C', 'I', 'P', '3', '2', 'S', 'u', 'b', 'c', 'l', 'a', 's', 's', 'I', 'n', 'f', 'o', 0 }; { 'C', 'C', 'I', 'P', '3', '2', 'S', 'u', 'b', 'c', 'l', 'a', 's', 's', 'I', 'n', 'f', 'o', 0 };
#define POS_DEFAULT 0 #define POS_DEFAULT 0
@ -142,10 +142,10 @@ static LRESULT IPADDRESS_Draw (const IPADDRESS_INFO *infoPtr, HDC hdc)
bgCol = COLOR_3DFACE; bgCol = COLOR_3DFACE;
fgCol = COLOR_GRAYTEXT; fgCol = COLOR_GRAYTEXT;
} }
FillRect (hdc, &rect, (HBRUSH)(DWORD_PTR)(bgCol+1)); FillRect (hdc, &rect, (HBRUSH)(DWORD_PTR)(bgCol+1));
DrawEdge (hdc, &rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST); DrawEdge (hdc, &rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
SetBkColor (hdc, GetSysColor(bgCol)); SetBkColor (hdc, GetSysColor(bgCol));
SetTextColor(hdc, GetSysColor(fgCol)); SetTextColor(hdc, GetSysColor(fgCol));

File diff suppressed because it is too large Load diff

View file

@ -1415,14 +1415,14 @@ MONTHCAL_LButtonDown(MONTHCAL_INFO *infoPtr, LPARAM lParam)
infoPtr->status = MC_NEXTPRESSED; infoPtr->status = MC_NEXTPRESSED;
SetTimer(infoPtr->hwndSelf, MC_NEXTMONTHTIMER, MC_NEXTMONTHDELAY, 0); SetTimer(infoPtr->hwndSelf, MC_NEXTMONTHTIMER, MC_NEXTMONTHDELAY, 0);
InvalidateRect(infoPtr->hwndSelf, NULL, FALSE); InvalidateRect(infoPtr->hwndSelf, NULL, FALSE);
return TRUE; return 0;
} }
if(hit == MCHT_TITLEBTNPREV){ if(hit == MCHT_TITLEBTNPREV){
MONTHCAL_GoToPrevMonth(infoPtr); MONTHCAL_GoToPrevMonth(infoPtr);
infoPtr->status = MC_PREVPRESSED; infoPtr->status = MC_PREVPRESSED;
SetTimer(infoPtr->hwndSelf, MC_PREVMONTHTIMER, MC_NEXTMONTHDELAY, 0); SetTimer(infoPtr->hwndSelf, MC_PREVMONTHTIMER, MC_NEXTMONTHDELAY, 0);
InvalidateRect(infoPtr->hwndSelf, NULL, FALSE); InvalidateRect(infoPtr->hwndSelf, NULL, FALSE);
return TRUE; return 0;
} }
if(hit == MCHT_TITLEMONTH) { if(hit == MCHT_TITLEMONTH) {
@ -1471,14 +1471,30 @@ MONTHCAL_LButtonDown(MONTHCAL_INFO *infoPtr, LPARAM lParam)
SendMessageW( infoPtr->hWndYearUpDown, UDM_SETRANGE, (WPARAM) 0, MAKELONG (9999, 1753)); SendMessageW( infoPtr->hWndYearUpDown, UDM_SETRANGE, (WPARAM) 0, MAKELONG (9999, 1753));
SendMessageW( infoPtr->hWndYearUpDown, UDM_SETBUDDY, (WPARAM) infoPtr->hWndYearEdit, (LPARAM)0 ); SendMessageW( infoPtr->hWndYearUpDown, UDM_SETBUDDY, (WPARAM) infoPtr->hWndYearEdit, (LPARAM)0 );
SendMessageW( infoPtr->hWndYearUpDown, UDM_SETPOS, (WPARAM) 0,(LPARAM)infoPtr->currentYear ); SendMessageW( infoPtr->hWndYearUpDown, UDM_SETPOS, (WPARAM) 0,(LPARAM)infoPtr->currentYear );
return TRUE; return 0;
} }
if(hit == MCHT_TODAYLINK) { if(hit == MCHT_TODAYLINK) {
NMSELCHANGE nmsc;
infoPtr->curSelDay = infoPtr->todaysDate.wDay;
infoPtr->firstSelDay = infoPtr->todaysDate.wDay;
infoPtr->currentMonth=infoPtr->todaysDate.wMonth; infoPtr->currentMonth=infoPtr->todaysDate.wMonth;
infoPtr->currentYear=infoPtr->todaysDate.wYear; infoPtr->currentYear=infoPtr->todaysDate.wYear;
MONTHCAL_CopyTime(&infoPtr->todaysDate, &infoPtr->minSel);
MONTHCAL_CopyTime(&infoPtr->todaysDate, &infoPtr->maxSel);
InvalidateRect(infoPtr->hwndSelf, NULL, FALSE); InvalidateRect(infoPtr->hwndSelf, NULL, FALSE);
return TRUE;
nmsc.nmhdr.hwndFrom = infoPtr->hwndSelf;
nmsc.nmhdr.idFrom = GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_ID);
nmsc.nmhdr.code = MCN_SELCHANGE;
MONTHCAL_CopyTime(&infoPtr->minSel, &nmsc.stSelStart);
MONTHCAL_CopyTime(&infoPtr->maxSel, &nmsc.stSelEnd);
SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, (WPARAM)nmsc.nmhdr.idFrom, (LPARAM)&nmsc);
nmsc.nmhdr.code = MCN_SELECT;
SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, (WPARAM)nmsc.nmhdr.idFrom,(LPARAM)&nmsc);
return 0;
} }
if(hit == MCHT_CALENDARDATE) { if(hit == MCHT_CALENDARDATE) {
SYSTEMTIME selArray[2]; SYSTEMTIME selArray[2];
@ -1511,10 +1527,10 @@ MONTHCAL_LButtonDown(MONTHCAL_INFO *infoPtr, LPARAM lParam)
infoPtr->firstSelDay = ht.st.wDay; infoPtr->firstSelDay = ht.st.wDay;
infoPtr->curSelDay = ht.st.wDay; infoPtr->curSelDay = ht.st.wDay;
infoPtr->status = MC_SEL_LBUTDOWN; infoPtr->status = MC_SEL_LBUTDOWN;
return TRUE; return 0;
} }
return 0; return 1;
} }

View file

@ -21,7 +21,7 @@
* *
* This code was audited for completeness against the documented features * This code was audited for completeness against the documented features
* of Comctl32.dll version 6.0 on Sep. 18, 2004, by Robert Shearman. * of Comctl32.dll version 6.0 on Sep. 18, 2004, by Robert Shearman.
* *
* Unless otherwise noted, we believe this code to be complete, as per * Unless otherwise noted, we believe this code to be complete, as per
* the specification mentioned above. * the specification mentioned above.
* If you discover missing features or bugs please note them below. * If you discover missing features or bugs please note them below.
@ -43,11 +43,11 @@
* *
* IMPLEMENTATION NOTES: * IMPLEMENTATION NOTES:
* This control uses WM_NCPAINT instead of WM_PAINT to paint itself * This control uses WM_NCPAINT instead of WM_PAINT to paint itself
* as we need to scroll a child window. In order to do this we move * as we need to scroll a child window. In order to do this we move
* the child window in the control's client area, using the clipping * the child window in the control's client area, using the clipping
* region that is automatically set around the client area. As the * region that is automatically set around the client area. As the
* entire client area now consists of the child window, we must * entire client area now consists of the child window, we must
* allocate space (WM_NCCALCSIZE) for the buttons and draw them as * allocate space (WM_NCCALCSIZE) for the buttons and draw them as
* a non-client area (WM_NCPAINT). * a non-client area (WM_NCPAINT).
* Robert Shearman <rob@codeweavers.com> * Robert Shearman <rob@codeweavers.com>
*/ */
@ -493,7 +493,7 @@ PAGER_UpdateBtns(PAGER_INFO *infoPtr, INT scrollRange, BOOL hideGrayBtns)
SWP_NOZORDER | SWP_NOACTIVATE); SWP_NOZORDER | SWP_NOACTIVATE);
/* repaint when changing any state */ /* repaint when changing any state */
repaintBtns = (oldTLbtnState != infoPtr->TLbtnState) || repaintBtns = (oldTLbtnState != infoPtr->TLbtnState) ||
(oldBRbtnState != infoPtr->BRbtnState); (oldBRbtnState != infoPtr->BRbtnState);
if (repaintBtns) if (repaintBtns)
SendMessageW(infoPtr->hwndSelf, WM_NCPAINT, 0, 0); SendMessageW(infoPtr->hwndSelf, WM_NCPAINT, 0, 0);
@ -1236,7 +1236,7 @@ PAGER_Size (PAGER_INFO* infoPtr, INT type, INT x, INT y)
} }
static LRESULT static LRESULT
PAGER_StyleChanged(PAGER_INFO *infoPtr, WPARAM wStyleType, const STYLESTRUCT *lpss) PAGER_StyleChanged(PAGER_INFO *infoPtr, WPARAM wStyleType, const STYLESTRUCT *lpss)
{ {
DWORD oldStyle = infoPtr->dwStyle; DWORD oldStyle = infoPtr->dwStyle;
@ -1245,7 +1245,7 @@ PAGER_StyleChanged(PAGER_INFO *infoPtr, WPARAM wStyleType, const STYLESTRUCT *lp
wStyleType, lpss->styleOld, lpss->styleNew); wStyleType, lpss->styleOld, lpss->styleNew);
if (wStyleType != GWL_STYLE) return 0; if (wStyleType != GWL_STYLE) return 0;
infoPtr->dwStyle = lpss->styleNew; infoPtr->dwStyle = lpss->styleNew;
if ((oldStyle ^ lpss->styleNew) & (PGS_HORZ | PGS_VERT)) if ((oldStyle ^ lpss->styleNew) & (PGS_HORZ | PGS_VERT))

View file

@ -19,10 +19,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
* *
* NOTE * NOTE
* *
* This code was audited for completeness against the documented features * This code was audited for completeness against the documented features
* of Comctl32.dll version 6.0 on Sep. 9, 2002, by Dimitrie O. Paun. * of Comctl32.dll version 6.0 on Sep. 9, 2002, by Dimitrie O. Paun.
* *
* Unless otherwise noted, we believe this code to be complete, as per * Unless otherwise noted, we believe this code to be complete, as per
* the specification mentioned above. * the specification mentioned above.
* If you discover missing features, or bugs, please note them below. * If you discover missing features, or bugs, please note them below.
@ -364,12 +364,12 @@ static LRESULT PROGRESS_Draw (PROGRESS_INFO *infoPtr, HDC hdc)
{ {
RECT cntRect; RECT cntRect;
int part = (dwStyle & PBS_VERTICAL) ? PP_BARVERT : PP_BAR; int part = (dwStyle & PBS_VERTICAL) ? PP_BARVERT : PP_BAR;
GetThemeBackgroundContentRect (pdi.theme, hdc, part, 0, &pdi.rect, GetThemeBackgroundContentRect (pdi.theme, hdc, part, 0, &pdi.rect,
&cntRect); &cntRect);
/* Exclude content rect - content background will be drawn later */ /* Exclude content rect - content background will be drawn later */
ExcludeClipRect (hdc, cntRect.left, cntRect.top, ExcludeClipRect (hdc, cntRect.left, cntRect.top,
cntRect.right, cntRect.bottom); cntRect.right, cntRect.bottom);
if (IsThemeBackgroundPartiallyTransparent (pdi.theme, part, 0)) if (IsThemeBackgroundPartiallyTransparent (pdi.theme, part, 0))
DrawThemeParentBackground (infoPtr->Self, hdc, NULL); DrawThemeParentBackground (infoPtr->Self, hdc, NULL);
@ -402,7 +402,7 @@ static LRESULT PROGRESS_Draw (PROGRESS_INFO *infoPtr, HDC hdc)
if (ledMEnd > leds) if (ledMEnd > leds)
{ {
/* case 1: the marquee bar extends over the end and wraps around to /* case 1: the marquee bar extends over the end and wraps around to
* the start */ * the start */
const int gapStart = max((ledMEnd - leds) * ledW, 0); const int gapStart = max((ledMEnd - leds) * ledW, 0);
const int gapEnd = min(infoPtr->MarqueePos * ledW, barSize); const int gapEnd = min(infoPtr->MarqueePos * ledW, barSize);
@ -475,12 +475,12 @@ static LRESULT PROGRESS_Timer (PROGRESS_INFO *infoPtr, INT idTimer)
get_client_rect (infoPtr->Self, &rect); get_client_rect (infoPtr->Self, &rect);
if(!barSmooth) if(!barSmooth)
ledWidth = get_led_size( infoPtr, style, &rect ) + ledWidth = get_led_size( infoPtr, style, &rect ) +
get_led_gap( infoPtr ); get_led_gap( infoPtr );
else else
ledWidth = 1; ledWidth = 1;
leds = (get_bar_size( style, &rect ) + ledWidth - 1) / leds = (get_bar_size( style, &rect ) + ledWidth - 1) /
ledWidth; ledWidth;
/* increment the marquee progress */ /* increment the marquee progress */
@ -556,7 +556,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
case WM_CREATE: case WM_CREATE:
{ {
DWORD dwExStyle = GetWindowLongW (hwnd, GWL_EXSTYLE); DWORD dwExStyle = GetWindowLongW (hwnd, GWL_EXSTYLE);
theme = OpenThemeData (hwnd, themeClass); theme = OpenThemeData (hwnd, themeClass);
dwExStyle &= ~(WS_EX_CLIENTEDGE | WS_EX_WINDOWEDGE); dwExStyle &= ~(WS_EX_CLIENTEDGE | WS_EX_WINDOWEDGE);
@ -614,18 +614,18 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
case WM_THEMECHANGED: case WM_THEMECHANGED:
{ {
DWORD dwExStyle = GetWindowLongW (hwnd, GWL_EXSTYLE); DWORD dwExStyle = GetWindowLongW (hwnd, GWL_EXSTYLE);
theme = GetWindowTheme (hwnd); theme = GetWindowTheme (hwnd);
CloseThemeData (theme); CloseThemeData (theme);
theme = OpenThemeData (hwnd, themeClass); theme = OpenThemeData (hwnd, themeClass);
/* WS_EX_STATICEDGE disappears when the control is themed */ /* WS_EX_STATICEDGE disappears when the control is themed */
if (theme) if (theme)
dwExStyle &= ~WS_EX_STATICEDGE; dwExStyle &= ~WS_EX_STATICEDGE;
else else
dwExStyle |= WS_EX_STATICEDGE; dwExStyle |= WS_EX_STATICEDGE;
SetWindowLongW (hwnd, GWL_EXSTYLE, dwExStyle); SetWindowLongW (hwnd, GWL_EXSTYLE, dwExStyle);
InvalidateRect (hwnd, NULL, FALSE); InvalidateRect (hwnd, NULL, FALSE);
return 0; return 0;
} }

View file

@ -22,7 +22,7 @@
* *
* This code was audited for completeness against the documented features * This code was audited for completeness against the documented features
* of Comctl32.dll version 6.0 on Sep. 12, 2004, by Filip Navara. * of Comctl32.dll version 6.0 on Sep. 12, 2004, by Filip Navara.
* *
* Unless otherwise noted, we believe this code to be complete, as per * Unless otherwise noted, we believe this code to be complete, as per
* the specification mentioned above. * the specification mentioned above.
* If you discover missing features, or bugs, please note them below. * If you discover missing features, or bugs, please note them below.
@ -157,7 +157,7 @@ static const WCHAR PropSheetInfoStr[] =
/* Wizard metrics specified in DLUs */ /* Wizard metrics specified in DLUs */
#define WIZARD_PADDING 7 #define WIZARD_PADDING 7
#define WIZARD_HEADER_HEIGHT 36 #define WIZARD_HEADER_HEIGHT 36
/****************************************************************************** /******************************************************************************
* Prototypes * Prototypes
*/ */
@ -212,7 +212,7 @@ static VOID PROPSHEET_UnImplementedFlags(DWORD dwFlags)
static void PROPSHEET_GetPageRect(const PropSheetInfo * psInfo, HWND hwndDlg, static void PROPSHEET_GetPageRect(const PropSheetInfo * psInfo, HWND hwndDlg,
RECT *rc, LPCPROPSHEETPAGEW ppshpage) RECT *rc, LPCPROPSHEETPAGEW ppshpage)
{ {
if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD) { if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD) {
HWND hwndChild; HWND hwndChild;
RECT r; RECT r;
@ -990,7 +990,7 @@ static BOOL PROPSHEET_AdjustButtonsWizard(HWND hwndParent,
* All buttons will be at this y coordinate. * All buttons will be at this y coordinate.
*/ */
y = rcSheet.bottom - (padding.y + buttonHeight); y = rcSheet.bottom - (padding.y + buttonHeight);
/* /*
* Position the Back button. * Position the Back button.
*/ */
@ -1005,9 +1005,9 @@ static BOOL PROPSHEET_AdjustButtonsWizard(HWND hwndParent,
* Position the Next button. * Position the Next button.
*/ */
hwndButton = GetDlgItem(hwndParent, IDC_NEXT_BUTTON); hwndButton = GetDlgItem(hwndParent, IDC_NEXT_BUTTON);
x += buttonWidth; x += buttonWidth;
SetWindowPos(hwndButton, 0, x, y, 0, 0, SetWindowPos(hwndButton, 0, x, y, 0, 0,
SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE); SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
@ -1015,7 +1015,7 @@ static BOOL PROPSHEET_AdjustButtonsWizard(HWND hwndParent,
* Position the Finish button. * Position the Finish button.
*/ */
hwndButton = GetDlgItem(hwndParent, IDC_FINISH_BUTTON); hwndButton = GetDlgItem(hwndParent, IDC_FINISH_BUTTON);
if (psInfo->hasFinish) if (psInfo->hasFinish)
x += padding.x + buttonWidth; x += padding.x + buttonWidth;
@ -1051,7 +1051,7 @@ static BOOL PROPSHEET_AdjustButtonsWizard(HWND hwndParent,
ShowWindow(hwndButton, SW_HIDE); ShowWindow(hwndButton, SW_HIDE);
if (psInfo->ppshheader.dwFlags & if (psInfo->ppshheader.dwFlags &
(PSH_WIZARD97_OLD | PSH_WIZARD97_NEW | PSH_WIZARD_LITE)) (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW | PSH_WIZARD_LITE))
padding.x = 0; padding.x = 0;
/* /*
@ -1067,7 +1067,7 @@ static BOOL PROPSHEET_AdjustButtonsWizard(HWND hwndParent,
/* /*
* Position and resize the header sunken line. * Position and resize the header sunken line.
*/ */
SetWindowPos(hwndLineHeader, 0, 0, 0, rcSheet.right, 2, SetWindowPos(hwndLineHeader, 0, 0, 0, rcSheet.right, 2,
SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE); SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);
if (!(psInfo->ppshheader.dwFlags & (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW))) if (!(psInfo->ppshheader.dwFlags & (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW)))
@ -1327,10 +1327,10 @@ static UINT GetTemplateSize(const DLGTEMPLATE* pTemplate)
while (nrofitems > 0) while (nrofitems > 0)
{ {
p = (WORD*)(((DWORD_PTR)p + 3) & ~3); /* DWORD align */ p = (WORD*)(((DWORD_PTR)p + 3) & ~3); /* DWORD align */
/* skip header */ /* skip header */
p += (istemplateex ? sizeof(MyDLGITEMTEMPLATEEX) : sizeof(DLGITEMTEMPLATE))/sizeof(WORD); p += (istemplateex ? sizeof(MyDLGITEMTEMPLATEEX) : sizeof(DLGITEMTEMPLATE))/sizeof(WORD);
/* check class */ /* check class */
switch ((WORD)*p) switch ((WORD)*p)
{ {
@ -1365,7 +1365,7 @@ static UINT GetTemplateSize(const DLGTEMPLATE* pTemplate)
p += *p / sizeof(WORD) + 1; /* Skip extra data */ p += *p / sizeof(WORD) + 1; /* Skip extra data */
--nrofitems; --nrofitems;
} }
ret = (p - (const WORD*)pTemplate) * sizeof(WORD); ret = (p - (const WORD*)pTemplate) * sizeof(WORD);
TRACE("%p %p size 0x%08x\n", p, pTemplate, ret); TRACE("%p %p size 0x%08x\n", p, pTemplate, ret);
return ret; return ret;
@ -1445,7 +1445,7 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
temp = Alloc(resSize); temp = Alloc(resSize);
if (!temp) if (!temp)
return FALSE; return FALSE;
TRACE("copying pTemplate %p into temp %p (%d)\n", pTemplate, temp, resSize); TRACE("copying pTemplate %p into temp %p (%d)\n", pTemplate, temp, resSize);
memcpy(temp, pTemplate, resSize); memcpy(temp, pTemplate, resSize);
pTemplate = temp; pTemplate = temp;
@ -1521,13 +1521,13 @@ static VOID PROPSHEET_LoadWizardBitmaps(PropSheetInfo *psInfo)
{ {
if (psInfo->ppshheader.dwFlags & (PSH_WIZARD97_NEW | PSH_WIZARD97_OLD)) if (psInfo->ppshheader.dwFlags & (PSH_WIZARD97_NEW | PSH_WIZARD97_OLD))
{ {
/* if PSH_USEHBMWATERMARK is not set, load the resource from pszbmWatermark /* if PSH_USEHBMWATERMARK is not set, load the resource from pszbmWatermark
and put the HBITMAP in hbmWatermark. Thus all the rest of the code always and put the HBITMAP in hbmWatermark. Thus all the rest of the code always
considers hbmWatermark as valid. */ considers hbmWatermark as valid. */
if ((psInfo->ppshheader.dwFlags & PSH_WATERMARK) && if ((psInfo->ppshheader.dwFlags & PSH_WATERMARK) &&
!(psInfo->ppshheader.dwFlags & PSH_USEHBMWATERMARK)) !(psInfo->ppshheader.dwFlags & PSH_USEHBMWATERMARK))
{ {
((PropSheetInfo *)psInfo)->ppshheader.u4.hbmWatermark = ((PropSheetInfo *)psInfo)->ppshheader.u4.hbmWatermark =
CreateMappedBitmap(psInfo->ppshheader.hInstance, (INT_PTR)psInfo->ppshheader.u4.pszbmWatermark, 0, NULL, 0); CreateMappedBitmap(psInfo->ppshheader.hInstance, (INT_PTR)psInfo->ppshheader.u4.pszbmWatermark, 0, NULL, 0);
} }
@ -1535,7 +1535,7 @@ static VOID PROPSHEET_LoadWizardBitmaps(PropSheetInfo *psInfo)
if ((psInfo->ppshheader.dwFlags & PSH_HEADER) && if ((psInfo->ppshheader.dwFlags & PSH_HEADER) &&
!(psInfo->ppshheader.dwFlags & PSH_USEHBMHEADER)) !(psInfo->ppshheader.dwFlags & PSH_USEHBMHEADER))
{ {
((PropSheetInfo *)psInfo)->ppshheader.u5.hbmHeader = ((PropSheetInfo *)psInfo)->ppshheader.u5.hbmHeader =
CreateMappedBitmap(psInfo->ppshheader.hInstance, (INT_PTR)psInfo->ppshheader.u5.pszbmHeader, 0, NULL, 0); CreateMappedBitmap(psInfo->ppshheader.hInstance, (INT_PTR)psInfo->ppshheader.u5.pszbmHeader, 0, NULL, 0);
} }
} }
@ -1590,7 +1590,7 @@ static BOOL PROPSHEET_ShowPage(HWND hwndDlg, int index, PropSheetInfo * psInfo)
{ {
hwndLineHeader = GetDlgItem(hwndDlg, IDC_SUNKEN_LINEHEADER); hwndLineHeader = GetDlgItem(hwndDlg, IDC_SUNKEN_LINEHEADER);
ppshpage = (LPCPROPSHEETPAGEW)psInfo->proppage[index].hpage; ppshpage = (LPCPROPSHEETPAGEW)psInfo->proppage[index].hpage;
if ((ppshpage->dwFlags & PSP_HIDEHEADER) || (!(psInfo->ppshheader.dwFlags & PSH_HEADER)) ) if ((ppshpage->dwFlags & PSP_HIDEHEADER) || (!(psInfo->ppshheader.dwFlags & PSH_HEADER)) )
ShowWindow(hwndLineHeader, SW_HIDE); ShowWindow(hwndLineHeader, SW_HIDE);
else else
@ -2447,7 +2447,7 @@ EnumChildProc(HWND hwnd, LPARAM lParam)
SetFocus(hwnd); SetFocus(hwnd);
return FALSE; return FALSE;
} }
} }
else else
{ {
EnumChildWindows(hwnd, EnumChildProc, 0); EnumChildWindows(hwnd, EnumChildProc, 0);
@ -2490,7 +2490,7 @@ static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags)
{ {
/* Hide the Next button */ /* Hide the Next button */
ShowWindow(hwndNext, SW_HIDE); ShowWindow(hwndNext, SW_HIDE);
/* Show the Finish button */ /* Show the Finish button */
ShowWindow(hwndFinish, SW_SHOW); ShowWindow(hwndFinish, SW_SHOW);
@ -2532,7 +2532,7 @@ static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags)
/* Now try to find an edit control that deserves focus */ /* Now try to find an edit control that deserves focus */
EnumChildWindows(PropSheet_GetCurrentPageHwnd(hwndDlg), EnumChildProc, 0); EnumChildWindows(PropSheet_GetCurrentPageHwnd(hwndDlg), EnumChildProc, 0);
} }
/****************************************************************************** /******************************************************************************
@ -3276,12 +3276,12 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
hdcSrc = CreateCompatibleDC(0); hdcSrc = CreateCompatibleDC(0);
ppshpage = (LPCPROPSHEETPAGEW)psInfo->proppage[psInfo->active_page].hpage; ppshpage = (LPCPROPSHEETPAGEW)psInfo->proppage[psInfo->active_page].hpage;
if (psInfo->ppshheader.dwFlags & PSH_USEHPLWATERMARK) if (psInfo->ppshheader.dwFlags & PSH_USEHPLWATERMARK)
hOldPal = SelectPalette(hdc, psInfo->ppshheader.hplWatermark, FALSE); hOldPal = SelectPalette(hdc, psInfo->ppshheader.hplWatermark, FALSE);
if ( (!(ppshpage->dwFlags & PSP_HIDEHEADER)) && if ( (!(ppshpage->dwFlags & PSP_HIDEHEADER)) &&
(psInfo->ppshheader.dwFlags & (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW)) && (psInfo->ppshheader.dwFlags & (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW)) &&
(psInfo->ppshheader.dwFlags & PSH_HEADER) ) (psInfo->ppshheader.dwFlags & PSH_HEADER) )
{ {
HWND hwndLineHeader = GetDlgItem(hwnd, IDC_SUNKEN_LINEHEADER); HWND hwndLineHeader = GetDlgItem(hwnd, IDC_SUNKEN_LINEHEADER);
HFONT hOldFont; HFONT hOldFont;
@ -3295,7 +3295,7 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
MapWindowPoints(hwndLineHeader, hwnd, (LPPOINT) &r, 2); MapWindowPoints(hwndLineHeader, hwnd, (LPPOINT) &r, 2);
SetRect(&rzone, 0, 0, r.right + 1, r.top - 1); SetRect(&rzone, 0, 0, r.right + 1, r.top - 1);
GetObjectW(psInfo->ppshheader.u5.hbmHeader, sizeof(BITMAP), (LPVOID)&bm); GetObjectW(psInfo->ppshheader.u5.hbmHeader, sizeof(BITMAP), (LPVOID)&bm);
if (psInfo->ppshheader.dwFlags & PSH_WIZARD97_OLD) if (psInfo->ppshheader.dwFlags & PSH_WIZARD97_OLD)
{ {
@ -3345,7 +3345,7 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
} }
clrOld = SetTextColor (hdc, 0x00000000); clrOld = SetTextColor (hdc, 0x00000000);
oldBkMode = SetBkMode (hdc, TRANSPARENT); oldBkMode = SetBkMode (hdc, TRANSPARENT);
if (ppshpage->dwFlags & PSP_USEHEADERTITLE) { if (ppshpage->dwFlags & PSP_USEHEADERTITLE) {
SetRect(&r, 20, 10, 0, 0); SetRect(&r, 20, 10, 0, 0);
@ -3388,9 +3388,9 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
if ( (ppshpage->dwFlags & PSP_HIDEHEADER) && if ( (ppshpage->dwFlags & PSP_HIDEHEADER) &&
(psInfo->ppshheader.dwFlags & (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW)) && (psInfo->ppshheader.dwFlags & (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW)) &&
(psInfo->ppshheader.dwFlags & PSH_WATERMARK) ) (psInfo->ppshheader.dwFlags & PSH_WATERMARK) )
{ {
HWND hwndLine = GetDlgItem(hwnd, IDC_SUNKEN_LINE); HWND hwndLine = GetDlgItem(hwnd, IDC_SUNKEN_LINE);
GetClientRect(hwndLine, &r); GetClientRect(hwndLine, &r);
MapWindowPoints(hwndLine, hwnd, (LPPOINT) &r, 2); MapWindowPoints(hwndLine, hwnd, (LPPOINT) &r, 2);
@ -3423,10 +3423,10 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
DeleteObject(hbr); DeleteObject(hbr);
} }
SelectObject(hdcSrc, hbmp); SelectObject(hdcSrc, hbmp);
} }
if (psInfo->ppshheader.dwFlags & PSH_USEHPLWATERMARK) if (psInfo->ppshheader.dwFlags & PSH_USEHPLWATERMARK)
SelectPalette(hdc, hOldPal, FALSE); SelectPalette(hdc, hOldPal, FALSE);
DeleteDC(hdcSrc); DeleteDC(hdcSrc);
@ -3478,7 +3478,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
psInfo->hFont = CreateFontIndirectW (&logFont); psInfo->hFont = CreateFontIndirectW (&logFont);
logFont.lfWeight = FW_BOLD; logFont.lfWeight = FW_BOLD;
psInfo->hFontBold = CreateFontIndirectW (&logFont); psInfo->hFontBold = CreateFontIndirectW (&logFont);
/* /*
* Small icon in the title bar. * Small icon in the title bar.
*/ */
@ -3612,7 +3612,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return FALSE; return FALSE;
} }
case WM_SYSCOLORCHANGE: case WM_SYSCOLORCHANGE:
COMCTL32_RefreshSysColors(); COMCTL32_RefreshSysColors();
return FALSE; return FALSE;

View file

@ -21,7 +21,7 @@
* *
* This code was audited for completeness against the documented features * This code was audited for completeness against the documented features
* of Comctl32.dll version 6.0 on Oct. 19, 2004, by Robert Shearman. * of Comctl32.dll version 6.0 on Oct. 19, 2004, by Robert Shearman.
* *
* Unless otherwise noted, we believe this code to be complete, as per * Unless otherwise noted, we believe this code to be complete, as per
* the specification mentioned above. * the specification mentioned above.
* If you discover missing features or bugs please note them below. * If you discover missing features or bugs please note them below.
@ -430,7 +430,7 @@ static void translate_rect(const REBAR_INFO *infoPtr, RECT *dest, const RECT *sr
tmp = src->left; tmp = src->left;
dest->left = src->top; dest->left = src->top;
dest->top = tmp; dest->top = tmp;
tmp = src->right; tmp = src->right;
dest->right = src->bottom; dest->right = src->bottom;
dest->bottom = tmp; dest->bottom = tmp;
@ -626,7 +626,7 @@ REBAR_DrawBand (HDC hdc, const REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
{ {
if (theme) if (theme)
{ {
int stateId; int stateId;
if (lpBand->fDraw & DRAW_CHEVRONPUSHED) if (lpBand->fDraw & DRAW_CHEVRONPUSHED)
stateId = CHEVS_PRESSED; stateId = CHEVS_PRESSED;
else if (lpBand->fDraw & DRAW_CHEVRONHOT) else if (lpBand->fDraw & DRAW_CHEVRONHOT)
@ -1568,8 +1568,8 @@ REBAR_CommonSetupBand(HWND hwnd, const REBARBANDINFOW *lprbbi, REBAR_BAND *lpBan
(lpBand->cyMaxChild != lprbbi->cyMaxChild ) || (lpBand->cyMaxChild != lprbbi->cyMaxChild ) ||
(lpBand->cyIntegral != lprbbi->cyIntegral ) ) ) || (lpBand->cyIntegral != lprbbi->cyIntegral ) ) ) ||
( (lprbbi->cbSize < sizeof (REBARBANDINFOA)) && ( (lprbbi->cbSize < sizeof (REBARBANDINFOA)) &&
( (lpBand->cyChild || ( (lpBand->cyChild ||
lpBand->cyMaxChild || lpBand->cyMaxChild ||
lpBand->cyIntegral ) ) ) ) ) lpBand->cyIntegral ) ) ) ) )
{ {
lpBand->cxMinChild = lprbbi->cxMinChild; lpBand->cxMinChild = lprbbi->cxMinChild;
@ -2510,7 +2510,7 @@ REBAR_SetBandInfoT(REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, BOOL bUnic
else else
Str_SetPtrAtoW(&wstr, (LPSTR)lprbbi->lpText); Str_SetPtrAtoW(&wstr, (LPSTR)lprbbi->lpText);
if (REBAR_strdifW(wstr, lprbbi->lpText)) { if (REBAR_strdifW(wstr, lpBand->lpText)) {
Free(lpBand->lpText); Free(lpBand->lpText);
lpBand->lpText = wstr; lpBand->lpText = wstr;
bChanged = TRUE; bChanged = TRUE;
@ -2725,13 +2725,13 @@ REBAR_Create (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
} }
TRACE("created!\n"); TRACE("created!\n");
if ((theme = OpenThemeData (infoPtr->hwndSelf, themeClass))) if ((theme = OpenThemeData (infoPtr->hwndSelf, themeClass)))
{ {
/* native seems to clear WS_BORDER when themed */ /* native seems to clear WS_BORDER when themed */
infoPtr->dwStyle &= ~WS_BORDER; infoPtr->dwStyle &= ~WS_BORDER;
} }
return 0; return 0;
} }
@ -2767,7 +2767,7 @@ REBAR_Destroy (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
DestroyCursor (infoPtr->hcurDrag); DestroyCursor (infoPtr->hcurDrag);
if(infoPtr->hDefaultFont) DeleteObject (infoPtr->hDefaultFont); if(infoPtr->hDefaultFont) DeleteObject (infoPtr->hDefaultFont);
SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0); SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0);
CloseThemeData (GetWindowTheme (infoPtr->hwndSelf)); CloseThemeData (GetWindowTheme (infoPtr->hwndSelf));
/* free rebar info data */ /* free rebar info data */
@ -3326,7 +3326,7 @@ REBAR_Size (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
infoPtr->fStatus, lParam); infoPtr->fStatus, lParam);
return 0; return 0;
} }
/* FIXME: wrong */ /* FIXME: wrong */
if (infoPtr->dwStyle & RBS_AUTOSIZE) { if (infoPtr->dwStyle & RBS_AUTOSIZE) {
NMRBAUTOSIZE autosize; NMRBAUTOSIZE autosize;

File diff suppressed because it is too large Load diff

View file

@ -20,14 +20,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
* *
* NOTE * NOTE
* *
* This code was audited for completeness against the documented features * This code was audited for completeness against the documented features
* of Comctl32.dll version 6.0 on Sep. 24, 2002, by Dimitrie O. Paun. * of Comctl32.dll version 6.0 on Sep. 24, 2002, by Dimitrie O. Paun.
* *
* Unless otherwise noted, we believe this code to be complete, as per * Unless otherwise noted, we believe this code to be complete, as per
* the specification mentioned above. * the specification mentioned above.
* If you discover missing features, or bugs, please note them below. * If you discover missing features, or bugs, please note them below.
* *
* TODO: * TODO:
* -- CCS_BOTTOM (default) * -- CCS_BOTTOM (default)
* -- CCS_LEFT * -- CCS_LEFT
@ -115,13 +115,13 @@ STATUSBAR_DrawSizeGrip (HTHEME theme, HDC hdc, LPRECT lpRect)
INT i; INT i;
TRACE("draw size grip %d,%d - %d,%d\n", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom); TRACE("draw size grip %d,%d - %d,%d\n", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);
if (theme) if (theme)
{ {
RECT gripperRect; RECT gripperRect;
SIZE gripperSize; SIZE gripperSize;
gripperRect = *lpRect; gripperRect = *lpRect;
if (SUCCEEDED (GetThemePartSize (theme, hdc, SP_GRIPPER, 0, lpRect, if (SUCCEEDED (GetThemePartSize (theme, hdc, SP_GRIPPER, 0, lpRect,
TS_DRAW, &gripperSize))) TS_DRAW, &gripperSize)))
{ {
gripperRect.left = gripperRect.right - gripperSize.cx; gripperRect.left = gripperRect.right - gripperSize.cx;
@ -633,9 +633,8 @@ STATUSBAR_SetMinHeight (STATUS_INFO *infoPtr, INT height)
RECT parent_rect; RECT parent_rect;
HTHEME theme; HTHEME theme;
GetClientRect (infoPtr->Notify, &parent_rect);
infoPtr->height = height + infoPtr->verticalBorder; infoPtr->height = height + infoPtr->verticalBorder;
if ((theme = GetWindowTheme (infoPtr->Self))) if ((theme = GetWindowTheme (infoPtr->Self)))
{ {
/* Determine bar height from theme such that the content area is /* Determine bar height from theme such that the content area is
@ -650,14 +649,15 @@ STATUSBAR_SetMinHeight (STATUS_INFO *infoPtr, INT height)
} }
ReleaseDC (infoPtr->Self, hdc); ReleaseDC (infoPtr->Self, hdc);
} }
width = parent_rect.right - parent_rect.left; if (GetClientRect (infoPtr->Notify, &parent_rect))
x = parent_rect.left; {
y = parent_rect.bottom - infoPtr->height; width = parent_rect.right - parent_rect.left;
MoveWindow (infoPtr->Self, parent_rect.left, x = parent_rect.left;
parent_rect.bottom - infoPtr->height, y = parent_rect.bottom - infoPtr->height;
width, infoPtr->height, TRUE); MoveWindow (infoPtr->Self, x, y, width, infoPtr->height, TRUE);
STATUSBAR_SetPartBounds (infoPtr); STATUSBAR_SetPartBounds (infoPtr);
}
} }
return TRUE; return TRUE;
@ -958,7 +958,7 @@ STATUSBAR_WMCreate (HWND hwnd, const CREATESTRUCTA *lpCreate)
infoPtr->parts[0].x = -1; infoPtr->parts[0].x = -1;
infoPtr->parts[0].style = 0; infoPtr->parts[0].style = 0;
infoPtr->parts[0].hIcon = 0; infoPtr->parts[0].hIcon = 0;
OpenThemeData (hwnd, themeClass); OpenThemeData (hwnd, themeClass);
if (IsWindowUnicode (hwnd)) { if (IsWindowUnicode (hwnd)) {
@ -1029,7 +1029,7 @@ STATUSBAR_WMCreate (HWND hwnd, const CREATESTRUCTA *lpCreate)
GetClientRect (infoPtr->Notify, &rect); GetClientRect (infoPtr->Notify, &rect);
width = rect.right - rect.left; width = rect.right - rect.left;
infoPtr->height = textHeight + 4 + infoPtr->verticalBorder; infoPtr->height = textHeight + 4 + infoPtr->verticalBorder;
if ((theme = GetWindowTheme (hwnd))) if ((theme = GetWindowTheme (hwnd)))
{ {
/* Determine bar height from theme such that the content area is /* Determine bar height from theme such that the content area is
@ -1044,7 +1044,7 @@ STATUSBAR_WMCreate (HWND hwnd, const CREATESTRUCTA *lpCreate)
} }
ReleaseDC (hwnd, hdc); ReleaseDC (hwnd, hdc);
} }
SetWindowPos(hwnd, 0, lpCreate->x, lpCreate->y - 1, SetWindowPos(hwnd, 0, lpCreate->x, lpCreate->y - 1,
width, infoPtr->height, SWP_NOZORDER); width, infoPtr->height, SWP_NOZORDER);
STATUSBAR_SetPartBounds (infoPtr); STATUSBAR_SetPartBounds (infoPtr);
@ -1191,13 +1191,13 @@ STATUSBAR_WMSize (STATUS_INFO *infoPtr, WORD flags)
if (GetWindowLongW(infoPtr->Self, GWL_STYLE) & CCS_NORESIZE) return FALSE; if (GetWindowLongW(infoPtr->Self, GWL_STYLE) & CCS_NORESIZE) return FALSE;
/* width and height don't apply */ /* width and height don't apply */
GetClientRect (infoPtr->Notify, &parent_rect); if (!GetClientRect (infoPtr->Notify, &parent_rect))
return FALSE;
width = parent_rect.right - parent_rect.left; width = parent_rect.right - parent_rect.left;
x = parent_rect.left; x = parent_rect.left;
y = parent_rect.bottom - infoPtr->height; y = parent_rect.bottom - infoPtr->height;
MoveWindow (infoPtr->Self, parent_rect.left, MoveWindow (infoPtr->Self, x, y, width, infoPtr->height, TRUE);
parent_rect.bottom - infoPtr->height,
width, infoPtr->height, TRUE);
STATUSBAR_SetPartBounds (infoPtr); STATUSBAR_SetPartBounds (infoPtr);
return TRUE; return TRUE;
} }

View file

@ -680,9 +680,9 @@ LPSTR WINAPI StrRStrIA(LPCSTR lpszStr, LPCSTR lpszEnd, LPCSTR lpszSearch)
LPSTR lpszRet = NULL; LPSTR lpszRet = NULL;
WORD ch1, ch2; WORD ch1, ch2;
INT iLen; INT iLen;
TRACE("(%s,%s)\n", debugstr_a(lpszStr), debugstr_a(lpszSearch)); TRACE("(%s,%s)\n", debugstr_a(lpszStr), debugstr_a(lpszSearch));
if (!lpszStr || !lpszSearch || !*lpszSearch) if (!lpszStr || !lpszSearch || !*lpszSearch)
return NULL; return NULL;

View file

@ -21,7 +21,7 @@
* *
* This code was audited for completeness against the documented features * This code was audited for completeness against the documented features
* of Comctl32.dll version 6.0 on Apr. 4, 2005, by Dimitrie O. Paun. * of Comctl32.dll version 6.0 on Apr. 4, 2005, by Dimitrie O. Paun.
* *
* Unless otherwise noted, we believe this code to be complete, as per * Unless otherwise noted, we believe this code to be complete, as per
* the specification mentioned above. * the specification mentioned above.
* If you discover missing features, or bugs, please note them below. * If you discover missing features, or bugs, please note them below.
@ -148,7 +148,7 @@ static PDOC_ITEM SYSLINK_AppendDocItem (SYSLINK_INFO *infoPtr, LPCWSTR Text, UIN
Item->nText = textlen; Item->nText = textlen;
Item->Type = type; Item->Type = type;
Item->Blocks = NULL; Item->Blocks = NULL;
if(LastItem != NULL) if(LastItem != NULL)
{ {
LastItem->Next = Item; LastItem->Next = Item;
@ -157,9 +157,9 @@ static PDOC_ITEM SYSLINK_AppendDocItem (SYSLINK_INFO *infoPtr, LPCWSTR Text, UIN
{ {
infoPtr->Items = Item; infoPtr->Items = Item;
} }
lstrcpynW(Item->Text, Text, textlen + 1); lstrcpynW(Item->Text, Text, textlen + 1);
return Item; return Item;
} }
@ -170,7 +170,7 @@ static PDOC_ITEM SYSLINK_AppendDocItem (SYSLINK_INFO *infoPtr, LPCWSTR Text, UIN
static VOID SYSLINK_ClearDoc (SYSLINK_INFO *infoPtr) static VOID SYSLINK_ClearDoc (SYSLINK_INFO *infoPtr)
{ {
PDOC_ITEM Item, Next; PDOC_ITEM Item, Next;
Item = infoPtr->Items; Item = infoPtr->Items;
while(Item != NULL) while(Item != NULL)
{ {
@ -178,7 +178,7 @@ static VOID SYSLINK_ClearDoc (SYSLINK_INFO *infoPtr)
SYSLINK_FreeDocItem(Item); SYSLINK_FreeDocItem(Item);
Item = Next; Item = Next;
} }
infoPtr->Items = NULL; infoPtr->Items = NULL;
} }
@ -225,7 +225,7 @@ static UINT SYSLINK_ParseText (SYSLINK_INFO *infoPtr, LPCWSTR Text)
tmp = current + taglen; tmp = current + taglen;
lpID = NULL; lpID = NULL;
lpUrl = NULL; lpUrl = NULL;
CheckParameter: CheckParameter:
/* compare the current position with all known parameters */ /* compare the current position with all known parameters */
if(!StrCmpNIW(tmp, SL_HREF, 6)) if(!StrCmpNIW(tmp, SL_HREF, 6))
@ -246,7 +246,7 @@ CheckParameter:
{ {
ValidParam = FALSE; ValidParam = FALSE;
} }
if(ValidParam) if(ValidParam)
{ {
/* we got a known parameter, now search until the next " character. /* we got a known parameter, now search until the next " character.
@ -290,7 +290,7 @@ CheckParameter:
tmp++; tmp++;
} }
} }
if(ValidLink && ValidParam) if(ValidLink && ValidParam)
{ {
/* the <a ...> tag appears to be valid. save all information /* the <a ...> tag appears to be valid. save all information
@ -326,7 +326,7 @@ CheckParameter:
textstart = NULL; textstart = NULL;
textlen = 0; textlen = 0;
} }
/* now it's time to add the link to the document */ /* now it's time to add the link to the document */
current += 4; current += 4;
if(linktext != NULL && linklen > 0) if(linktext != NULL && linklen > 0)
@ -389,7 +389,7 @@ CheckParameter:
textstart = current; textstart = current;
} }
} }
textlen += taglen; textlen += taglen;
current += taglen; current += taglen;
} }
@ -403,11 +403,11 @@ CheckParameter:
{ {
textstart = current; textstart = current;
} }
current++; current++;
} }
} }
if(textstart != NULL && textlen > 0) if(textstart != NULL && textlen > 0)
{ {
Last = SYSLINK_AppendDocItem(infoPtr, textstart, textlen, CurrentType, Last); Last = SYSLINK_AppendDocItem(infoPtr, textstart, textlen, CurrentType, Last);
@ -482,12 +482,12 @@ static VOID SYSLINK_RepaintLink (const SYSLINK_INFO *infoPtr, const DOC_ITEM *Do
ERR("DocItem not a link!\n"); ERR("DocItem not a link!\n");
return; return;
} }
bl = DocItem->Blocks; bl = DocItem->Blocks;
if (bl != NULL) if (bl != NULL)
{ {
n = DocItem->nText; n = DocItem->nText;
while(n > 0) while(n > 0)
{ {
InvalidateRect(infoPtr->Self, &bl->rc, TRUE); InvalidateRect(infoPtr->Self, &bl->rc, TRUE);
@ -570,7 +570,7 @@ static PDOC_ITEM SYSLINK_GetPrevLink (const SYSLINK_INFO *infoPtr, PDOC_ITEM Cur
{ {
/* returns the last link */ /* returns the last link */
PDOC_ITEM Last = NULL; PDOC_ITEM Last = NULL;
for(Current = infoPtr->Items; Current != NULL; Current = Current->Next) for(Current = infoPtr->Items; Current != NULL; Current = Current->Next)
{ {
if(Current->Type == slLink) if(Current->Type == slLink)
@ -584,7 +584,7 @@ static PDOC_ITEM SYSLINK_GetPrevLink (const SYSLINK_INFO *infoPtr, PDOC_ITEM Cur
{ {
/* returns the previous link */ /* returns the previous link */
PDOC_ITEM Cur, Prev = NULL; PDOC_ITEM Cur, Prev = NULL;
for(Cur = infoPtr->Items; Cur != NULL; Cur = Cur->Next) for(Cur = infoPtr->Items; Cur != NULL; Cur = Cur->Next)
{ {
if(Cur == Current) if(Cur == Current)
@ -617,7 +617,7 @@ static BOOL SYSLINK_WrapLine (HDC hdc, LPWSTR Text, WCHAR BreakChar, int *LineLe
*LineLen = nFit; *LineLen = nFit;
Current = Text + nFit; Current = Text + nFit;
/* check if we're in the middle of a word */ /* check if we're in the middle of a word */
if((*Current) != BreakChar) if((*Current) != BreakChar)
{ {
@ -627,7 +627,7 @@ static BOOL SYSLINK_WrapLine (HDC hdc, LPWSTR Text, WCHAR BreakChar, int *LineLe
Current--; Current--;
(*LineLen)--; (*LineLen)--;
} }
if((*LineLen) == 0) if((*LineLen) == 0)
{ {
Extent->cx = 0; Extent->cx = 0;
@ -661,13 +661,13 @@ static VOID SYSLINK_Render (const SYSLINK_INFO *infoPtr, HDC hdc, PRECT pRect)
rc.right = MAXLONG; rc.right = MAXLONG;
if (rc.bottom - SL_TOPMARGIN < 0) if (rc.bottom - SL_TOPMARGIN < 0)
rc.bottom = MAXLONG; rc.bottom = MAXLONG;
hOldFont = SelectObject(hdc, infoPtr->Font); hOldFont = SelectObject(hdc, infoPtr->Font);
x = SL_LEFTMARGIN; x = SL_LEFTMARGIN;
y = SL_TOPMARGIN; y = SL_TOPMARGIN;
LineHeight = 0; LineHeight = 0;
for(Current = infoPtr->Items; Current != NULL; Current = Current->Next) for(Current = infoPtr->Items; Current != NULL; Current = Current->Next)
{ {
int n, nBlocks; int n, nBlocks;
@ -697,7 +697,7 @@ static VOID SYSLINK_Render (const SYSLINK_INFO *infoPtr, HDC hdc, PRECT pRect)
{ {
SelectObject(hdc, infoPtr->LinkFont); SelectObject(hdc, infoPtr->LinkFont);
} }
while(n > 0) while(n > 0)
{ {
int SkipChars = 0; int SkipChars = 0;
@ -719,7 +719,7 @@ static VOID SYSLINK_Render (const SYSLINK_INFO *infoPtr, HDC hdc, PRECT pRect)
int LineLen = n; int LineLen = n;
BOOL Wrap = FALSE; BOOL Wrap = FALSE;
PDOC_TEXTBLOCK nbl; PDOC_TEXTBLOCK nbl;
if(n != 0) if(n != 0)
{ {
Wrap = SYSLINK_WrapLine(hdc, tx, infoPtr->BreakChar, &LineLen, nFit, &szDim, rc.right - x); Wrap = SYSLINK_WrapLine(hdc, tx, infoPtr->BreakChar, &LineLen, nFit, &szDim, rc.right - x);
@ -756,7 +756,7 @@ static VOID SYSLINK_Render (const SYSLINK_INFO *infoPtr, HDC hdc, PRECT pRect)
} }
} }
} }
nbl = ReAlloc(bl, (nBlocks + 1) * sizeof(DOC_TEXTBLOCK)); nbl = ReAlloc(bl, (nBlocks + 1) * sizeof(DOC_TEXTBLOCK));
if (nbl != NULL) if (nbl != NULL)
{ {
@ -764,7 +764,7 @@ static VOID SYSLINK_Render (const SYSLINK_INFO *infoPtr, HDC hdc, PRECT pRect)
nBlocks++; nBlocks++;
cbl = bl + nBlocks - 1; cbl = bl + nBlocks - 1;
cbl->nChars = LineLen; cbl->nChars = LineLen;
cbl->nSkip = SkipChars; cbl->nSkip = SkipChars;
cbl->rc.left = x; cbl->rc.left = x;
@ -813,7 +813,7 @@ static VOID SYSLINK_Render (const SYSLINK_INFO *infoPtr, HDC hdc, PRECT pRect)
Current->Blocks = bl; Current->Blocks = bl;
} }
} }
SelectObject(hdc, hOldFont); SelectObject(hdc, hOldFont);
pRect->right = pRect->left + szDoc.cx; pRect->right = pRect->left + szDoc.cx;
@ -834,7 +834,7 @@ static LRESULT SYSLINK_Draw (const SYSLINK_INFO *infoPtr, HDC hdc)
hOldFont = SelectObject(hdc, infoPtr->Font); hOldFont = SelectObject(hdc, infoPtr->Font);
OldTextColor = SetTextColor(hdc, infoPtr->TextColor); OldTextColor = SetTextColor(hdc, infoPtr->TextColor);
OldBkColor = SetBkColor(hdc, GetSysColor(COLOR_BTNFACE)); OldBkColor = SetBkColor(hdc, GetSysColor(COLOR_BTNFACE));
GetClientRect(infoPtr->Self, &rc); GetClientRect(infoPtr->Self, &rc);
rc.right -= SL_RIGHTMARGIN + SL_LEFTMARGIN; rc.right -= SL_RIGHTMARGIN + SL_LEFTMARGIN;
rc.bottom -= SL_BOTTOMMARGIN + SL_TOPMARGIN; rc.bottom -= SL_BOTTOMMARGIN + SL_TOPMARGIN;
@ -846,7 +846,7 @@ static LRESULT SYSLINK_Draw (const SYSLINK_INFO *infoPtr, HDC hdc)
int n; int n;
LPWSTR tx; LPWSTR tx;
PDOC_TEXTBLOCK bl; PDOC_TEXTBLOCK bl;
bl = Current->Blocks; bl = Current->Blocks;
if(bl != NULL) if(bl != NULL)
{ {
@ -885,7 +885,7 @@ static LRESULT SYSLINK_Draw (const SYSLINK_INFO *infoPtr, HDC hdc)
SetBkColor(hdc, OldBkColor); SetBkColor(hdc, OldBkColor);
SetTextColor(hdc, OldTextColor); SetTextColor(hdc, OldTextColor);
SelectObject(hdc, hOldFont); SelectObject(hdc, hOldFont);
return 0; return 0;
} }
@ -921,7 +921,7 @@ static HFONT SYSLINK_SetFont (SYSLINK_INFO *infoPtr, HFONT hFont, BOOL bRedraw)
RECT rcClient; RECT rcClient;
HFONT hOldFont = infoPtr->Font; HFONT hOldFont = infoPtr->Font;
infoPtr->Font = hFont; infoPtr->Font = hFont;
/* free the underline font */ /* free the underline font */
if(infoPtr->LinkFont != NULL) if(infoPtr->LinkFont != NULL)
{ {
@ -952,12 +952,12 @@ static HFONT SYSLINK_SetFont (SYSLINK_INFO *infoPtr, HFONT hFont, BOOL bRedraw)
ReleaseDC(infoPtr->Self, hdc); ReleaseDC(infoPtr->Self, hdc);
} }
} }
if(bRedraw) if(bRedraw)
{ {
RedrawWindow(infoPtr->Self, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW); RedrawWindow(infoPtr->Self, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW);
} }
return hOldFont; return hOldFont;
} }
@ -971,12 +971,12 @@ static LRESULT SYSLINK_SetText (SYSLINK_INFO *infoPtr, LPCWSTR Text)
/* clear the document */ /* clear the document */
SYSLINK_ClearDoc(infoPtr); SYSLINK_ClearDoc(infoPtr);
if(Text == NULL || (textlen = lstrlenW(Text)) == 0) if(Text == NULL || (textlen = lstrlenW(Text)) == 0)
{ {
return TRUE; return TRUE;
} }
/* let's parse the string and create a document */ /* let's parse the string and create a document */
if(SYSLINK_ParseText(infoPtr, Text) > 0) if(SYSLINK_ParseText(infoPtr, Text) > 0)
{ {
@ -995,7 +995,7 @@ static LRESULT SYSLINK_SetText (SYSLINK_INFO *infoPtr, LPCWSTR Text)
} }
} }
} }
return TRUE; return TRUE;
} }
@ -1008,7 +1008,7 @@ static LRESULT SYSLINK_SetText (SYSLINK_INFO *infoPtr, LPCWSTR Text)
static PDOC_ITEM SYSLINK_SetFocusLink (const SYSLINK_INFO *infoPtr, const DOC_ITEM *DocItem) static PDOC_ITEM SYSLINK_SetFocusLink (const SYSLINK_INFO *infoPtr, const DOC_ITEM *DocItem)
{ {
PDOC_ITEM Current, PrevFocus = NULL; PDOC_ITEM Current, PrevFocus = NULL;
for(Current = infoPtr->Items; Current != NULL; Current = Current->Next) for(Current = infoPtr->Items; Current != NULL; Current = Current->Next)
{ {
if(Current->Type == slLink) if(Current->Type == slLink)
@ -1017,7 +1017,7 @@ static PDOC_ITEM SYSLINK_SetFocusLink (const SYSLINK_INFO *infoPtr, const DOC_IT
{ {
PrevFocus = Current; PrevFocus = Current;
} }
if(Current == DocItem) if(Current == DocItem)
{ {
Current->u.Link.state |= LIS_FOCUSED; Current->u.Link.state |= LIS_FOCUSED;
@ -1028,7 +1028,7 @@ static PDOC_ITEM SYSLINK_SetFocusLink (const SYSLINK_INFO *infoPtr, const DOC_IT
} }
} }
} }
return PrevFocus; return PrevFocus;
} }
@ -1109,16 +1109,16 @@ static LRESULT SYSLINK_SetItem (const SYSLINK_INFO *infoPtr, const LITEM *Item)
/* copy the bits */ /* copy the bits */
di->u.Link.state |= (Item->state & Item->stateMask) & LIS_MASK; di->u.Link.state |= (Item->state & Item->stateMask) & LIS_MASK;
Repaint = (oldstate != di->u.Link.state); Repaint = (oldstate != di->u.Link.state);
/* update the focus */ /* update the focus */
SYSLINK_SetFocusLink(infoPtr, ((di->u.Link.state & LIS_FOCUSED) ? di : NULL)); SYSLINK_SetFocusLink(infoPtr, ((di->u.Link.state & LIS_FOCUSED) ? di : NULL));
} }
if(Repaint) if(Repaint)
{ {
SYSLINK_RepaintLink(infoPtr, di); SYSLINK_RepaintLink(infoPtr, di);
} }
return TRUE; return TRUE;
} }
@ -1129,20 +1129,20 @@ static LRESULT SYSLINK_SetItem (const SYSLINK_INFO *infoPtr, const LITEM *Item)
static LRESULT SYSLINK_GetItem (const SYSLINK_INFO *infoPtr, PLITEM Item) static LRESULT SYSLINK_GetItem (const SYSLINK_INFO *infoPtr, PLITEM Item)
{ {
PDOC_ITEM di; PDOC_ITEM di;
if(!(Item->mask & LIF_ITEMINDEX) || !(Item->mask & (LIF_FLAGSMASK))) if(!(Item->mask & LIF_ITEMINDEX) || !(Item->mask & (LIF_FLAGSMASK)))
{ {
ERR("Invalid Flags!\n"); ERR("Invalid Flags!\n");
return FALSE; return FALSE;
} }
di = SYSLINK_GetLinkItemByIndex(infoPtr, Item->iLink); di = SYSLINK_GetLinkItemByIndex(infoPtr, Item->iLink);
if(di == NULL) if(di == NULL)
{ {
ERR("Link %d couldn't be found\n", Item->iLink); ERR("Link %d couldn't be found\n", Item->iLink);
return FALSE; return FALSE;
} }
if(Item->mask & LIF_STATE) if(Item->mask & LIF_STATE)
{ {
Item->state = (di->u.Link.state & Item->stateMask); Item->state = (di->u.Link.state & Item->stateMask);
@ -1152,7 +1152,7 @@ static LRESULT SYSLINK_GetItem (const SYSLINK_INFO *infoPtr, PLITEM Item)
Item->state &= ~LIS_FOCUSED; Item->state &= ~LIS_FOCUSED;
} }
} }
if(Item->mask & LIF_ITEMID) if(Item->mask & LIF_ITEMID)
{ {
if(di->u.Link.szID) if(di->u.Link.szID)
@ -1164,7 +1164,7 @@ static LRESULT SYSLINK_GetItem (const SYSLINK_INFO *infoPtr, PLITEM Item)
Item->szID[0] = 0; Item->szID[0] = 0;
} }
} }
if(Item->mask & LIF_URL) if(Item->mask & LIF_URL)
{ {
if(di->u.Link.szUrl) if(di->u.Link.szUrl)
@ -1176,7 +1176,7 @@ static LRESULT SYSLINK_GetItem (const SYSLINK_INFO *infoPtr, PLITEM Item)
Item->szUrl[0] = 0; Item->szUrl[0] = 0;
} }
} }
return TRUE; return TRUE;
} }
@ -1204,7 +1204,7 @@ static BOOL SYSLINK_PtInDocItem (const DOC_ITEM *DocItem, POINT pt)
bl++; bl++;
} }
} }
return FALSE; return FALSE;
} }
@ -1248,7 +1248,7 @@ static LRESULT SYSLINK_HitTest (const SYSLINK_INFO *infoPtr, PLHITTESTINFO HitTe
id++; id++;
} }
} }
return FALSE; return FALSE;
} }
@ -1264,7 +1264,7 @@ static LRESULT SYSLINK_GetIdealHeight (const SYSLINK_INFO *infoPtr)
LRESULT height; LRESULT height;
TEXTMETRICW tm; TEXTMETRICW tm;
HGDIOBJ hOldFont = SelectObject(hdc, infoPtr->Font); HGDIOBJ hOldFont = SelectObject(hdc, infoPtr->Font);
if(GetTextMetricsW(hdc, &tm)) if(GetTextMetricsW(hdc, &tm))
{ {
height = tm.tmHeight; height = tm.tmHeight;
@ -1275,7 +1275,7 @@ static LRESULT SYSLINK_GetIdealHeight (const SYSLINK_INFO *infoPtr)
} }
SelectObject(hdc, hOldFont); SelectObject(hdc, hOldFont);
ReleaseDC(infoPtr->Self, hdc); ReleaseDC(infoPtr->Self, hdc);
return height; return height;
} }
return 0; return 0;
@ -1324,7 +1324,7 @@ static LRESULT SYSLINK_SendParentNotify (const SYSLINK_INFO *infoPtr, UINT code,
static LRESULT SYSLINK_SetFocus (SYSLINK_INFO *infoPtr, HWND PrevFocusWindow) static LRESULT SYSLINK_SetFocus (SYSLINK_INFO *infoPtr, HWND PrevFocusWindow)
{ {
PDOC_ITEM Focus; PDOC_ITEM Focus;
infoPtr->HasFocus = TRUE; infoPtr->HasFocus = TRUE;
/* We always select the first link, even if we activated the control using /* We always select the first link, even if we activated the control using
@ -1334,9 +1334,9 @@ static LRESULT SYSLINK_SetFocus (SYSLINK_INFO *infoPtr, HWND PrevFocusWindow)
{ {
SYSLINK_SetFocusLink(infoPtr, Focus); SYSLINK_SetFocusLink(infoPtr, Focus);
} }
SYSLINK_RepaintLink(infoPtr, Focus); SYSLINK_RepaintLink(infoPtr, Focus);
return 0; return 0;
} }
@ -1347,10 +1347,10 @@ static LRESULT SYSLINK_SetFocus (SYSLINK_INFO *infoPtr, HWND PrevFocusWindow)
static LRESULT SYSLINK_KillFocus (SYSLINK_INFO *infoPtr, HWND NewFocusWindow) static LRESULT SYSLINK_KillFocus (SYSLINK_INFO *infoPtr, HWND NewFocusWindow)
{ {
PDOC_ITEM Focus; PDOC_ITEM Focus;
infoPtr->HasFocus = FALSE; infoPtr->HasFocus = FALSE;
Focus = SYSLINK_GetFocusLink(infoPtr, NULL); Focus = SYSLINK_GetFocusLink(infoPtr, NULL);
if(Focus != NULL) if(Focus != NULL)
{ {
SYSLINK_RepaintLink(infoPtr, Focus); SYSLINK_RepaintLink(infoPtr, Focus);
@ -1421,7 +1421,7 @@ static LRESULT SYSLINK_LButtonUp (SYSLINK_INFO *infoPtr, DWORD Buttons, const PO
{ {
PDOC_ITEM Current; PDOC_ITEM Current;
int id; int id;
Current = SYSLINK_LinkAtPt(infoPtr, pt, &id, TRUE); Current = SYSLINK_LinkAtPt(infoPtr, pt, &id, TRUE);
if((Current != NULL) && (Current->u.Link.state & LIS_FOCUSED) && (infoPtr->MouseDownID == id)) if((Current != NULL) && (Current->u.Link.state & LIS_FOCUSED) && (infoPtr->MouseDownID == id))
{ {
@ -1444,7 +1444,7 @@ static BOOL SYSLINK_OnEnter (const SYSLINK_INFO *infoPtr)
{ {
PDOC_ITEM Focus; PDOC_ITEM Focus;
int id; int id;
Focus = SYSLINK_GetFocusLink(infoPtr, &id); Focus = SYSLINK_GetFocusLink(infoPtr, &id);
if(Focus != NULL) if(Focus != NULL)
{ {
@ -1561,10 +1561,10 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
{ {
LHITTESTINFO ht; LHITTESTINFO ht;
DWORD mp = GetMessagePos(); DWORD mp = GetMessagePos();
ht.pt.x = (short)LOWORD(mp); ht.pt.x = (short)LOWORD(mp);
ht.pt.y = (short)HIWORD(mp); ht.pt.y = (short)HIWORD(mp);
ScreenToClient(infoPtr->Self, &ht.pt); ScreenToClient(infoPtr->Self, &ht.pt);
if(SYSLINK_HitTest (infoPtr, &ht)) if(SYSLINK_HitTest (infoPtr, &ht))
{ {
@ -1614,7 +1614,7 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
pt.y = (short)HIWORD(lParam); pt.y = (short)HIWORD(lParam);
return SYSLINK_LButtonUp(infoPtr, wParam, &pt); return SYSLINK_LButtonUp(infoPtr, wParam, &pt);
} }
case WM_KEYDOWN: case WM_KEYDOWN:
{ {
switch(wParam) switch(wParam)
@ -1631,7 +1631,7 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
} }
goto HandleDefaultMessage; goto HandleDefaultMessage;
} }
case WM_GETDLGCODE: case WM_GETDLGCODE:
{ {
LRESULT Ret = DLGC_HASSETSEL; LRESULT Ret = DLGC_HASSETSEL;
@ -1657,14 +1657,14 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
} }
return Ret; return Ret;
} }
case WM_NCHITTEST: case WM_NCHITTEST:
{ {
POINT pt; POINT pt;
RECT rc; RECT rc;
pt.x = (short)LOWORD(lParam); pt.x = (short)LOWORD(lParam);
pt.y = (short)HIWORD(lParam); pt.y = (short)HIWORD(lParam);
GetClientRect(infoPtr->Self, &rc); GetClientRect(infoPtr->Self, &rc);
ScreenToClient(infoPtr->Self, &pt); ScreenToClient(infoPtr->Self, &pt);
if(pt.x < 0 || pt.y < 0 || pt.x > rc.right || pt.y > rc.bottom) if(pt.x < 0 || pt.y < 0 || pt.x > rc.right || pt.y > rc.bottom)
@ -1676,7 +1676,7 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
{ {
return HTCLIENT; return HTCLIENT;
} }
return HTTRANSPARENT; return HTTRANSPARENT;
} }

View file

@ -887,7 +887,7 @@ static LRESULT TAB_AdjustRect(const TAB_INFO *infoPtr, WPARAM fLarger, LPRECT pr
((lStyle & TCS_BUTTONS)? 3 * (infoPtr->uNumRows - 1) : 0); ((lStyle & TCS_BUTTONS)? 3 * (infoPtr->uNumRows - 1) : 0);
/* Inflate the rectangle for the padding */ /* Inflate the rectangle for the padding */
InflateRect(prc, DISPLAY_AREA_PADDINGX, DISPLAY_AREA_PADDINGY); InflateRect(prc, DISPLAY_AREA_PADDINGX, DISPLAY_AREA_PADDINGY);
/* Inflate for the border */ /* Inflate for the border */
InflateRect(prc, CONTROL_BORDER_SIZEX, CONTROL_BORDER_SIZEY); InflateRect(prc, CONTROL_BORDER_SIZEX, CONTROL_BORDER_SIZEY);
@ -1098,7 +1098,7 @@ static void TAB_SetItemBounds (TAB_INFO *infoPtr)
/* Now use hPadding and vPadding */ /* Now use hPadding and vPadding */
infoPtr->uHItemPadding = infoPtr->uHItemPadding_s; infoPtr->uHItemPadding = infoPtr->uHItemPadding_s;
infoPtr->uVItemPadding = infoPtr->uVItemPadding_s; infoPtr->uVItemPadding = infoPtr->uVItemPadding_s;
/* The leftmost item will be "0" aligned */ /* The leftmost item will be "0" aligned */
curItemLeftPos = 0; curItemLeftPos = 0;
curItemRowCount = infoPtr->uNumItem ? 1 : 0; curItemRowCount = infoPtr->uNumItem ? 1 : 0;
@ -1125,7 +1125,7 @@ static void TAB_SetItemBounds (TAB_INFO *infoPtr)
* Make sure there is enough space for the letters + icon + growing the * Make sure there is enough space for the letters + icon + growing the
* selected item + extra space for the selected item. * selected item + extra space for the selected item.
*/ */
infoPtr->tabHeight = item_height + infoPtr->tabHeight = item_height +
((lStyle & TCS_BUTTONS) ? 2 : 1) * ((lStyle & TCS_BUTTONS) ? 2 : 1) *
infoPtr->uVItemPadding; infoPtr->uVItemPadding;
@ -1150,7 +1150,7 @@ static void TAB_SetItemBounds (TAB_INFO *infoPtr)
for (curItem = 0; curItem < infoPtr->uNumItem; curItem++) for (curItem = 0; curItem < infoPtr->uNumItem; curItem++)
{ {
TAB_ITEM *curr = TAB_GetItem(infoPtr, curItem); TAB_ITEM *curr = TAB_GetItem(infoPtr, curItem);
/* Set the leftmost position of the tab. */ /* Set the leftmost position of the tab. */
curr->rect.left = curItemLeftPos; curr->rect.left = curItemLeftPos;
@ -1203,7 +1203,7 @@ static void TAB_SetItemBounds (TAB_INFO *infoPtr)
*/ */
if (((lStyle & TCS_MULTILINE) || (lStyle & TCS_VERTICAL)) && if (((lStyle & TCS_MULTILINE) || (lStyle & TCS_VERTICAL)) &&
(curr->rect.right > (curr->rect.right >
(clientRect.right - CONTROL_BORDER_SIZEX - DISPLAY_AREA_PADDINGX))) (clientRect.right - CONTROL_BORDER_SIZEX - DISPLAY_AREA_PADDINGX)))
{ {
curr->rect.right -= curr->rect.left; curr->rect.right -= curr->rect.left;
@ -1283,7 +1283,7 @@ static void TAB_SetItemBounds (TAB_INFO *infoPtr)
{ {
/* normalize the current rect */ /* normalize the current rect */
TAB_ITEM *curr = TAB_GetItem(infoPtr, iItm); TAB_ITEM *curr = TAB_GetItem(infoPtr, iItm);
/* shift the item to the left side of the clientRect */ /* shift the item to the left side of the clientRect */
curr->rect.right -= curr->rect.left; curr->rect.right -= curr->rect.left;
curr->rect.left = 0; curr->rect.left = 0;
@ -1501,7 +1501,7 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect
HPEN holdPen; HPEN holdPen;
INT oldBkMode; INT oldBkMode;
HFONT hOldFont; HFONT hOldFont;
/* if (drawRect == NULL) */ /* if (drawRect == NULL) */
{ {
BOOL isVisible; BOOL isVisible;
@ -1530,7 +1530,7 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect
*drawRect = selectedRect; *drawRect = selectedRect;
else else
*drawRect = itemRect; *drawRect = itemRect;
if (lStyle & TCS_BUTTONS) if (lStyle & TCS_BUTTONS)
{ {
if (iItem == infoPtr->iSelected) if (iItem == infoPtr->iSelected)
@ -1634,8 +1634,8 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect
*/ */
oldBkMode = SetBkMode(hdc, TRANSPARENT); oldBkMode = SetBkMode(hdc, TRANSPARENT);
if (!GetWindowTheme (infoPtr->hwnd) || (lStyle & TCS_BUTTONS)) if (!GetWindowTheme (infoPtr->hwnd) || (lStyle & TCS_BUTTONS))
SetTextColor(hdc, (((lStyle & TCS_HOTTRACK) && (iItem == infoPtr->iHotTracked) SetTextColor(hdc, (((lStyle & TCS_HOTTRACK) && (iItem == infoPtr->iHotTracked)
&& !(lStyle & TCS_FLATBUTTONS)) && !(lStyle & TCS_FLATBUTTONS))
| (TAB_GetItem(infoPtr, iItem)->dwState & TCIS_HIGHLIGHTED)) ? | (TAB_GetItem(infoPtr, iItem)->dwState & TCIS_HIGHLIGHTED)) ?
comctl32_color.clrHighlight : comctl32_color.clrBtnText); comctl32_color.clrHighlight : comctl32_color.clrBtnText);
@ -1670,7 +1670,7 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect
dis.itemState = 0; dis.itemState = 0;
if ( iItem == infoPtr->iSelected ) if ( iItem == infoPtr->iSelected )
dis.itemState |= ODS_SELECTED; dis.itemState |= ODS_SELECTED;
if (infoPtr->uFocus == iItem) if (infoPtr->uFocus == iItem)
dis.itemState |= ODS_FOCUS; dis.itemState |= ODS_FOCUS;
dis.hwndItem = infoPtr->hwnd; dis.hwndItem = infoPtr->hwnd;
dis.hDC = hdc; dis.hDC = hdc;
@ -1713,7 +1713,7 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect
{ {
INT cx; INT cx;
INT cy; INT cy;
ImageList_GetIconSize(infoPtr->himl, &cx, &cy); ImageList_GetIconSize(infoPtr->himl, &cx, &cy);
if(lStyle & TCS_VERTICAL) if(lStyle & TCS_VERTICAL)
@ -1738,10 +1738,10 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect
if (center_offset_h < 2) if (center_offset_h < 2)
center_offset_h = 2; center_offset_h = 2;
if (center_offset_v < 0) if (center_offset_v < 0)
center_offset_v = 0; center_offset_v = 0;
TRACE("for <%s>, c_o_h=%d, c_o_v=%d, draw=(%d,%d)-(%d,%d), textlen=%d\n", TRACE("for <%s>, c_o_h=%d, c_o_v=%d, draw=(%d,%d)-(%d,%d), textlen=%d\n",
debugstr_w(item->pszText), center_offset_h, center_offset_v, debugstr_w(item->pszText), center_offset_h, center_offset_v,
drawRect->left, drawRect->top, drawRect->right, drawRect->bottom, drawRect->left, drawRect->top, drawRect->right, drawRect->bottom,
@ -1963,7 +1963,7 @@ static void TAB_DrawItem(const TAB_INFO *infoPtr, HDC hdc, INT iItem)
if (iItem == infoPtr->iSelected) if (iItem == infoPtr->iSelected)
{ {
DrawEdge(hdc, &r, EDGE_SUNKEN, BF_SOFT|BF_RECT); DrawEdge(hdc, &r, EDGE_SUNKEN, BF_SOFT|BF_RECT);
OffsetRect(&r, 1, 1); OffsetRect(&r, 1, 1);
} }
else /* ! selected */ else /* ! selected */
@ -1998,7 +1998,7 @@ static void TAB_DrawItem(const TAB_INFO *infoPtr, HDC hdc, INT iItem)
* Windows draws even side or bottom tabs themed, with wacky results. * 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 * 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 */ * a manifest avoid theming when we know the result will be wrong */
if ((theme = GetWindowTheme (infoPtr->hwnd)) if ((theme = GetWindowTheme (infoPtr->hwnd))
&& ((lStyle & (TCS_VERTICAL | TCS_BOTTOM)) == 0)) && ((lStyle & (TCS_VERTICAL | TCS_BOTTOM)) == 0))
{ {
static const int partIds[8] = { static const int partIds[8] = {
@ -2325,11 +2325,6 @@ static void TAB_Refresh (TAB_INFO *infoPtr, HDC hdc)
/* Then, draw the selected item */ /* Then, draw the selected item */
TAB_DrawItem (infoPtr, hdc, infoPtr->iSelected); TAB_DrawItem (infoPtr, hdc, infoPtr->iSelected);
/* If we haven't set the current focus yet, set it now.
* Only happens when we first paint the tab controls */
if (infoPtr->uFocus == -1)
TAB_SetCurFocus(infoPtr, infoPtr->iSelected);
} }
SelectObject (hdc, hOldFont); SelectObject (hdc, hOldFont);
@ -2506,13 +2501,13 @@ static void TAB_InvalidateTabArea(const TAB_INFO *infoPtr)
if (infoPtr->uNumRows == 1) if (infoPtr->uNumRows == 1)
rInvalidate.right = clientRect.left + rect.right + 2 * SELECTED_TAB_OFFSET; rInvalidate.right = clientRect.left + rect.right + 2 * SELECTED_TAB_OFFSET;
} }
else else
{ {
rInvalidate.bottom = rAdjClient.top; rInvalidate.bottom = rAdjClient.top;
if (infoPtr->uNumRows == 1) if (infoPtr->uNumRows == 1)
rInvalidate.right = clientRect.left + rect.right + 2 * SELECTED_TAB_OFFSET; rInvalidate.right = clientRect.left + rect.right + 2 * SELECTED_TAB_OFFSET;
} }
/* Punch out the updown control */ /* Punch out the updown control */
if (infoPtr->needsScrolling && (rInvalidate.right > 0)) { if (infoPtr->needsScrolling && (rInvalidate.right > 0)) {
RECT r; RECT r;
@ -2522,11 +2517,11 @@ static void TAB_InvalidateTabArea(const TAB_INFO *infoPtr)
else else
rInvalidate.right = clientRect.right - r.left; rInvalidate.right = clientRect.right - r.left;
} }
TRACE("invalidate (%d,%d)-(%d,%d)\n", TRACE("invalidate (%d,%d)-(%d,%d)\n",
rInvalidate.left, rInvalidate.top, rInvalidate.left, rInvalidate.top,
rInvalidate.right, rInvalidate.bottom); rInvalidate.right, rInvalidate.bottom);
InvalidateRect(infoPtr->hwnd, &rInvalidate, TRUE); InvalidateRect(infoPtr->hwnd, &rInvalidate, TRUE);
} }
@ -2627,7 +2622,7 @@ TAB_InsertItemT (TAB_INFO *infoPtr, WPARAM wParam, LPARAM lParam, BOOL bUnicode)
memcpy(item->extra, &pti->lParam, infoPtr->cbInfo); memcpy(item->extra, &pti->lParam, infoPtr->cbInfo);
else else
memset(item->extra, 0, infoPtr->cbInfo); memset(item->extra, 0, infoPtr->cbInfo);
TAB_SetItemBounds(infoPtr); TAB_SetItemBounds(infoPtr);
if (infoPtr->uNumItem > 1) if (infoPtr->uNumItem > 1)
TAB_InvalidateTabArea(infoPtr); TAB_InvalidateTabArea(infoPtr);
@ -2637,6 +2632,10 @@ TAB_InsertItemT (TAB_INFO *infoPtr, WPARAM wParam, LPARAM lParam, BOOL bUnicode)
TRACE("[%p]: added item %d %s\n", TRACE("[%p]: added item %d %s\n",
infoPtr->hwnd, iItem, debugstr_w(item->pszText)); infoPtr->hwnd, iItem, debugstr_w(item->pszText));
/* If we haven't set the current focus yet, set it now. */
if (infoPtr->uFocus == -1)
TAB_SetCurFocus(infoPtr, iItem);
return iItem; return iItem;
} }
@ -2688,7 +2687,7 @@ static inline LRESULT TAB_SetMinTabWidth (TAB_INFO *infoPtr, INT cx)
return oldcx; return oldcx;
} }
static inline LRESULT static inline LRESULT
TAB_HighlightItem (TAB_INFO *infoPtr, INT iItem, BOOL fHighlight) TAB_HighlightItem (TAB_INFO *infoPtr, INT iItem, BOOL fHighlight)
{ {
LPDWORD lpState; LPDWORD lpState;
@ -2697,7 +2696,7 @@ TAB_HighlightItem (TAB_INFO *infoPtr, INT iItem, BOOL fHighlight)
if (!infoPtr || iItem < 0 || iItem >= infoPtr->uNumItem) if (!infoPtr || iItem < 0 || iItem >= infoPtr->uNumItem)
return FALSE; return FALSE;
lpState = &TAB_GetItem(infoPtr, iItem)->dwState; lpState = &TAB_GetItem(infoPtr, iItem)->dwState;
if (fHighlight) if (fHighlight)
@ -3019,7 +3018,7 @@ static LRESULT TAB_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
} }
OpenThemeData (infoPtr->hwnd, themeClass); OpenThemeData (infoPtr->hwnd, themeClass);
/* /*
* We need to get text information so we need a DC and we need to select * We need to get text information so we need a DC and we need to select
* a font. * a font.
@ -3064,8 +3063,7 @@ TAB_Destroy (TAB_INFO *infoPtr)
if (infoPtr->items) { if (infoPtr->items) {
for (iItem = 0; iItem < infoPtr->uNumItem; iItem++) { for (iItem = 0; iItem < infoPtr->uNumItem; iItem++) {
if (TAB_GetItem(infoPtr, iItem)->pszText) Free (TAB_GetItem(infoPtr, iItem)->pszText);
Free (TAB_GetItem(infoPtr, iItem)->pszText);
} }
Free (infoPtr->items); Free (infoPtr->items);
} }
@ -3080,7 +3078,7 @@ TAB_Destroy (TAB_INFO *infoPtr)
KillTimer(infoPtr->hwnd, TAB_HOTTRACK_TIMER); KillTimer(infoPtr->hwnd, TAB_HOTTRACK_TIMER);
CloseThemeData (GetWindowTheme (infoPtr->hwnd)); CloseThemeData (GetWindowTheme (infoPtr->hwnd));
Free (infoPtr); Free (infoPtr);
return 0; return 0;
} }
@ -3112,7 +3110,7 @@ TAB_SetItemExtra (TAB_INFO *infoPtr, INT cbInfo)
/* FIXME: MSDN says this is not allowed, but this hasn't been verified */ /* FIXME: MSDN says this is not allowed, but this hasn't been verified */
return FALSE; return FALSE;
} }
infoPtr->cbInfo = cbInfo; infoPtr->cbInfo = cbInfo;
return TRUE; return TRUE;
} }

View file

@ -82,7 +82,7 @@ static void paint_text (HWND hwnd, HDC hdc, DWORD dwStyle, const COMBOBOXINFO *c
*/ */
CopyRect (&rectEdit, &cbi->rcItem); CopyRect (&rectEdit, &cbi->rcItem);
InflateRect( &rectEdit, -1, -1 ); InflateRect( &rectEdit, -1, -1 );
if(dwStyle & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)) if(dwStyle & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE))
{ {
DRAWITEMSTRUCT dis; DRAWITEMSTRUCT dis;
@ -106,7 +106,7 @@ static void paint_text (HWND hwnd, HDC hdc, DWORD dwStyle, const COMBOBOXINFO *c
clipRegion=NULL; clipRegion=NULL;
} }
if (!IsWindowEnabled(hwnd) & WS_DISABLED) itemState |= ODS_DISABLED; if (!IsWindowEnabled(hwnd)) itemState |= ODS_DISABLED;
dis.CtlType = ODT_COMBOBOX; dis.CtlType = ODT_COMBOBOX;
dis.CtlID = ctlid; dis.CtlID = ctlid;
@ -158,7 +158,7 @@ static void paint_text (HWND hwnd, HDC hdc, DWORD dwStyle, const COMBOBOXINFO *c
if( hPrevFont ) if( hPrevFont )
SelectObject(hdc, hPrevFont ); SelectObject(hdc, hPrevFont );
HeapFree( GetProcessHeap(), 0, pText ); HeapFree( GetProcessHeap(), 0, pText );
} }
@ -179,10 +179,10 @@ static LRESULT paint (HTHEME theme, HWND hwnd, HDC hParamDC, ULONG state)
{ {
RECT frameRect; RECT frameRect;
int buttonState; int buttonState;
cbi.cbSize = sizeof (cbi); cbi.cbSize = sizeof (cbi);
SendMessageW (hwnd, CB_GETCOMBOBOXINFO, 0, (LPARAM)&cbi); SendMessageW (hwnd, CB_GETCOMBOBOXINFO, 0, (LPARAM)&cbi);
/* paint border */ /* paint border */
if ((dwStyle & CBS_DROPDOWNLIST) != CBS_SIMPLE) if ((dwStyle & CBS_DROPDOWNLIST) != CBS_SIMPLE)
GetClientRect (hwnd, &frameRect); GetClientRect (hwnd, &frameRect);
@ -190,14 +190,14 @@ static LRESULT paint (HTHEME theme, HWND hwnd, HDC hParamDC, ULONG state)
{ {
CopyRect (&frameRect, &cbi.rcItem); CopyRect (&frameRect, &cbi.rcItem);
InflateRect(&frameRect, InflateRect(&frameRect,
EDIT_CONTROL_PADDING + COMBO_XBORDERSIZE, EDIT_CONTROL_PADDING + COMBO_XBORDERSIZE,
EDIT_CONTROL_PADDING + COMBO_YBORDERSIZE); EDIT_CONTROL_PADDING + COMBO_YBORDERSIZE);
} }
DrawThemeBackground (theme, hDC, 0, DrawThemeBackground (theme, hDC, 0,
IsWindowEnabled (hwnd) ? CBXS_NORMAL : CBXS_DISABLED, &frameRect, NULL); IsWindowEnabled (hwnd) ? CBXS_NORMAL : CBXS_DISABLED, &frameRect, NULL);
/* paint button */ /* paint button */
if (cbi.stateButton != STATE_SYSTEM_INVISIBLE) if (cbi.stateButton != STATE_SYSTEM_INVISIBLE)
{ {
@ -209,7 +209,7 @@ static LRESULT paint (HTHEME theme, HWND hwnd, HDC hParamDC, ULONG state)
buttonState = CBXS_HOT; buttonState = CBXS_HOT;
else else
buttonState = CBXS_NORMAL; buttonState = CBXS_NORMAL;
DrawThemeBackground (theme, hDC, CP_DROPDOWNBUTTON, buttonState, DrawThemeBackground (theme, hDC, CP_DROPDOWNBUTTON, buttonState,
&cbi.rcButton, NULL); &cbi.rcButton, NULL);
} }
@ -228,21 +228,21 @@ static LRESULT paint (HTHEME theme, HWND hwnd, HDC hParamDC, ULONG state)
/********************************************************************** /**********************************************************************
* The combo control subclass window proc. * The combo control subclass window proc.
*/ */
LRESULT CALLBACK THEMING_ComboSubclassProc (HWND hwnd, UINT msg, LRESULT CALLBACK THEMING_ComboSubclassProc (HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam, WPARAM wParam, LPARAM lParam,
ULONG_PTR dwRefData) ULONG_PTR dwRefData)
{ {
const WCHAR* themeClass = WC_COMBOBOXW; const WCHAR* themeClass = WC_COMBOBOXW;
HTHEME theme; HTHEME theme;
LRESULT result; LRESULT result;
switch (msg) switch (msg)
{ {
case WM_CREATE: case WM_CREATE:
result = THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); result = THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
OpenThemeData( hwnd, themeClass ); OpenThemeData( hwnd, themeClass );
return result; return result;
case WM_DESTROY: case WM_DESTROY:
theme = GetWindowTheme( hwnd ); theme = GetWindowTheme( hwnd );
CloseThemeData ( theme ); CloseThemeData ( theme );
@ -253,21 +253,21 @@ LRESULT CALLBACK THEMING_ComboSubclassProc (HWND hwnd, UINT msg,
CloseThemeData ( theme ); CloseThemeData ( theme );
OpenThemeData( hwnd, themeClass ); OpenThemeData( hwnd, themeClass );
break; break;
case WM_SYSCOLORCHANGE: case WM_SYSCOLORCHANGE:
theme = GetWindowTheme( hwnd ); theme = GetWindowTheme( hwnd );
if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
/* Do nothing. When themed, a WM_THEMECHANGED will be received, too, /* Do nothing. When themed, a WM_THEMECHANGED will be received, too,
* which will do the repaint. */ * which will do the repaint. */
break; break;
case WM_PAINT: case WM_PAINT:
theme = GetWindowTheme( hwnd ); theme = GetWindowTheme( hwnd );
if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
return paint (theme, hwnd, (HDC)wParam, dwRefData); return paint (theme, hwnd, (HDC)wParam, dwRefData);
case WM_SETREDRAW: case WM_SETREDRAW:
/* Since there doesn't seem to be WM_GETREDRAW, do redraw tracking in /* Since there doesn't seem to be WM_GETREDRAW, do redraw tracking in
* the subclass as well. */ * the subclass as well. */
if( wParam ) if( wParam )
dwRefData &= ~STATE_NOREDRAW; dwRefData &= ~STATE_NOREDRAW;
@ -275,7 +275,7 @@ LRESULT CALLBACK THEMING_ComboSubclassProc (HWND hwnd, UINT msg,
dwRefData |= STATE_NOREDRAW; dwRefData |= STATE_NOREDRAW;
THEMING_SetSubclassData (hwnd, dwRefData); THEMING_SetSubclassData (hwnd, dwRefData);
return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
{ {
/* Dropdown button hot-tracking */ /* Dropdown button hot-tracking */
@ -286,7 +286,7 @@ LRESULT CALLBACK THEMING_ComboSubclassProc (HWND hwnd, UINT msg,
pt.y = (short)HIWORD(lParam); pt.y = (short)HIWORD(lParam);
cbi.cbSize = sizeof (cbi); cbi.cbSize = sizeof (cbi);
SendMessageW (hwnd, CB_GETCOMBOBOXINFO, 0, (LPARAM)&cbi); SendMessageW (hwnd, CB_GETCOMBOBOXINFO, 0, (LPARAM)&cbi);
if (cbi.stateButton != STATE_SYSTEM_INVISIBLE) if (cbi.stateButton != STATE_SYSTEM_INVISIBLE)
{ {
if (PtInRect (&cbi.rcButton, pt)) if (PtInRect (&cbi.rcButton, pt))
@ -295,7 +295,7 @@ LRESULT CALLBACK THEMING_ComboSubclassProc (HWND hwnd, UINT msg,
{ {
dwRefData |= STATE_HOT; dwRefData |= STATE_HOT;
THEMING_SetSubclassData (hwnd, dwRefData); THEMING_SetSubclassData (hwnd, dwRefData);
RedrawWindow (hwnd, &cbi.rcButton, 0, RedrawWindow (hwnd, &cbi.rcButton, 0,
RDW_INVALIDATE | RDW_UPDATENOW); RDW_INVALIDATE | RDW_UPDATENOW);
} }
} }
@ -305,15 +305,15 @@ LRESULT CALLBACK THEMING_ComboSubclassProc (HWND hwnd, UINT msg,
{ {
dwRefData &= ~STATE_HOT; dwRefData &= ~STATE_HOT;
THEMING_SetSubclassData (hwnd, dwRefData); THEMING_SetSubclassData (hwnd, dwRefData);
RedrawWindow (hwnd, &cbi.rcButton, 0, RedrawWindow (hwnd, &cbi.rcButton, 0,
RDW_INVALIDATE | RDW_UPDATENOW); RDW_INVALIDATE | RDW_UPDATENOW);
} }
} }
} }
} }
return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
default: default:
/* Call old proc */ /* Call old proc */
return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
} }

View file

@ -35,8 +35,8 @@
/********************************************************************** /**********************************************************************
* The dialog subclass window proc. * The dialog subclass window proc.
*/ */
LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg, LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg,
WPARAM wParam, LPARAM lParam, WPARAM wParam, LPARAM lParam,
ULONG_PTR dwRefData) ULONG_PTR dwRefData)
{ {
HTHEME theme = GetWindowTheme ( hWnd ); HTHEME theme = GetWindowTheme ( hWnd );
@ -44,14 +44,14 @@ LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg,
BOOL themingActive = IsThemeDialogTextureEnabled (hWnd); BOOL themingActive = IsThemeDialogTextureEnabled (hWnd);
BOOL doTheming = themingActive && (theme != NULL); BOOL doTheming = themingActive && (theme != NULL);
LRESULT result; LRESULT result;
switch (msg) switch (msg)
{ {
case WM_CREATE: case WM_CREATE:
result = THEMING_CallOriginalClass (hWnd, msg, wParam, lParam); result = THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
theme = OpenThemeData( hWnd, themeClass ); theme = OpenThemeData( hWnd, themeClass );
return result; return result;
case WM_DESTROY: case WM_DESTROY:
CloseThemeData ( theme ); CloseThemeData ( theme );
return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam); return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
@ -61,13 +61,13 @@ LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg,
OpenThemeData( hWnd, themeClass ); OpenThemeData( hWnd, themeClass );
InvalidateRect( hWnd, NULL, TRUE ); InvalidateRect( hWnd, NULL, TRUE );
return 0; return 0;
case WM_SYSCOLORCHANGE: case WM_SYSCOLORCHANGE:
if (!doTheming) return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam); if (!doTheming) return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
/* Do nothing. When themed, a WM_THEMECHANGED will be received, too, /* Do nothing. When themed, a WM_THEMECHANGED will be received, too,
* which will do the repaint. */ * which will do the repaint. */
break; break;
case WM_ERASEBKGND: case WM_ERASEBKGND:
if (!doTheming) return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam); if (!doTheming) return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
{ {
@ -78,20 +78,20 @@ LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg,
/* Draw background*/ /* Draw background*/
GetClientRect (hWnd, &rc); GetClientRect (hWnd, &rc);
if (IsThemePartDefined (theme, WP_DIALOG, 0)) if (IsThemePartDefined (theme, WP_DIALOG, 0))
/* Although there is a theme for the WINDOW class/DIALOG part, /* Although there is a theme for the WINDOW class/DIALOG part,
* but I[res] haven't seen Windows using it yet... Even when * but I[res] haven't seen Windows using it yet... Even when
* dialog theming is activated, the good ol' BTNFACE * dialog theming is activated, the good ol' BTNFACE
* background seems to be used. */ * background seems to be used. */
#if 0 #if 0
DrawThemeBackground (theme, (HDC)wParam, WP_DIALOG, 0, &rc, DrawThemeBackground (theme, (HDC)wParam, WP_DIALOG, 0, &rc,
NULL); NULL);
#endif #endif
return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam); return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
else else
/* We might have gotten a TAB theme class, so check if we can /* We might have gotten a TAB theme class, so check if we can
* draw as a tab page. */ * draw as a tab page. */
if (IsThemePartDefined (theme, TABP_BODY, 0)) if (IsThemePartDefined (theme, TABP_BODY, 0))
DrawThemeBackground (theme, (HDC)wParam, TABP_BODY, 0, &rc, DrawThemeBackground (theme, (HDC)wParam, TABP_BODY, 0, &rc,
NULL); NULL);
else else
return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam); return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
@ -112,11 +112,11 @@ LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg,
WCHAR controlClass[32]; WCHAR controlClass[32];
RECT rc; RECT rc;
GetClassNameW (controlWnd, controlClass, GetClassNameW (controlWnd, controlClass,
sizeof(controlClass) / sizeof(controlClass[0])); sizeof(controlClass) / sizeof(controlClass[0]));
if (lstrcmpiW (controlClass, WC_STATICW) == 0) if (lstrcmpiW (controlClass, WC_STATICW) == 0)
{ {
/* Static control - draw parent background and set text to /* Static control - draw parent background and set text to
* transparent, so it looks right on tab pages. */ * transparent, so it looks right on tab pages. */
GetClientRect (controlWnd, &rc); GetClientRect (controlWnd, &rc);
DrawThemeParentBackground (controlWnd, controlDC, &rc); DrawThemeParentBackground (controlWnd, controlDC, &rc);
@ -132,7 +132,7 @@ LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg,
return result; return result;
} }
default: default:
/* Call old proc */ /* Call old proc */
return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam); return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
} }

View file

@ -46,26 +46,26 @@ static void nc_paint (HTHEME theme, HWND hwnd, HRGN region)
int part = EP_EDITTEXT; int part = EP_EDITTEXT;
int state = ETS_NORMAL; int state = ETS_NORMAL;
DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE); DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE);
if (!IsWindowEnabled (hwnd)) if (!IsWindowEnabled (hwnd))
state = ETS_DISABLED; state = ETS_DISABLED;
else if (dwStyle & ES_READONLY) else if (dwStyle & ES_READONLY)
state = ETS_READONLY; state = ETS_READONLY;
else if (GetFocus() == hwnd) else if (GetFocus() == hwnd)
state = ETS_FOCUSED; state = ETS_FOCUSED;
GetWindowRect(hwnd, &r); GetWindowRect(hwnd, &r);
/* New clipping region passed to default proc to exclude border */ /* New clipping region passed to default proc to exclude border */
cliprgn = CreateRectRgn (r.left + cxEdge, r.top + cyEdge, cliprgn = CreateRectRgn (r.left + cxEdge, r.top + cyEdge,
r.right - cxEdge, r.bottom - cyEdge); r.right - cxEdge, r.bottom - cyEdge);
if (region != (HRGN)1) if (region != (HRGN)1)
CombineRgn (cliprgn, cliprgn, region, RGN_AND); CombineRgn (cliprgn, cliprgn, region, RGN_AND);
OffsetRect(&r, -r.left, -r.top); OffsetRect(&r, -r.left, -r.top);
dc = GetDCEx(hwnd, region, DCX_WINDOW|DCX_INTERSECTRGN); dc = GetDCEx(hwnd, region, DCX_WINDOW|DCX_INTERSECTRGN);
OffsetRect(&r, -r.left, -r.top); OffsetRect(&r, -r.left, -r.top);
if (IsThemeBackgroundPartiallyTransparent (theme, part, state)) if (IsThemeBackgroundPartiallyTransparent (theme, part, state))
DrawThemeParentBackground(hwnd, dc, &r); DrawThemeParentBackground(hwnd, dc, &r);
DrawThemeBackground (theme, dc, part, state, &r, 0); DrawThemeBackground (theme, dc, part, state, &r, 0);
@ -79,21 +79,21 @@ static void nc_paint (HTHEME theme, HWND hwnd, HRGN region)
/********************************************************************** /**********************************************************************
* The edit control subclass window proc. * The edit control subclass window proc.
*/ */
LRESULT CALLBACK THEMING_EditSubclassProc (HWND hwnd, UINT msg, LRESULT CALLBACK THEMING_EditSubclassProc (HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam, WPARAM wParam, LPARAM lParam,
ULONG_PTR dwRefData) ULONG_PTR dwRefData)
{ {
const WCHAR* themeClass = WC_EDITW; const WCHAR* themeClass = WC_EDITW;
HTHEME theme; HTHEME theme;
LRESULT result; LRESULT result;
switch (msg) switch (msg)
{ {
case WM_CREATE: case WM_CREATE:
result = THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); result = THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
OpenThemeData( hwnd, themeClass ); OpenThemeData( hwnd, themeClass );
return result; return result;
case WM_DESTROY: case WM_DESTROY:
theme = GetWindowTheme( hwnd ); theme = GetWindowTheme( hwnd );
CloseThemeData ( theme ); CloseThemeData ( theme );
@ -104,14 +104,14 @@ LRESULT CALLBACK THEMING_EditSubclassProc (HWND hwnd, UINT msg,
CloseThemeData ( theme ); CloseThemeData ( theme );
OpenThemeData( hwnd, themeClass ); OpenThemeData( hwnd, themeClass );
break; break;
case WM_SYSCOLORCHANGE: case WM_SYSCOLORCHANGE:
theme = GetWindowTheme( hwnd ); theme = GetWindowTheme( hwnd );
if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
/* Do nothing. When themed, a WM_THEMECHANGED will be received, too, /* Do nothing. When themed, a WM_THEMECHANGED will be received, too,
* which will do the repaint. */ * which will do the repaint. */
break; break;
case WM_NCPAINT: case WM_NCPAINT:
theme = GetWindowTheme( hwnd ); theme = GetWindowTheme( hwnd );
if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
@ -120,11 +120,11 @@ LRESULT CALLBACK THEMING_EditSubclassProc (HWND hwnd, UINT msg,
case WM_ENABLE: case WM_ENABLE:
theme = GetWindowTheme( hwnd ); theme = GetWindowTheme( hwnd );
if (theme) RedrawWindow (hwnd, NULL, NULL, if (theme) RedrawWindow (hwnd, NULL, NULL,
RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW); RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW);
return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
default: default:
/* Call old proc */ /* Call old proc */
return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
} }

View file

@ -43,19 +43,19 @@ static void nc_paint (HTHEME theme, HWND hwnd, HRGN region)
RECT r; RECT r;
int cxEdge = GetSystemMetrics (SM_CXEDGE), int cxEdge = GetSystemMetrics (SM_CXEDGE),
cyEdge = GetSystemMetrics (SM_CYEDGE); cyEdge = GetSystemMetrics (SM_CYEDGE);
GetWindowRect(hwnd, &r); GetWindowRect(hwnd, &r);
/* New clipping region passed to default proc to exclude border */ /* New clipping region passed to default proc to exclude border */
cliprgn = CreateRectRgn (r.left + cxEdge, r.top + cyEdge, cliprgn = CreateRectRgn (r.left + cxEdge, r.top + cyEdge,
r.right - cxEdge, r.bottom - cyEdge); r.right - cxEdge, r.bottom - cyEdge);
if (region != (HRGN)1) if (region != (HRGN)1)
CombineRgn (cliprgn, cliprgn, region, RGN_AND); CombineRgn (cliprgn, cliprgn, region, RGN_AND);
OffsetRect(&r, -r.left, -r.top); OffsetRect(&r, -r.left, -r.top);
dc = GetDCEx(hwnd, region, DCX_WINDOW|DCX_INTERSECTRGN); dc = GetDCEx(hwnd, region, DCX_WINDOW|DCX_INTERSECTRGN);
OffsetRect(&r, -r.left, -r.top); OffsetRect(&r, -r.left, -r.top);
if (IsThemeBackgroundPartiallyTransparent (theme, 0, 0)) if (IsThemeBackgroundPartiallyTransparent (theme, 0, 0))
DrawThemeParentBackground(hwnd, dc, &r); DrawThemeParentBackground(hwnd, dc, &r);
DrawThemeBackground (theme, dc, 0, 0, &r, 0); DrawThemeBackground (theme, dc, 0, 0, &r, 0);
@ -69,21 +69,21 @@ static void nc_paint (HTHEME theme, HWND hwnd, HRGN region)
/********************************************************************** /**********************************************************************
* The list control subclass window proc. * The list control subclass window proc.
*/ */
LRESULT CALLBACK THEMING_ListBoxSubclassProc (HWND hwnd, UINT msg, LRESULT CALLBACK THEMING_ListBoxSubclassProc (HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam, WPARAM wParam, LPARAM lParam,
ULONG_PTR dwRefData) ULONG_PTR dwRefData)
{ {
const WCHAR* themeClass = WC_LISTBOXW; const WCHAR* themeClass = WC_LISTBOXW;
HTHEME theme; HTHEME theme;
LRESULT result; LRESULT result;
switch (msg) switch (msg)
{ {
case WM_CREATE: case WM_CREATE:
result = THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); result = THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
OpenThemeData( hwnd, themeClass ); OpenThemeData( hwnd, themeClass );
return result; return result;
case WM_DESTROY: case WM_DESTROY:
theme = GetWindowTheme( hwnd ); theme = GetWindowTheme( hwnd );
CloseThemeData ( theme ); CloseThemeData ( theme );
@ -94,21 +94,21 @@ LRESULT CALLBACK THEMING_ListBoxSubclassProc (HWND hwnd, UINT msg,
CloseThemeData ( theme ); CloseThemeData ( theme );
OpenThemeData( hwnd, themeClass ); OpenThemeData( hwnd, themeClass );
break; break;
case WM_SYSCOLORCHANGE: case WM_SYSCOLORCHANGE:
theme = GetWindowTheme( hwnd ); theme = GetWindowTheme( hwnd );
if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
/* Do nothing. When themed, a WM_THEMECHANGED will be received, too, /* Do nothing. When themed, a WM_THEMECHANGED will be received, too,
* which will do the repaint. */ * which will do the repaint. */
break; break;
case WM_NCPAINT: case WM_NCPAINT:
theme = GetWindowTheme( hwnd ); theme = GetWindowTheme( hwnd );
if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
nc_paint (theme, hwnd, (HRGN)wParam); nc_paint (theme, hwnd, (HRGN)wParam);
break; break;
default: default:
/* Call old proc */ /* Call old proc */
return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
} }

View file

@ -68,7 +68,7 @@ static ATOM atSubclassProp;
/* Generate a number of subclass window procs. /* Generate a number of subclass window procs.
* With a single proc alone, we can't really reliably find out the superclass, * 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 * 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 * since it's needed by THEMING_CallOriginalClass(). Then, the subclass
* proc and ref data are fetched and the proc called. * proc and ref data are fetched and the proc called.
*/ */
#define MAKE_SUBCLASS_PROC(N) \ #define MAKE_SUBCLASS_PROC(N) \
@ -109,9 +109,9 @@ static const WNDPROC subclassProcs[NUM_SUBCLASSES] = {
void THEMING_Initialize (void) void THEMING_Initialize (void)
{ {
int i; int i;
static const WCHAR subclassPropName[] = static const WCHAR subclassPropName[] =
{ 'C','C','3','2','T','h','e','m','i','n','g','S','u','b','C','l',0 }; { 'C','C','3','2','T','h','e','m','i','n','g','S','u','b','C','l',0 };
static const WCHAR refDataPropName[] = static const WCHAR refDataPropName[] =
{ 'C','C','3','2','T','h','e','m','i','n','g','D','a','t','a',0 }; { 'C','C','3','2','T','h','e','m','i','n','g','D','a','t','a',0 };
if (!IsThemeActive()) return; if (!IsThemeActive()) return;
@ -128,10 +128,10 @@ void THEMING_Initialize (void)
GetClassInfoExW (NULL, subclasses[i].className, &class); GetClassInfoExW (NULL, subclasses[i].className, &class);
originalProcs[i] = class.lpfnWndProc; originalProcs[i] = class.lpfnWndProc;
class.lpfnWndProc = subclassProcs[i]; class.lpfnWndProc = subclassProcs[i];
if (!class.lpfnWndProc) if (!class.lpfnWndProc)
{ {
ERR("Missing proc for class %s\n", ERR("Missing proc for class %s\n",
debugstr_w (subclasses[i].className)); debugstr_w (subclasses[i].className));
continue; continue;
} }
@ -143,7 +143,7 @@ void THEMING_Initialize (void)
} }
else else
{ {
TRACE("Re-registered class %s\n", TRACE("Re-registered class %s\n",
debugstr_w (subclasses[i].className)); debugstr_w (subclasses[i].className));
} }
} }

View file

@ -23,11 +23,11 @@
* *
* This code was audited for completeness against the documented features * This code was audited for completeness against the documented features
* of Comctl32.dll version 6.0 on Mar. 14, 2004, by Robert Shearman. * of Comctl32.dll version 6.0 on Mar. 14, 2004, by Robert Shearman.
* *
* Unless otherwise noted, we believe this code to be complete, as per * Unless otherwise noted, we believe this code to be complete, as per
* the specification mentioned above. * the specification mentioned above.
* If you discover missing features or bugs please note them below. * If you discover missing features or bugs please note them below.
* *
* TODO: * TODO:
* - Styles: * - Styles:
* - TBSTYLE_REGISTERDROP * - TBSTYLE_REGISTERDROP
@ -279,7 +279,7 @@ TOOLBAR_DumpButton(const TOOLBAR_INFO *infoPtr, const TBUTTON_INFO *bP, INT btn_
{ {
if (TRACE_ON(toolbar)){ if (TRACE_ON(toolbar)){
TRACE("button %d id %d, bitmap=%d, state=%02x, style=%02x, data=%08lx, stringid=0x%08lx\n", TRACE("button %d id %d, bitmap=%d, state=%02x, style=%02x, data=%08lx, stringid=0x%08lx\n",
btn_num, bP->idCommand, GETIBITMAP(infoPtr, bP->iBitmap), btn_num, bP->idCommand, GETIBITMAP(infoPtr, bP->iBitmap),
bP->fsState, bP->fsStyle, bP->dwData, bP->iString); bP->fsState, bP->fsStyle, bP->dwData, bP->iString);
TRACE("string %s\n", debugstr_w(TOOLBAR_GetText(infoPtr,bP))); TRACE("string %s\n", debugstr_w(TOOLBAR_GetText(infoPtr,bP)));
if (internal) if (internal)
@ -341,7 +341,7 @@ TOOLBAR_SendNotify (NMHDR *nmhdr, const TOOLBAR_INFO *infoPtr, UINT code)
TRACE("to window %p, code=%08x, %s\n", infoPtr->hwndNotify, code, TRACE("to window %p, code=%08x, %s\n", infoPtr->hwndNotify, code,
(infoPtr->bUnicode) ? "via Unicode" : "via ANSI"); (infoPtr->bUnicode) ? "via Unicode" : "via ANSI");
return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM)nmhdr->idFrom, (LPARAM)nmhdr); (WPARAM)nmhdr->idFrom, (LPARAM)nmhdr);
} }
@ -706,10 +706,10 @@ TOOLBAR_DrawImage(const TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, INT left, I
} }
} }
else if (tbcd->nmcd.uItemState & CDIS_CHECKED || else if (tbcd->nmcd.uItemState & CDIS_CHECKED ||
((tbcd->nmcd.uItemState & CDIS_HOT) ((tbcd->nmcd.uItemState & CDIS_HOT)
&& ((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf)))) && ((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf))))
{ {
/* if hot, attempt to draw with hot image list, if fails, /* if hot, attempt to draw with hot image list, if fails,
use default image list */ use default image list */
himl = TOOLBAR_GetImageListForDrawing(infoPtr, btnPtr, IMAGE_LIST_HOT, &index); himl = TOOLBAR_GetImageListForDrawing(infoPtr, btnPtr, IMAGE_LIST_HOT, &index);
if (!himl) if (!himl)
@ -721,7 +721,7 @@ TOOLBAR_DrawImage(const TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, INT left, I
if (!himl) if (!himl)
return; return;
if (!(dwItemCDFlag & TBCDRF_NOOFFSET) && if (!(dwItemCDFlag & TBCDRF_NOOFFSET) &&
(tbcd->nmcd.uItemState & (CDIS_SELECTED | CDIS_CHECKED))) (tbcd->nmcd.uItemState & (CDIS_SELECTED | CDIS_CHECKED)))
offset = 1; offset = 1;
@ -749,7 +749,7 @@ TOOLBAR_DrawFrame(const TOOLBAR_INFO *infoPtr, const NMTBCUSTOMDRAW *tbcd, DWORD
BOOL non_interactive_state = (tbcd->nmcd.uItemState & CDIS_DISABLED) || BOOL non_interactive_state = (tbcd->nmcd.uItemState & CDIS_DISABLED) ||
(tbcd->nmcd.uItemState & CDIS_INDETERMINATE); (tbcd->nmcd.uItemState & CDIS_INDETERMINATE);
BOOL pressed_look = !non_interactive_state && BOOL pressed_look = !non_interactive_state &&
((tbcd->nmcd.uItemState & CDIS_SELECTED) || ((tbcd->nmcd.uItemState & CDIS_SELECTED) ||
(tbcd->nmcd.uItemState & CDIS_CHECKED)); (tbcd->nmcd.uItemState & CDIS_CHECKED));
/* app don't want us to draw any edges */ /* app don't want us to draw any edges */
@ -820,7 +820,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc, DWORD dwBaseCustDr
BOOL hasDropDownArrow = (TOOLBAR_HasDropDownArrows(infoPtr->dwExStyle) && BOOL hasDropDownArrow = (TOOLBAR_HasDropDownArrows(infoPtr->dwExStyle) &&
(btnPtr->fsStyle & BTNS_DROPDOWN)) || (btnPtr->fsStyle & BTNS_DROPDOWN)) ||
(btnPtr->fsStyle & BTNS_WHOLEDROPDOWN); (btnPtr->fsStyle & BTNS_WHOLEDROPDOWN);
BOOL drawSepDropDownArrow = hasDropDownArrow && BOOL drawSepDropDownArrow = hasDropDownArrow &&
(~btnPtr->fsStyle & BTNS_WHOLEDROPDOWN); (~btnPtr->fsStyle & BTNS_WHOLEDROPDOWN);
RECT rc, rcArrow, rcBitmap, rcText; RECT rc, rcArrow, rcBitmap, rcText;
LPWSTR lpText = NULL; LPWSTR lpText = NULL;
@ -839,8 +839,8 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc, DWORD dwBaseCustDr
if (btnPtr->fsStyle & BTNS_SEP) { if (btnPtr->fsStyle & BTNS_SEP) {
if (theme) if (theme)
{ {
DrawThemeBackground (theme, hdc, DrawThemeBackground (theme, hdc,
(dwStyle & CCS_VERT) ? TP_SEPARATORVERT : TP_SEPARATOR, 0, (dwStyle & CCS_VERT) ? TP_SEPARATORVERT : TP_SEPARATOR, 0,
&rc, NULL); &rc, NULL);
} }
else else
@ -983,11 +983,11 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc, DWORD dwBaseCustDr
(btnPtr->fsState & (TBSTATE_PRESSED | TBSTATE_CHECKED))) (btnPtr->fsState & (TBSTATE_PRESSED | TBSTATE_CHECKED)))
OffsetRect(&rcText, 1, 1); OffsetRect(&rcText, 1, 1);
if (!(tbcd.nmcd.uItemState & CDIS_HOT) && if (!(tbcd.nmcd.uItemState & CDIS_HOT) &&
((tbcd.nmcd.uItemState & CDIS_CHECKED) || (tbcd.nmcd.uItemState & CDIS_INDETERMINATE))) ((tbcd.nmcd.uItemState & CDIS_CHECKED) || (tbcd.nmcd.uItemState & CDIS_INDETERMINATE)))
TOOLBAR_DrawPattern (&rc, &tbcd); TOOLBAR_DrawPattern (&rc, &tbcd);
if (((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf)) if (((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf))
&& (tbcd.nmcd.uItemState & CDIS_HOT)) && (tbcd.nmcd.uItemState & CDIS_HOT))
{ {
if ( dwItemCDFlag & TBCDRF_HILITEHOTTRACK ) if ( dwItemCDFlag & TBCDRF_HILITEHOTTRACK )
@ -1006,7 +1006,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc, DWORD dwBaseCustDr
{ {
int partId = drawSepDropDownArrow ? TP_SPLITBUTTON : TP_BUTTON; int partId = drawSepDropDownArrow ? TP_SPLITBUTTON : TP_BUTTON;
int stateId = TS_NORMAL; int stateId = TS_NORMAL;
if (tbcd.nmcd.uItemState & CDIS_DISABLED) if (tbcd.nmcd.uItemState & CDIS_DISABLED)
stateId = TS_DISABLED; stateId = TS_DISABLED;
else if (tbcd.nmcd.uItemState & CDIS_SELECTED) else if (tbcd.nmcd.uItemState & CDIS_SELECTED)
@ -1016,7 +1016,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc, DWORD dwBaseCustDr
else if ((tbcd.nmcd.uItemState & CDIS_HOT) else if ((tbcd.nmcd.uItemState & CDIS_HOT)
|| (drawSepDropDownArrow && btnPtr->bDropDownPressed)) || (drawSepDropDownArrow && btnPtr->bDropDownPressed))
stateId = TS_HOT; stateId = TS_HOT;
DrawThemeBackground (theme, hdc, partId, stateId, &tbcd.nmcd.rc, NULL); DrawThemeBackground (theme, hdc, partId, stateId, &tbcd.nmcd.rc, NULL);
} }
else else
@ -1027,7 +1027,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc, DWORD dwBaseCustDr
if (theme) if (theme)
{ {
int stateId = TS_NORMAL; int stateId = TS_NORMAL;
if (tbcd.nmcd.uItemState & CDIS_DISABLED) if (tbcd.nmcd.uItemState & CDIS_DISABLED)
stateId = TS_DISABLED; stateId = TS_DISABLED;
else if (btnPtr->bDropDownPressed || (tbcd.nmcd.uItemState & CDIS_SELECTED)) else if (btnPtr->bDropDownPressed || (tbcd.nmcd.uItemState & CDIS_SELECTED))
@ -1036,7 +1036,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc, DWORD dwBaseCustDr
stateId = (tbcd.nmcd.uItemState & CDIS_HOT) ? TS_HOTCHECKED : TS_HOT; stateId = (tbcd.nmcd.uItemState & CDIS_HOT) ? TS_HOTCHECKED : TS_HOT;
else if (tbcd.nmcd.uItemState & CDIS_HOT) else if (tbcd.nmcd.uItemState & CDIS_HOT)
stateId = TS_HOT; stateId = TS_HOT;
DrawThemeBackground (theme, hdc, TP_DROPDOWNBUTTON, stateId, &rcArrow, NULL); DrawThemeBackground (theme, hdc, TP_DROPDOWNBUTTON, stateId, &rcArrow, NULL);
DrawThemeBackground (theme, hdc, TP_SPLITBUTTONDROPDOWN, stateId, &rcArrow, NULL); DrawThemeBackground (theme, hdc, TP_SPLITBUTTONDROPDOWN, stateId, &rcArrow, NULL);
} }
@ -1704,7 +1704,7 @@ TOOLBAR_LayoutToolbar(HWND hwnd)
{ {
if (btnPtr->cx) if (btnPtr->cx)
cx = btnPtr->cx; cx = btnPtr->cx;
else if ((infoPtr->dwExStyle & TBSTYLE_EX_MIXEDBUTTONS) || else if ((infoPtr->dwExStyle & TBSTYLE_EX_MIXEDBUTTONS) ||
(btnPtr->fsStyle & BTNS_AUTOSIZE)) (btnPtr->fsStyle & BTNS_AUTOSIZE))
{ {
SIZE sz; SIZE sz;
@ -1729,7 +1729,7 @@ TOOLBAR_LayoutToolbar(HWND hwnd)
/* if size has been set manually then don't add on extra space /* if size has been set manually then don't add on extra space
* for the drop down arrow */ * for the drop down arrow */
if (!btnPtr->cx && hasDropDownArrows && if (!btnPtr->cx && hasDropDownArrows &&
((btnPtr->fsStyle & BTNS_DROPDOWN) || (btnPtr->fsStyle & BTNS_WHOLEDROPDOWN))) ((btnPtr->fsStyle & BTNS_DROPDOWN) || (btnPtr->fsStyle & BTNS_WHOLEDROPDOWN)))
cx += DDARROW_WIDTH; cx += DDARROW_WIDTH;
} }
@ -2353,7 +2353,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
break; break;
TRACE("WM_INITDIALOG style: %x iItem(%d) idCommand(%d) iString(%ld) %s\n", TRACE("WM_INITDIALOG style: %x iItem(%d) idCommand(%d) iString(%ld) %s\n",
nmtb.tbButton.fsStyle, i, nmtb.tbButton.fsStyle, i,
nmtb.tbButton.idCommand, nmtb.tbButton.idCommand,
nmtb.tbButton.iString, nmtb.tbButton.iString,
nmtb.tbButton.iString >= 0 ? debugstr_w(infoPtr->strings[nmtb.tbButton.iString]) nmtb.tbButton.iString >= 0 ? debugstr_w(infoPtr->strings[nmtb.tbButton.iString])
@ -2369,7 +2369,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
} }
else else
{ {
btnInfo = (PCUSTOMBUTTON)SendDlgItemMessageW (hwnd, btnInfo = (PCUSTOMBUTTON)SendDlgItemMessageW (hwnd,
IDC_TOOLBARBTN_LBOX, LB_GETITEMDATA, index, 0); IDC_TOOLBARBTN_LBOX, LB_GETITEMDATA, index, 0);
} }
@ -2378,10 +2378,10 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
if (lstrlenW(nmtb.pszText)) if (lstrlenW(nmtb.pszText))
lstrcpyW(btnInfo->text, nmtb.pszText); lstrcpyW(btnInfo->text, nmtb.pszText);
else if (nmtb.tbButton.iString >= 0 && else if (nmtb.tbButton.iString >= 0 &&
nmtb.tbButton.iString < infoPtr->nNumStrings) nmtb.tbButton.iString < infoPtr->nNumStrings)
{ {
lstrcpyW(btnInfo->text, lstrcpyW(btnInfo->text,
infoPtr->strings[nmtb.tbButton.iString]); infoPtr->strings[nmtb.tbButton.iString]);
} }
} }
@ -2605,9 +2605,9 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* draw image and text */ /* draw image and text */
if ((btnInfo->btn.fsStyle & BTNS_SEP) == 0) { if ((btnInfo->btn.fsStyle & BTNS_SEP) == 0) {
HIMAGELIST himl = GETDEFIMAGELIST(infoPtr, GETHIMLID(infoPtr, HIMAGELIST himl = GETDEFIMAGELIST(infoPtr, GETHIMLID(infoPtr,
btnInfo->btn.iBitmap)); btnInfo->btn.iBitmap));
ImageList_Draw (himl, GETIBITMAP(infoPtr, btnInfo->btn.iBitmap), ImageList_Draw (himl, GETIBITMAP(infoPtr, btnInfo->btn.iBitmap),
lpdis->hDC, rcButton.left+3, rcButton.top+3, ILD_NORMAL); lpdis->hDC, rcButton.left+3, rcButton.top+3, ILD_NORMAL);
} }
DrawTextW (lpdis->hDC, btnInfo->text, -1, &rcText, DrawTextW (lpdis->hDC, btnInfo->text, -1, &rcText,
@ -2677,12 +2677,12 @@ TOOLBAR_AddBitmapToImageList(TOOLBAR_INFO *infoPtr, HIMAGELIST himlDef, const TB
ImageList_GetIconSize(himlDef, &cxIcon, &cyIcon); ImageList_GetIconSize(himlDef, &cxIcon, &cyIcon);
if (bitmap->hInst != COMCTL32_hModule) if (bitmap->hInst != COMCTL32_hModule)
COMCTL32_EnsureBitmapSize(&hbmLoad, cxIcon*(INT)bitmap->nButtons, cyIcon, comctl32_color.clrBtnFace); COMCTL32_EnsureBitmapSize(&hbmLoad, cxIcon*(INT)bitmap->nButtons, cyIcon, comctl32_color.clrBtnFace);
nIndex = ImageList_AddMasked(himlDef, hbmLoad, comctl32_color.clrBtnFace); nIndex = ImageList_AddMasked(himlDef, hbmLoad, comctl32_color.clrBtnFace);
DeleteObject(hbmLoad); DeleteObject(hbmLoad);
if (nIndex == -1) if (nIndex == -1)
return FALSE; return FALSE;
nCountAfter = ImageList_GetImageCount(himlDef); nCountAfter = ImageList_GetImageCount(himlDef);
nAdded = nCountAfter - nCountBefore; nAdded = nCountAfter - nCountBefore;
if (bitmap->nButtons == 0) /* wParam == 0 is special and means add only one image */ if (bitmap->nButtons == 0) /* wParam == 0 is special and means add only one image */
@ -2704,7 +2704,7 @@ TOOLBAR_CheckImageListIconSize(TOOLBAR_INFO *infoPtr)
HIMAGELIST himlNew; HIMAGELIST himlNew;
INT cx, cy; INT cx, cy;
INT i; INT i;
himlDef = GETDEFIMAGELIST(infoPtr, 0); himlDef = GETDEFIMAGELIST(infoPtr, 0);
if (himlDef == NULL || himlDef != infoPtr->himlInt) if (himlDef == NULL || himlDef != infoPtr->himlInt)
return; return;
@ -2800,7 +2800,7 @@ TOOLBAR_AddBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
info.nID = lpAddBmp->nID; info.nID = lpAddBmp->nID;
TRACE("adding %d bitmaps!\n", info.nButtons); TRACE("adding %d bitmaps!\n", info.nButtons);
} }
/* check if the bitmap is already loaded and compute iSumButtons */ /* check if the bitmap is already loaded and compute iSumButtons */
iSumButtons = 0; iSumButtons = 0;
for (i = 0; i < infoPtr->nNumBitmapInfos; i++) for (i = 0; i < infoPtr->nNumBitmapInfos; i++)
@ -3051,7 +3051,7 @@ TOOLBAR_AutoSize (HWND hwnd)
if (infoPtr->dwStyle & CCS_NOPARENTALIGN) if (infoPtr->dwStyle & CCS_NOPARENTALIGN)
uPosFlags |= SWP_NOMOVE; uPosFlags |= SWP_NOMOVE;
if (!(infoPtr->dwStyle & CCS_NODIVIDER)) if (!(infoPtr->dwStyle & CCS_NODIVIDER))
cy += GetSystemMetrics(SM_CYEDGE); cy += GetSystemMetrics(SM_CYEDGE);
@ -3934,10 +3934,10 @@ TOOLBAR_MapAccelerator (HWND hwnd, WPARAM wParam, LPARAM lParam)
UINT* pIDButton = (UINT*)lParam; UINT* pIDButton = (UINT*)lParam;
WCHAR wszAccel[] = {'&',wAccel,0}; WCHAR wszAccel[] = {'&',wAccel,0};
int i; int i;
TRACE("hwnd = %p, wAccel = %x(%s), pIDButton = %p\n", TRACE("hwnd = %p, wAccel = %x(%s), pIDButton = %p\n",
hwnd, wAccel, debugstr_wn(&wAccel,1), pIDButton); hwnd, wAccel, debugstr_wn(&wAccel,1), pIDButton);
for (i = 0; i < infoPtr->nNumButtons; i++) for (i = 0; i < infoPtr->nNumButtons; i++)
{ {
TBUTTON_INFO *btnPtr = infoPtr->buttons+i; TBUTTON_INFO *btnPtr = infoPtr->buttons+i;
@ -3946,7 +3946,7 @@ TOOLBAR_MapAccelerator (HWND hwnd, WPARAM wParam, LPARAM lParam)
{ {
int iLen = strlenW(wszAccel); int iLen = strlenW(wszAccel);
LPCWSTR lpszStr = TOOLBAR_GetText(infoPtr, btnPtr); LPCWSTR lpszStr = TOOLBAR_GetText(infoPtr, btnPtr);
if (!lpszStr) if (!lpszStr)
continue; continue;
@ -4142,7 +4142,7 @@ TOOLBAR_ReplaceBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
WARN("No hinst/bitmap found! hInst %p nID %lx\n", lpReplace->hInstOld, lpReplace->nIDOld); WARN("No hinst/bitmap found! hInst %p nID %lx\n", lpReplace->hInstOld, lpReplace->nIDOld);
return FALSE; return FALSE;
} }
/* copy the bitmap before adding it as ImageList_AddMasked modifies the /* copy the bitmap before adding it as ImageList_AddMasked modifies the
* bitmap * bitmap
*/ */
@ -4272,7 +4272,7 @@ TOOLBAR_Restore(TOOLBAR_INFO *infoPtr, const TBSAVEPARAMSW *lpSave)
nmtbr.tbButton.idCommand = (int)*nmtbr.pCurrent; nmtbr.tbButton.idCommand = (int)*nmtbr.pCurrent;
nmtbr.pCurrent++; nmtbr.pCurrent++;
TOOLBAR_SendNotify(&nmtbr.hdr, infoPtr, TBN_RESTORE); TOOLBAR_SendNotify(&nmtbr.hdr, infoPtr, TBN_RESTORE);
/* can't contain real string as we don't know whether /* can't contain real string as we don't know whether
@ -4546,13 +4546,13 @@ TOOLBAR_SetButtonSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
*/ */
if (cx == 0) cx = 24; if (cx == 0) cx = 24;
if (cy == 0) cx = 22; if (cy == 0) cx = 22;
cx = max(cx, infoPtr->szPadding.cx + infoPtr->nBitmapWidth); cx = max(cx, infoPtr->szPadding.cx + infoPtr->nBitmapWidth);
cy = max(cy, infoPtr->szPadding.cy + infoPtr->nBitmapHeight); cy = max(cy, infoPtr->szPadding.cy + infoPtr->nBitmapHeight);
infoPtr->nButtonWidth = cx; infoPtr->nButtonWidth = cx;
infoPtr->nButtonHeight = cy; infoPtr->nButtonHeight = cy;
infoPtr->iTopMargin = default_top_margin(infoPtr); infoPtr->iTopMargin = default_top_margin(infoPtr);
TOOLBAR_LayoutToolbar(hwnd); TOOLBAR_LayoutToolbar(hwnd);
return TRUE; return TRUE;
@ -4622,7 +4622,7 @@ TOOLBAR_SetDisabledImageList (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (infoPtr->iVersion >= 5) if (infoPtr->iVersion >= 5)
id = wParam; id = wParam;
himlTemp = TOOLBAR_InsertImageList(&infoPtr->himlDis, himlTemp = TOOLBAR_InsertImageList(&infoPtr->himlDis,
&infoPtr->cimlDis, himl, id); &infoPtr->cimlDis, himl, id);
/* FIXME: redraw ? */ /* FIXME: redraw ? */
@ -4691,7 +4691,7 @@ TOOLBAR_SetHotImageList (HWND hwnd, WPARAM wParam, LPARAM lParam)
TRACE("hwnd = %p, himl = %p, id = %d\n", hwnd, himl, id); TRACE("hwnd = %p, himl = %p, id = %d\n", hwnd, himl, id);
himlTemp = TOOLBAR_InsertImageList(&infoPtr->himlHot, himlTemp = TOOLBAR_InsertImageList(&infoPtr->himlHot,
&infoPtr->cimlHot, himl, id); &infoPtr->cimlHot, himl, id);
/* FIXME: redraw ? */ /* FIXME: redraw ? */
@ -4752,7 +4752,7 @@ TOOLBAR_SetHotItemEx (TOOLBAR_INFO *infoPtr, INT nHit, DWORD dwReason)
infoPtr->nHotItem = nHit; infoPtr->nHotItem = nHit;
} }
else else
infoPtr->nHotItem = -1; infoPtr->nHotItem = -1;
} }
} }
} }
@ -4767,7 +4767,7 @@ TOOLBAR_SetHotItem (HWND hwnd, WPARAM wParam)
if ((INT)wParam > infoPtr->nNumButtons) if ((INT)wParam > infoPtr->nNumButtons)
return infoPtr->nHotItem; return infoPtr->nHotItem;
if ((INT)wParam < 0) if ((INT)wParam < 0)
wParam = -1; wParam = -1;
@ -4795,7 +4795,7 @@ TOOLBAR_SetImageList (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (infoPtr->iVersion >= 5) if (infoPtr->iVersion >= 5)
id = wParam; id = wParam;
himlTemp = TOOLBAR_InsertImageList(&infoPtr->himlDef, himlTemp = TOOLBAR_InsertImageList(&infoPtr->himlDef,
&infoPtr->cimlDef, himl, id); &infoPtr->cimlDef, himl, id);
infoPtr->nNumBitmaps = 0; infoPtr->nNumBitmaps = 0;
@ -4857,7 +4857,7 @@ TOOLBAR_SetInsertMark (HWND hwnd, WPARAM wParam, LPARAM lParam)
return 0; return 0;
} }
if ((lptbim->iButton == -1) || if ((lptbim->iButton == -1) ||
((lptbim->iButton < infoPtr->nNumButtons) && ((lptbim->iButton < infoPtr->nNumButtons) &&
(lptbim->iButton >= 0))) (lptbim->iButton >= 0)))
{ {
@ -4902,8 +4902,8 @@ TOOLBAR_SetMaxTextRows (HWND hwnd, WPARAM wParam, LPARAM lParam)
* 1. It is not only used on buttons with the BTNS_AUTOSIZE style * 1. It is not only used on buttons with the BTNS_AUTOSIZE style
* 2. It is not used to create a blank area between the edge of the button * 2. It is not used to create a blank area between the edge of the button
* and the text or image if TBSTYLE_LIST is set. It is used to control * and the text or image if TBSTYLE_LIST is set. It is used to control
* the gap between the image and text. * the gap between the image and text.
* 3. It is not applied to both sides. If TBSTYLE_LIST is set it is used * 3. It is not applied to both sides. If TBSTYLE_LIST is set it is used
* to control the bottom and right borders [with the border being * to control the bottom and right borders [with the border being
* szPadding.cx - (GetSystemMetrics(SM_CXEDGE)+1)], otherwise the padding * szPadding.cx - (GetSystemMetrics(SM_CXEDGE)+1)], otherwise the padding
* is shared evenly on both sides of the button. * is shared evenly on both sides of the button.
@ -5269,10 +5269,10 @@ static LRESULT TOOLBAR_Unkwn460(HWND hwnd, WPARAM wParam, LPARAM lParam)
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(hwnd); TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(hwnd);
TRACE("hwnd=%p iListGap=%ld\n", hwnd, wParam); TRACE("hwnd=%p iListGap=%ld\n", hwnd, wParam);
if (lParam != 0) if (lParam != 0)
FIXME("lParam = 0x%08lx. Please report\n", lParam); FIXME("lParam = 0x%08lx. Please report\n", lParam);
infoPtr->iListGap = (INT)wParam; infoPtr->iListGap = (INT)wParam;
InvalidateRect(hwnd, NULL, TRUE); InvalidateRect(hwnd, NULL, TRUE);
@ -5395,13 +5395,13 @@ TOOLBAR_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr->dwStyle = dwStyle; infoPtr->dwStyle = dwStyle;
infoPtr->tbim.iButton = -1; infoPtr->tbim.iButton = -1;
GetClientRect(hwnd, &infoPtr->client_rect); GetClientRect(hwnd, &infoPtr->client_rect);
infoPtr->bUnicode = infoPtr->hwndNotify && infoPtr->bUnicode = infoPtr->hwndNotify &&
(NFR_UNICODE == SendMessageW(hwnd, WM_NOTIFYFORMAT, (WPARAM)hwnd, (LPARAM)NF_REQUERY)); (NFR_UNICODE == SendMessageW(hwnd, WM_NOTIFYFORMAT, (WPARAM)hwnd, (LPARAM)NF_REQUERY));
infoPtr->hwndToolTip = NULL; /* if needed the tooltip control will be created after a WM_MOUSEMOVE */ infoPtr->hwndToolTip = NULL; /* if needed the tooltip control will be created after a WM_MOUSEMOVE */
SystemParametersInfoW (SPI_GETICONTITLELOGFONT, 0, &logFont, 0); SystemParametersInfoW (SPI_GETICONTITLELOGFONT, 0, &logFont, 0);
infoPtr->hFont = infoPtr->hDefaultFont = CreateFontIndirectW (&logFont); infoPtr->hFont = infoPtr->hDefaultFont = CreateFontIndirectW (&logFont);
OpenThemeData (hwnd, themeClass); OpenThemeData (hwnd, themeClass);
TOOLBAR_CheckStyle (hwnd, dwStyle); TOOLBAR_CheckStyle (hwnd, dwStyle);
@ -5430,8 +5430,7 @@ TOOLBAR_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (infoPtr->strings) { if (infoPtr->strings) {
INT i; INT i;
for (i = 0; i < infoPtr->nNumStrings; i++) for (i = 0; i < infoPtr->nNumStrings; i++)
if (infoPtr->strings[i]) Free (infoPtr->strings[i]);
Free (infoPtr->strings[i]);
Free (infoPtr->strings); Free (infoPtr->strings);
} }
@ -5446,7 +5445,7 @@ TOOLBAR_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
/* delete default font */ /* delete default font */
DeleteObject (infoPtr->hDefaultFont); DeleteObject (infoPtr->hDefaultFont);
CloseThemeData (GetWindowTheme (hwnd)); CloseThemeData (GetWindowTheme (hwnd));
/* free toolbar info data */ /* free toolbar info data */
@ -5556,7 +5555,7 @@ TOOLBAR_SetRelativeHotItem(TOOLBAR_INFO *infoPtr, INT iDirection, DWORD dwReason
nmtbwhi.idNew = infoPtr->buttons[nNewHotItem].idCommand; nmtbwhi.idNew = infoPtr->buttons[nNewHotItem].idCommand;
nmtbwhi.iDirection = iDirection; nmtbwhi.iDirection = iDirection;
nmtbwhi.dwReason = dwReason; nmtbwhi.dwReason = dwReason;
if (TOOLBAR_SendNotify(&nmtbwhi.hdr, infoPtr, TBN_WRAPHOTITEM)) if (TOOLBAR_SendNotify(&nmtbwhi.hdr, infoPtr, TBN_WRAPHOTITEM))
return; return;
} }
@ -5662,7 +5661,7 @@ TOOLBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
{ {
infoPtr->nButtonDrag = nHit; infoPtr->nButtonDrag = nHit;
SetCapture (hwnd); SetCapture (hwnd);
/* If drag cursor has not been loaded, load it. /* If drag cursor has not been loaded, load it.
* Note: it doesn't need to be freed */ * Note: it doesn't need to be freed */
if (!hCursorDrag) if (!hCursorDrag)
@ -5678,7 +5677,7 @@ TOOLBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
arrowRect.left = max(btnPtr->rect.left, btnPtr->rect.right - DDARROW_WIDTH); arrowRect.left = max(btnPtr->rect.left, btnPtr->rect.right - DDARROW_WIDTH);
/* for EX_DRAWDDARROWS style, click must be in the drop-down arrow rect */ /* for EX_DRAWDDARROWS style, click must be in the drop-down arrow rect */
if ((btnPtr->fsState & TBSTATE_ENABLED) && if ((btnPtr->fsState & TBSTATE_ENABLED) &&
((btnPtr->fsStyle & BTNS_WHOLEDROPDOWN) || ((btnPtr->fsStyle & BTNS_WHOLEDROPDOWN) ||
((btnPtr->fsStyle & BTNS_DROPDOWN) && ((btnPtr->fsStyle & BTNS_DROPDOWN) &&
((TOOLBAR_HasDropDownArrows(infoPtr->dwExStyle) && PtInRect(&arrowRect, pt)) || ((TOOLBAR_HasDropDownArrows(infoPtr->dwExStyle) && PtInRect(&arrowRect, pt)) ||
@ -5719,7 +5718,7 @@ TOOLBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
nHit = TOOLBAR_InternalHitTest(hwnd, &pt); nHit = TOOLBAR_InternalHitTest(hwnd, &pt);
if (!infoPtr->bAnchor || (nHit >= 0)) if (!infoPtr->bAnchor || (nHit >= 0))
TOOLBAR_SetHotItemEx(infoPtr, nHit, HICF_MOUSE | HICF_LMOUSE); TOOLBAR_SetHotItemEx(infoPtr, nHit, HICF_MOUSE | HICF_LMOUSE);
/* remove any left mouse button down or double-click messages /* remove any left mouse button down or double-click messages
* so that we can get a toggle effect on the button */ * so that we can get a toggle effect on the button */
while (PeekMessageW(&msg, hwnd, WM_LBUTTONDOWN, WM_LBUTTONDOWN, PM_REMOVE) || while (PeekMessageW(&msg, hwnd, WM_LBUTTONDOWN, WM_LBUTTONDOWN, PM_REMOVE) ||
@ -5762,7 +5761,7 @@ TOOLBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
nmmouse.dwItemData = infoPtr->buttons[nmmouse.dwHitInfo].dwData; nmmouse.dwItemData = infoPtr->buttons[nmmouse.dwHitInfo].dwData;
} }
ClientToScreen(hwnd, &pt); ClientToScreen(hwnd, &pt);
nmmouse.pt = pt; nmmouse.pt = pt;
if (!TOOLBAR_SendNotify(&nmmouse.hdr, infoPtr, NM_LDOWN)) if (!TOOLBAR_SendNotify(&nmmouse.hdr, infoPtr, NM_LDOWN))
@ -5928,7 +5927,7 @@ TOOLBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
nmmouse.dwItemData = infoPtr->buttons[nmmouse.dwHitInfo].dwData; nmmouse.dwItemData = infoPtr->buttons[nmmouse.dwHitInfo].dwData;
} }
ClientToScreen(hwnd, &pt); ClientToScreen(hwnd, &pt);
nmmouse.pt = pt; nmmouse.pt = pt;
if (!TOOLBAR_SendNotify((LPNMHDR)&nmmouse, infoPtr, NM_CLICK)) if (!TOOLBAR_SendNotify((LPNMHDR)&nmmouse, infoPtr, NM_CLICK))
@ -5958,7 +5957,7 @@ TOOLBAR_RButtonUp( HWND hwnd, WPARAM wParam, LPARAM lParam)
nmmouse.dwItemData = infoPtr->buttons[nmmouse.dwHitInfo].dwData; nmmouse.dwItemData = infoPtr->buttons[nmmouse.dwHitInfo].dwData;
} }
ClientToScreen(hwnd, &pt); ClientToScreen(hwnd, &pt);
nmmouse.pt = pt; nmmouse.pt = pt;
if (!TOOLBAR_SendNotify((LPNMHDR)&nmmouse, infoPtr, NM_RCLICK)) if (!TOOLBAR_SendNotify((LPNMHDR)&nmmouse, infoPtr, NM_RCLICK))
@ -6055,10 +6054,10 @@ TOOLBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
TRACKMOUSEEVENT trackinfo; TRACKMOUSEEVENT trackinfo;
INT nHit; INT nHit;
TBUTTON_INFO *btnPtr; TBUTTON_INFO *btnPtr;
if ((infoPtr->dwStyle & TBSTYLE_TOOLTIPS) && (infoPtr->hwndToolTip == NULL)) if ((infoPtr->dwStyle & TBSTYLE_TOOLTIPS) && (infoPtr->hwndToolTip == NULL))
TOOLBAR_TooltipCreateControl(infoPtr); TOOLBAR_TooltipCreateControl(infoPtr);
if ((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf)) { if ((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf)) {
/* fill in the TRACKMOUSEEVENT struct */ /* fill in the TRACKMOUSEEVENT struct */
trackinfo.cbSize = sizeof(TRACKMOUSEEVENT); trackinfo.cbSize = sizeof(TRACKMOUSEEVENT);
@ -6087,7 +6086,7 @@ TOOLBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
nHit = TOOLBAR_InternalHitTest (hwnd, &pt); nHit = TOOLBAR_InternalHitTest (hwnd, &pt);
if (((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf)) if (((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf))
&& (!infoPtr->bAnchor || (nHit >= 0))) && (!infoPtr->bAnchor || (nHit >= 0)))
TOOLBAR_SetHotItemEx(infoPtr, nHit, HICF_MOUSE); TOOLBAR_SetHotItemEx(infoPtr, nHit, HICF_MOUSE);
@ -6208,7 +6207,7 @@ TOOLBAR_NCCreate (HWND hwnd, WPARAM wParam, LPARAM lParam)
* (Guy Albertelli 9/2001) * (Guy Albertelli 9/2001)
* *
*/ */
if (((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf)) if (((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf))
&& !(cs->style & TBSTYLE_TRANSPARENT)) && !(cs->style & TBSTYLE_TRANSPARENT))
styleadd |= TBSTYLE_TRANSPARENT; styleadd |= TBSTYLE_TRANSPARENT;
if (!(cs->style & (CCS_TOP | CCS_NOMOVEY))) { if (!(cs->style & (CCS_TOP | CCS_NOMOVEY))) {
@ -6333,7 +6332,7 @@ static LRESULT TOOLBAR_TTGetDispInfo (TOOLBAR_INFO *infoPtr, NMTTDISPINFOW *lpnm
return 0; return 0;
} }
} }
else if (len > 0) else if (tbgit.pszText[0])
{ {
MultiByteToWideChar(CP_ACP, 0, tbgit.pszText, -1, MultiByteToWideChar(CP_ACP, 0, tbgit.pszText, -1,
lpnmtdi->lpszText, sizeof(lpnmtdi->szText)/sizeof(lpnmtdi->szText[0])); lpnmtdi->lpszText, sizeof(lpnmtdi->szText)/sizeof(lpnmtdi->szText[0]));
@ -6375,7 +6374,7 @@ static LRESULT TOOLBAR_TTGetDispInfo (TOOLBAR_INFO *infoPtr, NMTTDISPINFOW *lpnm
/* last resort: send notification on to app */ /* last resort: send notification on to app */
/* FIXME: find out what is really used here */ /* FIXME: find out what is really used here */
return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, 0, (LPARAM)lpnmtdi); return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, (WPARAM)lpnmtdi->hdr.idFrom, (LPARAM)lpnmtdi);
} }
@ -6493,9 +6492,9 @@ static LRESULT
TOOLBAR_SetFont(HWND hwnd, WPARAM wParam, LPARAM lParam) TOOLBAR_SetFont(HWND hwnd, WPARAM wParam, LPARAM lParam)
{ {
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(hwnd); TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(hwnd);
TRACE("font=%p redraw=%ld\n", (HFONT)wParam, lParam); TRACE("font=%p redraw=%ld\n", (HFONT)wParam, lParam);
if (wParam == 0) if (wParam == 0)
infoPtr->hFont = infoPtr->hDefaultFont; infoPtr->hFont = infoPtr->hDefaultFont;
else else
@ -6616,7 +6615,7 @@ TOOLBAR_StyleChanged (HWND hwnd, INT nType, const STYLESTRUCT *lpStyle)
if ((dwOldStyle ^ lpStyle->styleNew) & COMMON_STYLES) if ((dwOldStyle ^ lpStyle->styleNew) & COMMON_STYLES)
{ {
TOOLBAR_AutoSize (hwnd); TOOLBAR_AutoSize (hwnd);
InvalidateRect(hwnd, NULL, TRUE); InvalidateRect(hwnd, NULL, TRUE);
} }
} }
@ -7034,7 +7033,7 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_SYSCOLORCHANGE: case WM_SYSCOLORCHANGE:
return TOOLBAR_SysColorChange (hwnd); return TOOLBAR_SysColorChange (hwnd);
case WM_THEMECHANGED: case WM_THEMECHANGED:
return theme_changed (hwnd); return theme_changed (hwnd);
@ -7183,7 +7182,7 @@ static BOOL TOOLBAR_GetButtonInfo(const TOOLBAR_INFO *infoPtr, NMTOOLBARW *nmtb)
{ {
int ccht = strlen(nmtba.pszText); int ccht = strlen(nmtba.pszText);
if (ccht) if (ccht)
MultiByteToWideChar(CP_ACP, 0, (LPCSTR)nmtba.pszText, -1, MultiByteToWideChar(CP_ACP, 0, (LPCSTR)nmtba.pszText, -1,
nmtb->pszText, nmtb->cchText); nmtb->pszText, nmtb->cchText);
memcpy(&nmtb->tbButton, &nmtba.tbButton, sizeof(TBBUTTON)); memcpy(&nmtb->tbButton, &nmtba.tbButton, sizeof(TBBUTTON));

View file

@ -22,11 +22,11 @@
* *
* This code was audited for completeness against the documented features * This code was audited for completeness against the documented features
* of Comctl32.dll version 6.0 on Sep. 08, 2004, by Robert Shearman. * of Comctl32.dll version 6.0 on Sep. 08, 2004, by Robert Shearman.
* *
* Unless otherwise noted, we believe this code to be complete, as per * Unless otherwise noted, we believe this code to be complete, as per
* the specification mentioned above. * the specification mentioned above.
* If you discover missing features or bugs please note them below. * If you discover missing features or bugs please note them below.
* *
* TODO: * TODO:
* - Custom draw support. * - Custom draw support.
* - Animation. * - Animation.
@ -261,7 +261,7 @@ TOOLTIPS_Refresh (HWND hwnd, HDC hdc)
BOOL icon_present; BOOL icon_present;
/* draw icon */ /* draw icon */
icon_present = infoPtr->hTitleIcon && icon_present = infoPtr->hTitleIcon &&
DrawIconEx(hdc, rc.left, rc.top, infoPtr->hTitleIcon, DrawIconEx(hdc, rc.left, rc.top, infoPtr->hTitleIcon,
ICON_WIDTH, ICON_HEIGHT, 0, NULL, DI_NORMAL); ICON_WIDTH, ICON_HEIGHT, 0, NULL, DI_NORMAL);
if (icon_present) if (icon_present)
@ -515,7 +515,7 @@ TOOLTIPS_CalcTipSize (HWND hwnd, const TOOLTIPS_INFO *infoPtr, LPSIZE lpSize)
static void static void
TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr) TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr, BOOL track_activate)
{ {
TTTOOL_INFO *toolPtr; TTTOOL_INFO *toolPtr;
HMONITOR monitor; HMONITOR monitor;
@ -525,25 +525,40 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr)
NMHDR hdr; NMHDR hdr;
int ptfx = 0; int ptfx = 0;
DWORD style = GetWindowLongW(hwnd, GWL_STYLE); DWORD style = GetWindowLongW(hwnd, GWL_STYLE);
INT nTool;
if (infoPtr->nTool == -1) { if (track_activate)
TRACE("invalid tool (-1)!\n"); {
return; if (infoPtr->nTrackTool == -1)
{
TRACE("invalid tracking tool (-1)!\n");
return;
}
nTool = infoPtr->nTrackTool;
}
else
{
if (infoPtr->nTool == -1)
{
TRACE("invalid tool (-1)!\n");
return;
}
nTool = infoPtr->nTool;
} }
infoPtr->nCurrentTool = infoPtr->nTool; TRACE("Show tooltip pre %d! (%p)\n", nTool, hwnd);
TRACE("Show tooltip pre %d! (%p)\n", infoPtr->nTool, hwnd); TOOLTIPS_GetTipText (hwnd, infoPtr, nTool);
TOOLTIPS_GetTipText (hwnd, infoPtr, infoPtr->nCurrentTool); if (infoPtr->szTipText[0] == '\0')
return;
if (infoPtr->szTipText[0] == '\0') { toolPtr = &infoPtr->tools[nTool];
infoPtr->nCurrentTool = -1;
return;
}
TRACE("Show tooltip %d!\n", infoPtr->nCurrentTool); if (!track_activate)
toolPtr = &infoPtr->tools[infoPtr->nCurrentTool]; infoPtr->nCurrentTool = infoPtr->nTool;
TRACE("Show tooltip %d!\n", nTool);
hdr.hwndFrom = hwnd; hdr.hwndFrom = hwnd;
hdr.idFrom = toolPtr->uId; hdr.idFrom = toolPtr->uId;
@ -556,61 +571,103 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr)
TOOLTIPS_CalcTipSize (hwnd, infoPtr, &size); TOOLTIPS_CalcTipSize (hwnd, infoPtr, &size);
TRACE("size %d x %d\n", size.cx, size.cy); TRACE("size %d x %d\n", size.cx, size.cy);
if (toolPtr->uFlags & TTF_CENTERTIP) { if (track_activate)
RECT rc; {
rect.left = infoPtr->xTrackPos;
rect.top = infoPtr->yTrackPos;
ptfx = rect.left;
if (toolPtr->uFlags & TTF_IDISHWND) if (toolPtr->uFlags & TTF_CENTERTIP)
GetWindowRect ((HWND)toolPtr->uId, &rc);
else {
rc = toolPtr->rect;
MapWindowPoints (toolPtr->hwnd, NULL, (LPPOINT)&rc, 2);
}
rect.left = (rc.left + rc.right - size.cx) / 2;
if (style & TTS_BALLOON)
{
ptfx = rc.left + ((rc.right - rc.left) / 2);
/* CENTERTIP ballon tooltips default to below the field
if they fit on the screen */
if(rc.bottom + size.cy > GetSystemMetrics(SM_CYSCREEN))
{
rect.top = rc.top - size.cy;
infoPtr->bToolBelow = FALSE;
}
else
{
infoPtr->bToolBelow = TRUE;
rect.top = rc.bottom;
}
rect.left = max(0, rect.left - BALLOON_STEMINDENT);
}
else
{ {
rect.top = rc.bottom + 2; rect.left -= (size.cx / 2);
infoPtr->bToolBelow = TRUE; if (!(style & TTS_BALLOON))
rect.top -= (size.cy / 2);
}
infoPtr->bToolBelow = TRUE;
if (!(toolPtr->uFlags & TTF_ABSOLUTE))
{
if (style & TTS_BALLOON)
rect.left -= BALLOON_STEMINDENT;
else
{
RECT rcTool;
if (toolPtr->uFlags & TTF_IDISHWND)
GetWindowRect ((HWND)toolPtr->uId, &rcTool);
else
{
rcTool = toolPtr->rect;
MapWindowPoints (toolPtr->hwnd, NULL, (LPPOINT)&rcTool, 2);
}
/* smart placement */
if ((rect.left + size.cx > rcTool.left) && (rect.left < rcTool.right) &&
(rect.top + size.cy > rcTool.top) && (rect.top < rcTool.bottom))
rect.left = rcTool.right;
}
} }
} }
else { else
GetCursorPos ((LPPOINT)&rect); {
if (style & TTS_BALLOON) if (toolPtr->uFlags & TTF_CENTERTIP)
{ {
ptfx = rect.left; RECT rc;
if(rect.top - size.cy >= 0)
if (toolPtr->uFlags & TTF_IDISHWND)
GetWindowRect ((HWND)toolPtr->uId, &rc);
else {
rc = toolPtr->rect;
MapWindowPoints (toolPtr->hwnd, NULL, (LPPOINT)&rc, 2);
}
rect.left = (rc.left + rc.right - size.cx) / 2;
if (style & TTS_BALLOON)
{ {
rect.top -= size.cy; ptfx = rc.left + ((rc.right - rc.left) / 2);
infoPtr->bToolBelow = FALSE;
/* CENTERTIP ballon tooltips default to below the field
* if they fit on the screen */
if (rc.bottom + size.cy > GetSystemMetrics(SM_CYSCREEN))
{
rect.top = rc.top - size.cy;
infoPtr->bToolBelow = FALSE;
}
else
{
infoPtr->bToolBelow = TRUE;
rect.top = rc.bottom;
}
rect.left = max(0, rect.left - BALLOON_STEMINDENT);
} }
else else
{ {
infoPtr->bToolBelow = TRUE; rect.top = rc.bottom + 2;
rect.top += 20; infoPtr->bToolBelow = TRUE;
} }
rect.left = max(0, rect.left - BALLOON_STEMINDENT);
} }
else else
{ {
rect.top += 20; GetCursorPos ((LPPOINT)&rect);
infoPtr->bToolBelow = TRUE; if (style & TTS_BALLOON)
{
ptfx = rect.left;
if(rect.top - size.cy >= 0)
{
rect.top -= size.cy;
infoPtr->bToolBelow = FALSE;
}
else
{
infoPtr->bToolBelow = TRUE;
rect.top += 20;
}
rect.left = max(0, rect.left - BALLOON_STEMINDENT);
}
else
{
rect.top += 20;
infoPtr->bToolBelow = TRUE;
}
} }
} }
@ -685,7 +742,7 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr)
} }
hrStem = CreatePolygonRgn(pts, sizeof(pts) / sizeof(pts[0]), ALTERNATE); hrStem = CreatePolygonRgn(pts, sizeof(pts) / sizeof(pts[0]), ALTERNATE);
hRgn = CreateRoundRectRgn(0, hRgn = CreateRoundRectRgn(0,
(infoPtr->bToolBelow ? BALLOON_STEMHEIGHT : 0), (infoPtr->bToolBelow ? BALLOON_STEMHEIGHT : 0),
rect.right - rect.left, rect.right - rect.left,
@ -696,7 +753,7 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr)
DeleteObject(hrStem); DeleteObject(hrStem);
SetWindowRgn(hwnd, hRgn, FALSE); SetWindowRgn(hwnd, hRgn, FALSE);
/* we don't free the region handle as the system deletes it when /* we don't free the region handle as the system deletes it when
* it is no longer needed */ * it is no longer needed */
} }
@ -708,10 +765,13 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr)
InvalidateRect(hwnd, NULL, TRUE); InvalidateRect(hwnd, NULL, TRUE);
UpdateWindow(hwnd); UpdateWindow(hwnd);
SetTimer (hwnd, ID_TIMERPOP, infoPtr->nAutoPopTime, 0); if (!track_activate)
TRACE("timer 2 started!\n"); {
SetTimer (hwnd, ID_TIMERLEAVE, infoPtr->nReshowTime, 0); SetTimer (hwnd, ID_TIMERPOP, infoPtr->nAutoPopTime, 0);
TRACE("timer 3 started!\n"); TRACE("timer 2 started!\n");
SetTimer (hwnd, ID_TIMERLEAVE, infoPtr->nReshowTime, 0);
TRACE("timer 3 started!\n");
}
} }
@ -745,98 +805,7 @@ TOOLTIPS_Hide (HWND hwnd, TOOLTIPS_INFO *infoPtr)
static void static void
TOOLTIPS_TrackShow (HWND hwnd, TOOLTIPS_INFO *infoPtr) TOOLTIPS_TrackShow (HWND hwnd, TOOLTIPS_INFO *infoPtr)
{ {
TTTOOL_INFO *toolPtr; TOOLTIPS_Show(hwnd, infoPtr, TRUE);
RECT rect;
SIZE size;
NMHDR hdr;
if (infoPtr->nTrackTool == -1) {
TRACE("invalid tracking tool (-1)!\n");
return;
}
TRACE("show tracking tooltip pre %d!\n", infoPtr->nTrackTool);
TOOLTIPS_GetTipText (hwnd, infoPtr, infoPtr->nTrackTool);
if (infoPtr->szTipText[0] == '\0') {
infoPtr->nTrackTool = -1;
return;
}
TRACE("show tracking tooltip %d!\n", infoPtr->nTrackTool);
toolPtr = &infoPtr->tools[infoPtr->nTrackTool];
hdr.hwndFrom = hwnd;
hdr.idFrom = toolPtr->uId;
hdr.code = TTN_SHOW;
SendMessageW (toolPtr->hwnd, WM_NOTIFY,
(WPARAM)toolPtr->uId, (LPARAM)&hdr);
TRACE("%s\n", debugstr_w(infoPtr->szTipText));
TOOLTIPS_CalcTipSize (hwnd, infoPtr, &size);
TRACE("size %d x %d\n", size.cx, size.cy);
if (toolPtr->uFlags & TTF_ABSOLUTE) {
rect.left = infoPtr->xTrackPos;
rect.top = infoPtr->yTrackPos;
if (toolPtr->uFlags & TTF_CENTERTIP) {
rect.left -= (size.cx / 2);
rect.top -= (size.cy / 2);
}
}
else {
RECT rcTool;
if (toolPtr->uFlags & TTF_IDISHWND)
GetWindowRect ((HWND)toolPtr->uId, &rcTool);
else {
rcTool = toolPtr->rect;
MapWindowPoints (toolPtr->hwnd, NULL, (LPPOINT)&rcTool, 2);
}
GetCursorPos ((LPPOINT)&rect);
rect.top += 20;
if (toolPtr->uFlags & TTF_CENTERTIP) {
rect.left -= (size.cx / 2);
rect.top -= (size.cy / 2);
}
/* smart placement */
if ((rect.left + size.cx > rcTool.left) && (rect.left < rcTool.right) &&
(rect.top + size.cy > rcTool.top) && (rect.top < rcTool.bottom))
rect.left = rcTool.right;
}
TRACE("pos %d - %d\n", rect.left, rect.top);
rect.right = rect.left + size.cx;
rect.bottom = rect.top + size.cy;
AdjustWindowRectEx (&rect, GetWindowLongW (hwnd, GWL_STYLE),
FALSE, GetWindowLongW (hwnd, GWL_EXSTYLE));
if (GetWindowLongW(hwnd, GWL_STYLE) & TTS_BALLOON)
{
HRGN hRgn;
/* FIXME: need to add pointy bit using CreatePolyRgn & CombinRgn */
hRgn = CreateRoundRectRgn(0, 0, rect.right - rect.left, rect.bottom - rect.top, BALLOON_ROUNDEDNESS, BALLOON_ROUNDEDNESS);
SetWindowRgn(hwnd, hRgn, FALSE);
/* we don't free the region handle as the system deletes it when
* it is no longer needed */
}
SetWindowPos (hwnd, HWND_TOP, rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top,
SWP_SHOWWINDOW | SWP_NOACTIVATE );
InvalidateRect(hwnd, NULL, TRUE);
UpdateWindow(hwnd);
} }
@ -2133,7 +2102,7 @@ TOOLTIPS_SetToolInfoW (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (infoPtr->szTipText[0] == 0) if (infoPtr->szTipText[0] == 0)
TOOLTIPS_Hide(hwnd, infoPtr); TOOLTIPS_Hide(hwnd, infoPtr);
else else
TOOLTIPS_Show (hwnd, infoPtr); TOOLTIPS_Show (hwnd, infoPtr, FALSE);
} }
return 0; return 0;
@ -2255,7 +2224,7 @@ TOOLTIPS_UpdateTipTextA (HWND hwnd, WPARAM wParam, LPARAM lParam)
if(infoPtr->nCurrentTool == -1) return 0; if(infoPtr->nCurrentTool == -1) return 0;
/* force repaint */ /* force repaint */
if (infoPtr->bActive) if (infoPtr->bActive)
TOOLTIPS_Show (hwnd, infoPtr); TOOLTIPS_Show (hwnd, infoPtr, FALSE);
else if (infoPtr->bTrackActive) else if (infoPtr->bTrackActive)
TOOLTIPS_TrackShow (hwnd, infoPtr); TOOLTIPS_TrackShow (hwnd, infoPtr);
@ -2311,9 +2280,9 @@ TOOLTIPS_UpdateTipTextW (HWND hwnd, WPARAM wParam, LPARAM lParam)
if(infoPtr->nCurrentTool == -1) return 0; if(infoPtr->nCurrentTool == -1) return 0;
/* force repaint */ /* force repaint */
if (infoPtr->bActive) if (infoPtr->bActive)
TOOLTIPS_Show (hwnd, infoPtr); TOOLTIPS_Show (hwnd, infoPtr, FALSE);
else if (infoPtr->bTrackActive) else if (infoPtr->bTrackActive)
TOOLTIPS_TrackShow (hwnd, infoPtr); TOOLTIPS_Show (hwnd, infoPtr, TRUE);
return 0; return 0;
} }
@ -2597,7 +2566,7 @@ TOOLTIPS_Timer (HWND hwnd, WPARAM wParam, LPARAM lParam)
KillTimer (hwnd, ID_TIMERSHOW); KillTimer (hwnd, ID_TIMERSHOW);
nOldTool = infoPtr->nTool; nOldTool = infoPtr->nTool;
if ((infoPtr->nTool = TOOLTIPS_CheckTool (hwnd, TRUE)) == nOldTool) if ((infoPtr->nTool = TOOLTIPS_CheckTool (hwnd, TRUE)) == nOldTool)
TOOLTIPS_Show (hwnd, infoPtr); TOOLTIPS_Show (hwnd, infoPtr, FALSE);
break; break;
case ID_TIMERPOP: case ID_TIMERPOP:

View file

@ -20,14 +20,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
* *
* NOTE * NOTE
* *
* This code was audited for completeness against the documented features * This code was audited for completeness against the documented features
* of Comctl32.dll version 6.0 on Sep. 12, 2002, by Dimitrie O. Paun. * of Comctl32.dll version 6.0 on Sep. 12, 2002, by Dimitrie O. Paun.
* *
* Unless otherwise noted, we believe this code to be complete, as per * Unless otherwise noted, we believe this code to be complete, as per
* the specification mentioned above. * the specification mentioned above.
* If you discover missing features, or bugs, please note them below. * If you discover missing features, or bugs, please note them below.
* *
*/ */
#include <stdarg.h> #include <stdarg.h>
@ -102,18 +102,18 @@ typedef struct
static const WCHAR themeClass[] = { 'T','r','a','c','k','b','a','r',0 }; static const WCHAR themeClass[] = { 'T','r','a','c','k','b','a','r',0 };
static inline int static inline int
notify_customdraw (const TRACKBAR_INFO *infoPtr, NMCUSTOMDRAW *pnmcd, int stage) notify_customdraw (const TRACKBAR_INFO *infoPtr, NMCUSTOMDRAW *pnmcd, int stage)
{ {
pnmcd->dwDrawStage = stage; pnmcd->dwDrawStage = stage;
return SendMessageW (infoPtr->hwndNotify, WM_NOTIFY, return SendMessageW (infoPtr->hwndNotify, WM_NOTIFY,
pnmcd->hdr.idFrom, (LPARAM)pnmcd); pnmcd->hdr.idFrom, (LPARAM)pnmcd);
} }
static LRESULT notify_hdr (const TRACKBAR_INFO *infoPtr, INT code, LPNMHDR pnmh) static LRESULT notify_hdr (const TRACKBAR_INFO *infoPtr, INT code, LPNMHDR pnmh)
{ {
LRESULT result; LRESULT result;
TRACE("(code=%d)\n", code); TRACE("(code=%d)\n", code);
pnmh->hwndFrom = infoPtr->hwndSelf; pnmh->hwndFrom = infoPtr->hwndSelf;
@ -144,7 +144,7 @@ notify_with_scroll (const TRACKBAR_INFO *infoPtr, UINT code)
bVert ? WM_VSCROLL : WM_HSCROLL, bVert ? WM_VSCROLL : WM_HSCROLL,
(WPARAM)code, (LPARAM)infoPtr->hwndSelf); (WPARAM)code, (LPARAM)infoPtr->hwndSelf);
} }
static void TRACKBAR_RecalculateTics (TRACKBAR_INFO *infoPtr) static void TRACKBAR_RecalculateTics (TRACKBAR_INFO *infoPtr)
{ {
int i, tic, nrTics; int i, tic, nrTics;
@ -474,8 +474,8 @@ TRACKBAR_DrawChannel (const TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
if (theme) if (theme)
{ {
DrawThemeBackground (theme, hdc, DrawThemeBackground (theme, hdc,
(GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TBS_VERT) ? (GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TBS_VERT) ?
TKP_TRACKVERT : TKP_TRACK, TKS_NORMAL, &rcChannel, 0); TKP_TRACKVERT : TKP_TRACK, TKS_NORMAL, &rcChannel, 0);
} }
else else
@ -544,7 +544,7 @@ TRACKBAR_DrawOneTic (const TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, int fla
if (flags & TBS_VERT) x += len * side; if (flags & TBS_VERT) x += len * side;
else y += len * side; else y += len * side;
LineTo(hdc, x, y); LineTo(hdc, x, y);
if (flags & TIC_SELECTIONMARK) { if (flags & TIC_SELECTIONMARK) {
if (flags & TBS_VERT) { if (flags & TBS_VERT) {
x -= side; x -= side;
@ -557,7 +557,7 @@ TRACKBAR_DrawOneTic (const TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, int fla
} else { } else {
x += 2 * indent; x += 2 * indent;
} }
LineTo(hdc, x, y); LineTo(hdc, x, y);
LineTo(hdc, ox, oy); LineTo(hdc, ox, oy);
} }
@ -582,7 +582,7 @@ TRACKBAR_DrawTics (const TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
LOGPEN ticPen = { PS_SOLID, {1, 0}, GetSysColor (COLOR_3DDKSHADOW) }; LOGPEN ticPen = { PS_SOLID, {1, 0}, GetSysColor (COLOR_3DDKSHADOW) };
HPEN hOldPen, hTicPen; HPEN hOldPen, hTicPen;
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
if (theme) if (theme)
{ {
int part = (dwStyle & TBS_VERT) ? TKP_TICSVERT : TKP_TICS; int part = (dwStyle & TBS_VERT) ? TKP_TICSVERT : TKP_TICS;
@ -605,7 +605,7 @@ TRACKBAR_DrawTics (const TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
TRACKBAR_DrawTic (infoPtr, hdc, infoPtr->lSelMax, TRACKBAR_DrawTic (infoPtr, hdc, infoPtr->lSelMax,
ticFlags | TIC_SELECTIONMARKMAX); ticFlags | TIC_SELECTIONMARKMAX);
} }
/* clean up the pen, if we created one */ /* clean up the pen, if we created one */
if (hTicPen) { if (hTicPen) {
SelectObject(hdc, hOldPen); SelectObject(hdc, hOldPen);
@ -625,7 +625,7 @@ TRACKBAR_DrawThumb (const TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
int fillClr; int fillClr;
int PointDepth; int PointDepth;
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
if (theme) if (theme)
{ {
int partId; int partId;
@ -636,7 +636,7 @@ TRACKBAR_DrawThumb (const TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
partId = (dwStyle & TBS_VERT) ? TKP_THUMBLEFT : TKP_THUMBTOP; partId = (dwStyle & TBS_VERT) ? TKP_THUMBLEFT : TKP_THUMBTOP;
else else
partId = (dwStyle & TBS_VERT) ? TKP_THUMBRIGHT : TKP_THUMBBOTTOM; partId = (dwStyle & TBS_VERT) ? TKP_THUMBRIGHT : TKP_THUMBBOTTOM;
if (dwStyle & WS_DISABLED) if (dwStyle & WS_DISABLED)
stateId = TUS_DISABLED; stateId = TUS_DISABLED;
else if (infoPtr->flags & TB_DRAG_MODE) else if (infoPtr->flags & TB_DRAG_MODE)
@ -645,9 +645,9 @@ TRACKBAR_DrawThumb (const TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
stateId = TUS_HOT; stateId = TUS_HOT;
else else
stateId = TUS_NORMAL; stateId = TUS_NORMAL;
DrawThemeBackground (theme, hdc, partId, stateId, &thumb, 0); DrawThemeBackground (theme, hdc, partId, stateId, &thumb, 0);
return; return;
} }
@ -824,6 +824,7 @@ TRACKBAR_Refresh (TRACKBAR_INFO *infoPtr, HDC hdcDst)
HBITMAP hOldBmp = 0, hOffScreenBmp = 0; HBITMAP hOldBmp = 0, hOffScreenBmp = 0;
NMCUSTOMDRAW nmcd; NMCUSTOMDRAW nmcd;
int gcdrf, icdrf; int gcdrf, icdrf;
HTHEME theme;
if (infoPtr->flags & TB_THUMBCHANGED) { if (infoPtr->flags & TB_THUMBCHANGED) {
TRACKBAR_UpdateThumb (infoPtr); TRACKBAR_UpdateThumb (infoPtr);
@ -839,7 +840,7 @@ TRACKBAR_Refresh (TRACKBAR_INFO *infoPtr, HDC hdcDst)
infoPtr->flags &= ~ (TB_THUMBCHANGED | TB_SELECTIONCHANGED); infoPtr->flags &= ~ (TB_THUMBCHANGED | TB_SELECTIONCHANGED);
GetClientRect (infoPtr->hwndSelf, &rcClient); GetClientRect (infoPtr->hwndSelf, &rcClient);
/* try to render offscreen, if we fail, carrry onscreen */ /* try to render offscreen, if we fail, carrry onscreen */
hdc = CreateCompatibleDC(hdcDst); hdc = CreateCompatibleDC(hdcDst);
if (hdc) { if (hdc) {
@ -864,18 +865,22 @@ TRACKBAR_Refresh (TRACKBAR_INFO *infoPtr, HDC hdcDst)
nmcd.rc = rcClient; nmcd.rc = rcClient;
gcdrf = notify_customdraw(infoPtr, &nmcd, CDDS_PREPAINT); gcdrf = notify_customdraw(infoPtr, &nmcd, CDDS_PREPAINT);
if (gcdrf & CDRF_SKIPDEFAULT) goto cleanup; if (gcdrf & CDRF_SKIPDEFAULT) goto cleanup;
/* Erase backbround */ /* Erase backbround */
if (gcdrf == CDRF_DODEFAULT || if (gcdrf == CDRF_DODEFAULT ||
notify_customdraw(infoPtr, &nmcd, CDDS_PREERASE) != CDRF_SKIPDEFAULT) { notify_customdraw(infoPtr, &nmcd, CDDS_PREERASE) != CDRF_SKIPDEFAULT) {
if (GetWindowTheme (infoPtr->hwndSelf)) if ((theme = GetWindowTheme (infoPtr->hwndSelf))) {
DrawThemeBackground (theme, hdc,
(GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TBS_VERT) ?
TKP_TRACKVERT : TKP_TRACK, TKS_NORMAL, &rcClient, 0);
DrawThemeParentBackground (infoPtr->hwndSelf, hdc, &rcClient); DrawThemeParentBackground (infoPtr->hwndSelf, hdc, &rcClient);
}
else else
FillRect (hdc, &rcClient, GetSysColorBrush(COLOR_BTNFACE)); FillRect (hdc, &rcClient, GetSysColorBrush(COLOR_BTNFACE));
if (gcdrf != CDRF_DODEFAULT) if (gcdrf != CDRF_DODEFAULT)
notify_customdraw(infoPtr, &nmcd, CDDS_POSTERASE); notify_customdraw(infoPtr, &nmcd, CDDS_POSTERASE);
} }
/* draw channel */ /* draw channel */
if (gcdrf & CDRF_NOTIFYITEMDRAW) { if (gcdrf & CDRF_NOTIFYITEMDRAW) {
nmcd.dwItemSpec = TBCD_CHANNEL; nmcd.dwItemSpec = TBCD_CHANNEL;
@ -904,7 +909,7 @@ TRACKBAR_Refresh (TRACKBAR_INFO *infoPtr, HDC hdcDst)
notify_customdraw(infoPtr, &nmcd, CDDS_ITEMPOSTPAINT); notify_customdraw(infoPtr, &nmcd, CDDS_ITEMPOSTPAINT);
} }
} }
/* draw thumb */ /* draw thumb */
if (!(dwStyle & TBS_NOTHUMB)) { if (!(dwStyle & TBS_NOTHUMB)) {
if (gcdrf & CDRF_NOTIFYITEMDRAW) { if (gcdrf & CDRF_NOTIFYITEMDRAW) {
@ -928,7 +933,7 @@ TRACKBAR_Refresh (TRACKBAR_INFO *infoPtr, HDC hdcDst)
/* finish up the painting */ /* finish up the painting */
if (gcdrf & CDRF_NOTIFYPOSTPAINT) if (gcdrf & CDRF_NOTIFYPOSTPAINT)
notify_customdraw(infoPtr, &nmcd, CDDS_POSTPAINT); notify_customdraw(infoPtr, &nmcd, CDDS_POSTPAINT);
cleanup: cleanup:
/* cleanup, if we rendered offscreen */ /* cleanup, if we rendered offscreen */
if (hdc != hdcDst) { if (hdc != hdcDst) {
@ -1430,7 +1435,7 @@ TRACKBAR_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
hwnd, 0, 0, 0); hwnd, 0, 0, 0);
if (infoPtr->hwndToolTip) { if (infoPtr->hwndToolTip) {
TTTOOLINFOW ti; TTTOOLINFOW ti;
ZeroMemory (&ti, sizeof(ti)); ZeroMemory (&ti, sizeof(ti));
ti.cbSize = sizeof(ti); ti.cbSize = sizeof(ti);
ti.uFlags = TTF_IDISHWND | TTF_TRACK | TTF_ABSOLUTE; ti.uFlags = TTF_IDISHWND | TTF_TRACK | TTF_ABSOLUTE;
@ -1439,7 +1444,7 @@ TRACKBAR_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
SendMessageW (infoPtr->hwndToolTip, TTM_ADDTOOLW, 0, (LPARAM)&ti); SendMessageW (infoPtr->hwndToolTip, TTM_ADDTOOLW, 0, (LPARAM)&ti);
} }
} }
OpenThemeData (hwnd, themeClass); OpenThemeData (hwnd, themeClass);
return 0; return 0;
@ -1608,7 +1613,7 @@ TRACKBAR_MouseMove (TRACKBAR_INFO *infoPtr, DWORD fwKeys, INT x, INT y)
return TRUE; return TRUE;
} }
if (!(infoPtr->flags & TB_DRAG_MODE)) if (!(infoPtr->flags & TB_DRAG_MODE))
{ {
if (GetWindowTheme (infoPtr->hwndSelf)) if (GetWindowTheme (infoPtr->hwndSelf))
{ {
@ -1632,7 +1637,7 @@ TRACKBAR_MouseMove (TRACKBAR_INFO *infoPtr, DWORD fwKeys, INT x, INT y)
tme.dwFlags = TME_CANCEL; tme.dwFlags = TME_CANCEL;
tme.hwndTrack = infoPtr->hwndSelf; tme.hwndTrack = infoPtr->hwndSelf;
TrackMouseEvent( &tme ); TrackMouseEvent( &tme );
infoPtr->flags &= ~TB_THUMB_HOT; infoPtr->flags &= ~TB_THUMB_HOT;
} }
if (oldFlags != infoPtr->flags) InvalidateRect (infoPtr->hwndSelf, &infoPtr->rcThumb, FALSE); if (oldFlags != infoPtr->flags) InvalidateRect (infoPtr->hwndSelf, &infoPtr->rcThumb, FALSE);
} }
@ -1880,10 +1885,10 @@ TRACKBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TRACKBAR_LButtonUp (infoPtr, wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam)); return TRACKBAR_LButtonUp (infoPtr, wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
case WM_MOUSELEAVE: case WM_MOUSELEAVE:
infoPtr->flags &= ~TB_THUMB_HOT; infoPtr->flags &= ~TB_THUMB_HOT;
InvalidateRect (infoPtr->hwndSelf, &infoPtr->rcThumb, FALSE); InvalidateRect (infoPtr->hwndSelf, &infoPtr->rcThumb, FALSE);
return 0; return 0;
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
return TRACKBAR_MouseMove (infoPtr, wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam)); return TRACKBAR_MouseMove (infoPtr, wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));

View file

@ -2325,7 +2325,7 @@ TREEVIEW_DrawItemLines(const TREEVIEW_INFO *infoPtr, HDC hdc, const TREEVIEW_ITE
hbr = CreateSolidBrush(infoPtr->clrBk); hbr = CreateSolidBrush(infoPtr->clrBk);
hbrOld = SelectObject(hdc, hbr); hbrOld = SelectObject(hdc, hbr);
centerx = (item->linesOffset + item->stateOffset) / 2; centerx = (item->linesOffset + item->stateOffset) / 2;
centery = (item->rect.top + item->rect.bottom) / 2; centery = (item->rect.top + item->rect.bottom) / 2;
@ -2406,21 +2406,21 @@ TREEVIEW_DrawItemLines(const TREEVIEW_INFO *infoPtr, HDC hdc, const TREEVIEW_ITE
LONG rectsize = min(height, width) / 4; LONG rectsize = min(height, width) / 4;
/* plussize = ceil(rectsize * 3/4) */ /* plussize = ceil(rectsize * 3/4) */
LONG plussize = (rectsize + 1) * 3 / 4; LONG plussize = (rectsize + 1) * 3 / 4;
HPEN hNewPen = CreatePen(PS_SOLID, 0, infoPtr->clrLine); HPEN hNewPen = CreatePen(PS_SOLID, 0, infoPtr->clrLine);
HPEN hOldPen = SelectObject(hdc, hNewPen); HPEN hOldPen = SelectObject(hdc, hNewPen);
Rectangle(hdc, centerx - rectsize - 1, centery - rectsize - 1, Rectangle(hdc, centerx - rectsize - 1, centery - rectsize - 1,
centerx + rectsize + 2, centery + rectsize + 2); centerx + rectsize + 2, centery + rectsize + 2);
SelectObject(hdc, hOldPen); SelectObject(hdc, hOldPen);
DeleteObject(hNewPen); DeleteObject(hNewPen);
if (height < 18 || width < 18) if (height < 18 || width < 18)
{ {
MoveToEx(hdc, centerx - plussize + 1, centery, NULL); MoveToEx(hdc, centerx - plussize + 1, centery, NULL);
LineTo(hdc, centerx + plussize, centery); LineTo(hdc, centerx + plussize, centery);
if (!(item->state & TVIS_EXPANDED)) if (!(item->state & TVIS_EXPANDED))
{ {
MoveToEx(hdc, centerx, centery - plussize + 1, NULL); MoveToEx(hdc, centerx, centery - plussize + 1, NULL);
@ -2431,7 +2431,7 @@ TREEVIEW_DrawItemLines(const TREEVIEW_INFO *infoPtr, HDC hdc, const TREEVIEW_ITE
{ {
Rectangle(hdc, centerx - plussize + 1, centery - 1, Rectangle(hdc, centerx - plussize + 1, centery - 1,
centerx + plussize, centery + 2); centerx + plussize, centery + 2);
if (!(item->state & TVIS_EXPANDED)) if (!(item->state & TVIS_EXPANDED))
{ {
Rectangle(hdc, centerx - 1, centery - plussize + 1, Rectangle(hdc, centerx - 1, centery - plussize + 1,
@ -2601,7 +2601,7 @@ TREEVIEW_DrawItem(const TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *wineItem
wineItem->pszText, wineItem->pszText,
lstrlenW(wineItem->pszText), lstrlenW(wineItem->pszText),
NULL); NULL);
/* Draw the box around the selected item */ /* Draw the box around the selected item */
if ((wineItem == infoPtr->selectedItem) && inFocus) if ((wineItem == infoPtr->selectedItem) && inFocus)
{ {
@ -2870,7 +2870,7 @@ TREEVIEW_Paint(TREEVIEW_INFO *infoPtr, WPARAM wParam)
if (wParam) if (wParam)
{ {
hdc = (HDC)wParam; hdc = (HDC)wParam;
GetClientRect(infoPtr->hwnd, &rc); GetClientRect(infoPtr->hwnd, &rc);
TREEVIEW_EraseBackground(infoPtr, hdc); TREEVIEW_EraseBackground(infoPtr, hdc);
} }
else else
@ -4997,7 +4997,7 @@ TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
/* Make sure actual scrollbar state is consistent with uInternalStatus */ /* Make sure actual scrollbar state is consistent with uInternalStatus */
ShowScrollBar(hwnd, SB_VERT, FALSE); ShowScrollBar(hwnd, SB_VERT, FALSE);
ShowScrollBar(hwnd, SB_HORZ, FALSE); ShowScrollBar(hwnd, SB_HORZ, FALSE);
OpenThemeData (hwnd, themeClass); OpenThemeData (hwnd, themeClass);
return 0; return 0;

View file

@ -18,14 +18,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
* *
* NOTE * NOTE
* *
* This code was audited for completeness against the documented features * This code was audited for completeness against the documented features
* of Comctl32.dll version 6.0 on Sep. 9, 2002, by Dimitrie O. Paun. * of Comctl32.dll version 6.0 on Sep. 9, 2002, by Dimitrie O. Paun.
* *
* Unless otherwise noted, we believe this code to be complete, as per * Unless otherwise noted, we believe this code to be complete, as per
* the specification mentioned above. * the specification mentioned above.
* If you discover missing features, or bugs, please note them below. * If you discover missing features, or bugs, please note them below.
* *
*/ */
#include <stdlib.h> #include <stdlib.h>
@ -100,7 +100,7 @@ typedef struct
#define COUNT_OF(a) (sizeof(a)/sizeof(a[0])) #define COUNT_OF(a) (sizeof(a)/sizeof(a[0]))
static const WCHAR BUDDY_UPDOWN_HWND[] = { 'b', 'u', 'd', 'd', 'y', 'U', 'p', 'D', 'o', 'w', 'n', 'H', 'W', 'N', 'D', 0 }; static const WCHAR BUDDY_UPDOWN_HWND[] = { 'b', 'u', 'd', 'd', 'y', 'U', 'p', 'D', 'o', 'w', 'n', 'H', 'W', 'N', 'D', 0 };
static const WCHAR BUDDY_SUPERCLASS_WNDPROC[] = { 'b', 'u', 'd', 'd', 'y', 'S', 'u', 'p', 'p', 'e', 'r', static const WCHAR BUDDY_SUPERCLASS_WNDPROC[] = { 'b', 'u', 'd', 'd', 'y', 'S', 'u', 'p', 'p', 'e', 'r',
'C', 'l', 'a', 's', 's', 'W', 'n', 'd', 'P', 'r', 'o', 'c', 0 }; 'C', 'l', 'a', 's', 's', 'W', 'n', 'd', 'P', 'r', 'o', 'c', 0 };
static void UPDOWN_DoAction (UPDOWN_INFO *infoPtr, int delta, int action); static void UPDOWN_DoAction (UPDOWN_INFO *infoPtr, int delta, int action);
@ -312,7 +312,7 @@ static BOOL UPDOWN_SetBuddyInt (const UPDOWN_INFO *infoPtr)
WCHAR txt[20]; WCHAR txt[20];
int len; int len;
if (!((infoPtr->dwStyle & UDS_SETBUDDYINT) && IsWindow(infoPtr->Buddy))) if (!((infoPtr->dwStyle & UDS_SETBUDDYINT) && IsWindow(infoPtr->Buddy)))
return FALSE; return FALSE;
TRACE("set new value(%d) to buddy.\n", infoPtr->CurVal); TRACE("set new value(%d) to buddy.\n", infoPtr->CurVal);
@ -384,10 +384,10 @@ static LRESULT UPDOWN_Draw (const UPDOWN_INFO *infoPtr, HDC hdc)
dHot = (infoPtr->Flags & FLAG_DECR) && (infoPtr->Flags & FLAG_MOUSEIN); dHot = (infoPtr->Flags & FLAG_DECR) && (infoPtr->Flags & FLAG_MOUSEIN);
if (theme) { if (theme) {
uPart = (infoPtr->dwStyle & UDS_HORZ) ? SPNP_UPHORZ : SPNP_UP; uPart = (infoPtr->dwStyle & UDS_HORZ) ? SPNP_UPHORZ : SPNP_UP;
uState = (infoPtr->dwStyle & WS_DISABLED) ? DNS_DISABLED uState = (infoPtr->dwStyle & WS_DISABLED) ? DNS_DISABLED
: (uPressed ? DNS_PRESSED : (uHot ? DNS_HOT : DNS_NORMAL)); : (uPressed ? DNS_PRESSED : (uHot ? DNS_HOT : DNS_NORMAL));
dPart = (infoPtr->dwStyle & UDS_HORZ) ? SPNP_DOWNHORZ : SPNP_DOWN; dPart = (infoPtr->dwStyle & UDS_HORZ) ? SPNP_DOWNHORZ : SPNP_DOWN;
dState = (infoPtr->dwStyle & WS_DISABLED) ? DNS_DISABLED dState = (infoPtr->dwStyle & WS_DISABLED) ? DNS_DISABLED
: (dPressed ? DNS_PRESSED : (dHot ? DNS_HOT : DNS_NORMAL)); : (dPressed ? DNS_PRESSED : (dHot ? DNS_HOT : DNS_NORMAL));
needBuddyBg = IsWindow (infoPtr->Buddy) needBuddyBg = IsWindow (infoPtr->Buddy)
&& (IsThemeBackgroundPartiallyTransparent (theme, uPart, uState) && (IsThemeBackgroundPartiallyTransparent (theme, uPart, uState)
@ -765,7 +765,7 @@ static void UPDOWN_HandleMouseEvent (UPDOWN_INFO *infoPtr, UINT msg, INT x, INT
if(temp != infoPtr->Flags) if(temp != infoPtr->Flags)
InvalidateRect (infoPtr->Self, NULL, FALSE); InvalidateRect (infoPtr->Self, NULL, FALSE);
/* Set up tracking so the mousein flags can be reset when the /* Set up tracking so the mousein flags can be reset when the
* mouse leaves the control */ * mouse leaves the control */
tme.cbSize = sizeof( tme ); tme.cbSize = sizeof( tme );
tme.dwFlags = TME_LEAVE; tme.dwFlags = TME_LEAVE;