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
* 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
* the specification mentioned above.
* If you discover missing features, or bugs, please note them below.
*
*
* TODO:
* - 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.cchBuffer = SizeofResource(hInst, hrsrc);
infoPtr->hMMio = mmioOpenW(NULL, &mminfo, MMIO_READ);
if (!infoPtr->hMMio)
if (!infoPtr->hMMio)
{
FreeResource(infoPtr->hRes);
return FALSE;
@ -270,7 +270,7 @@ static BOOL ANIMATE_PaintFrame(ANIMATE_INFO* infoPtr, HDC hDC)
nWidth = infoPtr->outbih->biWidth;
nHeight = infoPtr->outbih->biHeight;
}
}
else
{
pBitmapData = infoPtr->indata;
@ -435,14 +435,14 @@ static LRESULT ANIMATE_Play(ANIMATE_INFO *infoPtr, UINT cRepeat, WORD wFrom, WOR
infoPtr->currFrame = infoPtr->nFromFrame;
if (infoPtr->dwStyle & ACS_TIMER)
if (infoPtr->dwStyle & ACS_TIMER)
{
TRACE("Using a timer\n");
/* create a timer to display AVI */
infoPtr->uTimer = SetTimer(infoPtr->hwndSelf, 1,
infoPtr->uTimer = SetTimer(infoPtr->hwndSelf, 1,
infoPtr->mah.dwMicroSecPerFrame / 1000, NULL);
}
else
}
else
{
if(infoPtr->dwStyle & ACS_TRANSPARENT)
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 */
infoPtr->lpIndex = Alloc(infoPtr->mah.dwTotalFrames * sizeof(DWORD));
if (!infoPtr->lpIndex)
if (!infoPtr->lpIndex)
return FALSE;
numFrame = insize = 0;
@ -624,7 +624,7 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr)
}
infoPtr->indata = Alloc(infoPtr->ash.dwSuggestedBufferSize);
if (!infoPtr->indata)
if (!infoPtr->indata)
return FALSE;
return TRUE;
@ -659,14 +659,14 @@ static BOOL ANIMATE_GetAviCodec(ANIMATE_INFO *infoPtr)
return FALSE;
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");
return FALSE;
}
infoPtr->outdata = Alloc(infoPtr->outbih->biSizeImage);
if (!infoPtr->outdata)
if (!infoPtr->outdata)
return FALSE;
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);
if (!lpszName)
if (!lpszName)
{
TRACE("Closing avi!\n");
/* 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 (!ANIMATE_LoadResW(infoPtr, hInstance, lpszName))
if (!ANIMATE_LoadResW(infoPtr, hInstance, lpszName))
{
TRACE("No AVI resource found!\n");
if (!ANIMATE_LoadFileW(infoPtr, lpszName))
if (!ANIMATE_LoadFileW(infoPtr, lpszName))
{
WARN("No AVI file found!\n");
return FALSE;
}
}
}
else
}
else
{
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");
ANIMATE_Free(infoPtr);
return FALSE;
}
if (!ANIMATE_GetAviCodec(infoPtr))
if (!ANIMATE_GetAviCodec(infoPtr))
{
WARN("Can't get AVI Codec\n");
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,
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 TRUE;
@ -849,7 +849,7 @@ static LRESULT ANIMATE_StyleChanged(ANIMATE_INFO *infoPtr, WPARAM wStyleType, co
wStyleType, lpss->styleOld, lpss->styleNew);
if (wStyleType != GWL_STYLE) return 0;
infoPtr->dwStyle = lpss->styleNew;
InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
@ -939,7 +939,7 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP
break;
case WM_SIZE:
if (infoPtr->dwStyle & ACS_CENTER)
if (infoPtr->dwStyle & ACS_CENTER)
InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
return DefWindowProcW(hWnd, uMsg, wParam, lParam);

View file

@ -20,14 +20,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* NOTE
*
*
* This code was audited for completeness against the documented features
* 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
* the specification mentioned above.
* If you discover missing features, or bugs, please note them below.
*
*
*/
#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 */
if ((infoPtr->dwExtStyle ^ dwTemp) & CBES_EX_PATHWORDBREAKPROC)
SetPathWordBreakProc(infoPtr->hwndEdit,
SetPathWordBreakProc(infoPtr->hwndEdit,
(infoPtr->dwExtStyle & CBES_EX_PATHWORDBREAKPROC) ? TRUE : FALSE);
/* 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);
case CBN_SELENDOK:
case CBN_SELENDCANCEL:
/*
* We have to change the handle since we are the control
* 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)
{
if (infoPtr->hwndCombo)
@ -1585,18 +1607,7 @@ static LRESULT COMBOEX_Destroy (COMBOEX_INFO *infoPtr)
Free (infoPtr->edit);
infoPtr->edit = 0;
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;
}
COMBOEX_ResetContent (infoPtr);
if (infoPtr->defaultFont)
DeleteObject (infoPtr->defaultFont);
@ -2225,6 +2236,7 @@ COMBOEX_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_SETTEXT:
case WM_GETTEXT:
case WM_GETTEXTLENGTH:
return SendMessageW(infoPtr->hwndEdit, uMsg, wParam, lParam);
case CB_GETLBTEXT:
@ -2233,12 +2245,15 @@ COMBOEX_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case CB_GETLBTEXTLEN:
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 */
case CB_GETDROPPEDCONTROLRECT:
case CB_GETITEMHEIGHT:
case CB_GETEXTENDEDUI:
case CB_LIMITTEXT:
case CB_RESETCONTENT:
case CB_SELECTSTRING:
/* Combo messages OK to just forward to the regular COMBO */

View file

@ -5,12 +5,9 @@
<importlibrary definition="comctl32.spec.def" />
<include base="comctl32">.</include>
<include base="ReactOS">include/reactos/wine</include>
<define name="__REACTOS__" />
<define name="__WINESRC__" />
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x600</define>
<define name="_WIN32_WINNT">0x501</define>
<define name="WINVER">0x501</define>
<define name="WINVER">0x600</define>
<define name="_WIN32_WINNT">0x600</define>
<library>wine</library>
<library>user32</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 */
SendMessageW(hwndTabCtrl, TCM_SETCURSEL, psInfo->active_page, 0);
@ -95,7 +95,7 @@ Index: tooltips.c
===================================================================
--- tooltips.c (revision 25790)
+++ tooltips.c (working copy)
@@ -2471,7 +2471,34 @@
@@ -2440,7 +2440,34 @@
TOOLTIPS_NotifyFormat (HWND hwnd, WPARAM wParam, LPARAM 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 (working copy)
@@ -1703,11 +1703,12 @@
@@ -1719,11 +1719,12 @@
static LRESULT
@ -185,7 +185,7 @@ Index: monthcal.c
return 0;
}
@@ -2015,7 +2016,7 @@
@@ -2031,7 +2032,7 @@
return DLGC_WANTARROWS | DLGC_WANTCHARS;
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
* 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.
*
*
* Wine stores MRU-lists in the same registry format as Windows, so when
* switching between the builtin and native comctl32.dll no problems or
* incompatibilities should occur.

View file

@ -1,6 +1,6 @@
/*
* 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
* 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 "도움말(&H)", IDC_HELP_BTN,308,40,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
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 "<- 제거하기(&R)", IDC_REMOVE_BTN,131,62,44,14
PUSHBUTTON "<-지우기(&R)", IDC_REMOVE_BTN,131,62,44,14
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
END

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* NOTES
*
*
* This code was audited for completeness against the documented features
* 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 FILE "comctl32.dll"
#define VERSION "6.0.0.0"
#define VERSION "6.0.2600.2982"
#define PUBLIC_KEY "6595b64144ccf1df"
#ifdef __i386__
@ -248,7 +248,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
break;
case DLL_PROCESS_DETACH:
/* clean up subclassing */
/* clean up subclassing */
THEMING_Uninitialize();
/* unregister all common control classes */
@ -875,7 +875,7 @@ CreateMappedBitmap (HINSTANCE hInstance, INT_PTR idBitmap, UINT wFlags,
if (lpBitmap->biSize >= sizeof(BITMAPINFOHEADER) && lpBitmap->biClrUsed)
nColorTableSize = lpBitmap->biClrUsed;
else if (lpBitmap->biBitCount <= 8)
else if (lpBitmap->biBitCount <= 8)
nColorTableSize = (1 << lpBitmap->biBitCount);
else
nColorTableSize = 0;
@ -1090,7 +1090,7 @@ VOID WINAPI InitMUILanguage (LANGID uiLang)
*
* BUGS
* 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.
*/
@ -1139,7 +1139,7 @@ BOOL WINAPI SetWindowSubclass (HWND hWnd, SUBCLASSPROC pfnSubclass,
proc = proc->next;
}
}
proc = Alloc(sizeof(SUBCLASSPROCS));
if (!proc) {
ERR ("Failed to allocate subclass entry in stack\n");
@ -1151,7 +1151,7 @@ BOOL WINAPI SetWindowSubclass (HWND hWnd, SUBCLASSPROC pfnSubclass,
RemovePropW( hWnd, COMCTL32_wSubclass );
return FALSE;
}
proc->subproc = pfnSubclass;
proc->ref = dwRef;
proc->id = uIDSubclass;
@ -1238,15 +1238,15 @@ BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR u
while (proc) {
if ((proc->id == uID) &&
(proc->subproc == pfnSubclass)) {
if (!prevproc)
stack->SubclassProcs = proc->next;
else
prevproc->next = proc->next;
if (stack->stackpos == proc)
stack->stackpos = stack->stackpos->next;
Free (proc);
ret = TRUE;
break;
@ -1254,7 +1254,7 @@ BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR u
prevproc = proc;
proc = proc->next;
}
if (!stack->SubclassProcs && !stack->running) {
TRACE("Last Subclass removed, cleaning up\n");
/* 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);
RemovePropW( hWnd, COMCTL32_wSubclass );
}
return ret;
}
/***********************************************************************
* 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
*/
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;
LPSUBCLASSPROCS proc;
LRESULT ret;
TRACE ("(%p, 0x%08x, 0x%08lx, 0x%08lx)\n", hWnd, uMsg, wParam, lParam);
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);
return 0;
}
/* Save our old stackpos to properly handle nested messages */
proc = stack->stackpos;
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);
stack->running--;
stack->stackpos = proc;
if (!stack->SubclassProcs && !stack->running) {
TRACE("Last Subclass removed, cleaning up\n");
/* 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;
LRESULT ret;
TRACE ("(%p, 0x%08x, 0x%08lx, 0x%08lx)\n", hWnd, uMsg, wParam, lParam);
/* 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);
} else {
const SUBCLASSPROCS *proc = stack->stackpos;
stack->stackpos = stack->stackpos->next;
stack->stackpos = stack->stackpos->next;
/* call the Subclass procedure from the stack */
ret = proc->subproc (hWnd, uMsg, wParam, lParam,
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 hOldPen;
static const DWORD adwPolyPoints[] = {4,4,4};
LONG lCentre = (bHorizontal ?
lpRect->top + (lpRect->bottom - lpRect->top)/2 :
LONG lCentre = (bHorizontal ?
lpRect->top + (lpRect->bottom - lpRect->top)/2 :
lpRect->left + (lpRect->right - lpRect->left)/2);
LONG l1 = (bHorizontal ? lpRect->left : lpRect->top);
LONG l2 = (bHorizontal ? lpRect->right : lpRect->bottom);
@ -1546,7 +1546,7 @@ void COMCTL32_EnsureBitmapSize(HBITMAP *pBitmap, int cxMinWidth, int cyMinHeight
SelectObject(hdcOld, hOldDCBitmap);
DeleteDC(hdcOld);
DeleteObject(*pBitmap);
DeleteObject(*pBitmap);
*pBitmap = hNewBitmap;
return;
}

View file

@ -20,14 +20,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* NOTE
*
*
* This code was audited for completeness against the documented features
* 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
* the specification mentioned above.
* If you discover missing features, or bugs, please note them below.
*
*
* TODO:
* -- DTS_APPCANPARSE
* -- DTS_SHORTDATECENTURYFORMAT
@ -72,6 +72,7 @@ typedef struct
RECT checkbox; /* checkbox allowing the control to be enabled/disabled */
RECT calbutton; /* button that toggles the dropdown of the monthcal control */
BOOL bCalDepressed; /* TRUE = cal button is depressed */
int bDropdownEnabled;
int select;
HFONT hFont;
int nrFieldsAllocated;
@ -395,7 +396,7 @@ DATETIME_ReturnTxt (const DATETIME_INFO *infoPtr, int count, LPWSTR result, int
wsprintfW (result, fmt__2dW, date.wMonth);
break;
case THREECHARMONTH:
GetLocaleInfoW(GetSystemDefaultLCID(), LOCALE_SMONTHNAME1+date.wMonth -1,
GetLocaleInfoW(GetSystemDefaultLCID(), LOCALE_SMONTHNAME1+date.wMonth -1,
buffer, sizeof(buffer)/sizeof(buffer[0]));
wsprintfW (result, fmt__3sW, buffer);
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)
{
year-=(month < 3);
return((year + year/4 - year/100 + year/400 +
DayOfWeekTable[month-1] + day ) % 7);
}
@ -611,7 +612,7 @@ DATETIME_ReturnFieldWidth (const DATETIME_INFO *infoPtr, HDC hdc, int count, SHO
*fieldWidthPtr = size.cx;
}
static void
static void
DATETIME_Refresh (DATETIME_INFO *infoPtr, HDC hdc)
{
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 */
if(infoPtr->dwStyle & DTS_RIGHTALIGN)
infoPtr->monthcal_pos.x = infoPtr->calbutton.left -
infoPtr->monthcal_pos.x = infoPtr->calbutton.left -
(rcMonthCal.right - rcMonthCal.left);
else
/* 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);
} else {
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);
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",
@ -776,6 +780,10 @@ DATETIME_Paint (DATETIME_INFO *infoPtr, HDC hdc)
} else {
DATETIME_Refresh (infoPtr, hdc);
}
/* Not a click on the dropdown box, enabled it */
infoPtr->bDropdownEnabled = TRUE;
return 0;
}
@ -790,9 +798,9 @@ DATETIME_Button_Command (DATETIME_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
}
return 0;
}
static LRESULT
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);
infoPtr->dateValid = TRUE;
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);
SendMessageW (infoPtr->hwndCheckbut, BM_SETCHECK, BST_CHECKED, 0);
InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
@ -959,7 +967,7 @@ DATETIME_KeyDown (DATETIME_INFO *infoPtr, DWORD vkCode, LPARAM flags)
break;
}
}
switch (vkCode) {
case VK_ADD:
case VK_UP:
@ -1063,6 +1071,19 @@ DATETIME_SetFocus (DATETIME_INFO *infoPtr, HWND 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) {
DATETIME_SendSimpleNotify (infoPtr, NM_SETFOCUS);
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);
infoPtr->rcDraw = infoPtr->rcClient;
if (infoPtr->dwStyle & DTS_UPDOWN) {
SetWindowPos(infoPtr->hUpdown, NULL,
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)
{
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);
if (wStyleType != GWL_STYLE) return 0;
infoPtr->dwStyle = lpss->styleNew;
if ( !(lpss->styleOld & DTS_SHOWNONE) && (lpss->styleNew & DTS_SHOWNONE) ) {
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);
SendMessageW (infoPtr->hwndCheckbut, BM_SETCHECK, 1, 0);
}
@ -1167,7 +1188,7 @@ DATETIME_StyleChanged(DATETIME_INFO *infoPtr, WPARAM wStyleType, const STYLESTRU
infoPtr->hwndCheckbut = 0;
}
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);
}
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->hwndNotify = lpcs->hwndParent;
infoPtr->select = -1; /* initially, nothing is selected */
infoPtr->bDropdownEnabled = TRUE;
DATETIME_StyleChanged(infoPtr, GWL_STYLE, &ss);
DATETIME_SetFormatW (infoPtr, 0);
/* 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);
/* initialize info structure */
@ -1234,7 +1256,7 @@ DATETIME_Destroy (DATETIME_INFO *infoPtr)
DestroyWindow(infoPtr->hwndCheckbut);
if (infoPtr->hUpdown)
DestroyWindow(infoPtr->hUpdown);
if (infoPtr->hMonthCal)
if (infoPtr->hMonthCal)
DestroyWindow(infoPtr->hMonthCal);
SetWindowLongPtrW( infoPtr->hwndSelf, 0, 0 ); /* clear infoPtr */
Free (infoPtr);

View file

@ -22,11 +22,11 @@
* NOTES
* These functions were involuntarily documented by Microsoft in 2002 as
* 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
* available at:
*
* http://members.ozemail.com.au/~geoffch/samples/win32/shell/comctl32
* http://members.ozemail.com.au/~geoffch/samples/win32/shell/comctl32
*/
#define COBJMACROS
@ -83,7 +83,7 @@ typedef HRESULT (CALLBACK *DPALOADPROC)(LPLOADDATA,IStream*,LPARAM);
*
* RETURNS
* Success: TRUE
* Failure: FALSE
* Failure: FALSE
*
* NOTES
* No more information available yet!
@ -181,7 +181,7 @@ HRESULT WINAPI DPA_LoadStream (HDPA *phDpa, DPALOADPROC loadProc,
*
* RETURNS
* Success: TRUE
* Failure: FALSE
* Failure: FALSE
*
* NOTES
* No more information available yet!
@ -212,7 +212,7 @@ HRESULT WINAPI DPA_SaveStream (const HDPA hDpa, DPALOADPROC loadProc,
*
* RETURNS
* Success: TRUE
* Failure: FALSE
* Failure: FALSE
*
* NOTES
* 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 */
if (!DPA_SetPtr(hdpa, hdpa->nItemCount, 0)) return -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->ptrs[i] = p;
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);
else
lpTemp = HeapAlloc (hdpa->hHeap, HEAP_ZERO_MEMORY, nSize);
if (!lpTemp)
return FALSE;

View file

@ -22,11 +22,11 @@
*
* This code was audited for completeness against the documented features
* 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
* the specification mentioned above.
* If you discover missing features or bugs please note them below.
*
*
*/
#include <stdarg.h>

View file

@ -22,11 +22,11 @@
* NOTES
* These functions were involuntarily documented by Microsoft in 2002 as
* 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
* 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>
@ -90,7 +90,7 @@ HDSA WINAPI DSA_Create (INT nSize, INT nGrow)
/**************************************************************************
* DSA_Destroy [COMCTL32.321]
*
*
* Destroys a dynamic storage array
*
* PARAMS

View file

@ -117,7 +117,7 @@ static void HEADER_StoreHDItemInHeader(HEADER_ITEM *lpItem, UINT mask, const HDI
{
if (mask & HDI_UNSUPPORTED_FIELDS)
FIXME("unsupported header fields %x\n", (mask & HDI_UNSUPPORTED_FIELDS));
if (mask & HDI_BITMAP)
lpItem->hbm = phdi->hbm;
@ -130,7 +130,7 @@ static void HEADER_StoreHDItemInHeader(HEADER_ITEM *lpItem, UINT mask, const HDI
if (mask & HDI_WIDTH)
lpItem->cxy = phdi->cxy;
if (mask & HDI_IMAGE)
if (mask & HDI_IMAGE)
{
lpItem->iImage = phdi->iImage;
if (phdi->iImage == I_IMAGECALLBACK)
@ -157,7 +157,7 @@ static void HEADER_StoreHDItemInHeader(HEADER_ITEM *lpItem, UINT mask, const HDI
{
lpItem->pszText = NULL;
lpItem->callbackMask |= HDI_TEXT;
}
}
}
}
@ -263,7 +263,7 @@ static void HEADER_GetHotDividerRect(HWND hwnd, const HEADER_INFO *infoPtr, RECT
if (infoPtr->uNumItem > 0)
{
HEADER_ITEM *lpItem;
if (iDivider < infoPtr->uNumItem)
{
lpItem = &infoPtr->items[iDivider];
@ -335,7 +335,7 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack, LRESULT lCDFlags
}
else {
HBRUSH hbr;
if (GetWindowLongW (hwnd, GWL_STYLE) & HDS_BUTTONS) {
if (phdi->bDown) {
DrawEdge (hdc, &r, BDR_RAISEDOUTER,
@ -413,7 +413,7 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack, LRESULT lCDFlags
}
if (bw || iw)
cw += *w;
cw += *w;
/* align cx using the unclipped cw */
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;
else /* HDF_RIGHT */
cx = r.right - cw;
/* clip cx & cw */
if (cx < r.left)
cx = r.left;
if (cx + cw > r.right)
cw = r.right - cx;
tx = cx + infoPtr->iMargin;
/* since cw might have changed we have to recalculate tw */
tw = cw - infoPtr->iMargin * 2;
if (iw || bw) {
tw -= *w;
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);
HRGN hClipRgn = CreateRectRgn(r.left, r.top, r.right, r.bottom);
SelectClipRgn(hClipDC, hClipRgn);
if (bw) {
HDC hdcBitmap = CreateCompatibleDC (hClipDC);
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);
DeleteDC (hdcBitmap);
}
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,
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);
ReleaseDC(hwnd, hClipDC);
}
if (((phdi->fmt & HDF_STRING)
|| (!(phdi->fmt & (HDF_OWNERDRAW|HDF_STRING|HDF_BITMAP|
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);
HBRUSH brush;
RECT r;
HEADER_GetHotDividerRect(hwnd, infoPtr, &r);
brush = CreateSolidBrush(GetSysColor(COLOR_HIGHLIGHT));
FillRect(hdc, &r, brush);
@ -528,7 +528,7 @@ HEADER_Refresh (HWND hwnd, HDC hdc)
/* get rect for the bar, adjusted for the border */
GetClientRect (hwnd, &rect);
lCDFlags = HEADER_SendCtrlCustomDraw(hwnd, CDDS_PREPAINT, hdc, &rect);
if (infoPtr->bDragging)
ImageList_DragShowNolock(FALSE);
@ -562,14 +562,14 @@ HEADER_Refresh (HWND hwnd, HDC hdc)
DrawEdge (hdc, &rcRest, EDGE_ETCHED, BF_BOTTOM|BF_MIDDLE);
}
}
if (infoPtr->iHotDivider != -1)
HEADER_DrawHotDivider(hwnd, hdc);
if (infoPtr->bDragging)
ImageList_DragShowNolock(TRUE);
SelectObject (hdc, hOldFont);
if (lCDFlags & CDRF_NOTIFYPOSTPAINT)
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
* [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
*
*
* NOTE: We depend on HDITEMA and HDITEMW having the same structure
*/
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;
*dest = *src;
if (src->mask & HDI_TEXT && src->pszText != LPSTR_TEXTCALLBACKW) /* covers TEXTCALLBACKA as well */
{
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);
*ppvScratch = dest->pszText;
}
if (!fSourceUnicode && infoPtr->nNotifyFormat == NFR_UNICODE)
{
dest->pszText = NULL;
@ -812,7 +812,7 @@ HEADER_SendNotifyWithHDItemT(HWND hwnd, UINT code, INT iItem, HDITEMW *lpItem)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
NMHEADERW nmhdr;
if (infoPtr->nNotifyFormat != NFR_UNICODE)
code = HEADER_NotifyCodeWtoA(code);
nmhdr.iItem = iItem;
@ -856,9 +856,9 @@ HEADER_SendNotifyWithIntFieldT(HWND hwnd, UINT code, INT iItem, INT mask, INT iV
/**
* 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).
* 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
* HEADER_ITEM pszText and iImage fields. They should be freed with
* HEADER_FreeCallbackItems.
@ -886,7 +886,7 @@ HEADER_PrepareCallbackItems(HWND hwnd, INT iItem, INT reqMask)
Free(lpItem->pszText);
lpItem->pszText = NULL;
}
memset(&dispInfo, 0, sizeof(NMHDDISPINFOW));
dispInfo.hdr.hwndFrom = hwnd;
dispInfo.hdr.idFrom = GetWindowLongPtrW (hwnd, GWLP_ID);
@ -907,17 +907,17 @@ HEADER_PrepareCallbackItems(HWND hwnd, INT iItem, INT reqMask)
dispInfo.iItem = iItem;
dispInfo.mask = mask;
dispInfo.lParam = lpItem->lParam;
TRACE("Sending HDN_GETDISPINFO%c\n", infoPtr->nNotifyFormat == NFR_UNICODE?'W':'A');
SendMessageW(infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM) dispInfo.hdr.idFrom,
SendMessageW(infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM) dispInfo.hdr.idFrom,
(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,
(infoPtr->nNotifyFormat == NFR_UNICODE ? debugstr_w(dispInfo.pszText) : (LPSTR) dispInfo.pszText),
(void*) dispInfo.lParam);
if (mask & HDI_IMAGE)
lpItem->iImage = dispInfo.iImage;
if (mask & HDI_TEXT)
@ -936,13 +936,13 @@ HEADER_PrepareCallbackItems(HWND hwnd, INT iItem, INT reqMask)
Free(pvBuffer);
}
}
if (dispInfo.mask & HDI_DI_SETITEM)
if (dispInfo.mask & HDI_DI_SETITEM)
{
/* make the items permanent */
lpItem->callbackMask &= ~dispInfo.mask;
}
return TRUE;
}
@ -980,7 +980,7 @@ HEADER_CreateDragImage (HWND hwnd, WPARAM wParam)
HDC hDeviceDC;
int height, width;
HFONT hFont;
if (wParam < 0 || wParam >= infoPtr->uNumItem)
return FALSE;
@ -990,7 +990,7 @@ HEADER_CreateDragImage (HWND hwnd, WPARAM wParam)
lpItem = &infoPtr->items[wParam];
width = lpItem->rect.right - lpItem->rect.left;
height = lpItem->rect.bottom - lpItem->rect.top;
hDeviceDC = GetDC(NULL);
hMemoryDC = CreateCompatibleDC(hDeviceDC);
hMemory = CreateCompatibleBitmap(hDeviceDC, width, height);
@ -1005,13 +1005,13 @@ HEADER_CreateDragImage (HWND hwnd, WPARAM wParam)
HEADER_DrawItem(hwnd, hMemoryDC, wParam, FALSE, lCDFlags);
if (lCDFlags & CDRF_NOTIFYPOSTPAINT)
HEADER_SendCtrlCustomDraw(hwnd, CDDS_POSTPAINT, hMemoryDC, &rc);
hMemory = SelectObject(hMemoryDC, hOldBitmap);
DeleteDC(hMemoryDC);
if (hMemory == NULL) /* if anything failed */
return FALSE;
himl = ImageList_Create(width, height, ILC_COLORDDB, 1, 1);
ImageList_Add(himl, hMemory, NULL);
DeleteObject(hMemory);
@ -1024,7 +1024,7 @@ HEADER_SetHotDivider(HWND hwnd, WPARAM wParam, LPARAM lParam)
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(hwnd);
INT iDivider;
RECT r;
if (wParam)
{
POINT pt;
@ -1032,7 +1032,7 @@ HEADER_SetHotDivider(HWND hwnd, WPARAM wParam, LPARAM lParam)
pt.x = (INT)(SHORT)LOWORD(lParam);
pt.y = 0;
HEADER_InternalHitTest (hwnd, &pt, &flags, &iDivider);
if (flags & HHT_TOLEFT)
iDivider = 0;
else if (flags & HHT_NOWHERE || flags & HHT_TORIGHT)
@ -1046,7 +1046,7 @@ HEADER_SetHotDivider(HWND hwnd, WPARAM wParam, LPARAM lParam)
}
else
iDivider = (INT)lParam;
/* Note; wParam==FALSE, lParam==-1 is valid and is used to clear the hot divider */
if (iDivider<-1 || iDivider>(int)infoPtr->uNumItem)
return iDivider;
@ -1094,7 +1094,7 @@ HEADER_DeleteItem (HWND hwnd, WPARAM wParam)
(infoPtr->uNumItem - iOrder) * sizeof(INT));
infoPtr->items = ReAlloc(infoPtr->items, sizeof(HEADER_ITEM) * infoPtr->uNumItem);
infoPtr->order = ReAlloc(infoPtr->order, sizeof(INT) * infoPtr->uNumItem);
/* Correct the orders */
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);
mask &= HDI_COMCTL32_4_0_FIELDS;
}
lpItem = &infoPtr->items[nItem];
HEADER_PrepareCallbackItems(hwnd, nItem, mask);
@ -1162,7 +1162,7 @@ HEADER_GetItemT (HWND hwnd, INT nItem, LPHDITEMW phdi, BOOL bUnicode)
if (mask & HDI_LPARAM)
phdi->lParam = lpItem->lParam;
if (mask & HDI_IMAGE)
if (mask & HDI_IMAGE)
phdi->iImage = lpItem->iImage;
if (mask & HDI_ORDER)
@ -1288,7 +1288,7 @@ HEADER_InsertItemT (HWND hwnd, INT nItem, const HDITEMW *phdi, BOOL bUnicode)
infoPtr->uNumItem++;
infoPtr->items = ReAlloc(infoPtr->items, sizeof(HEADER_ITEM) * infoPtr->uNumItem);
infoPtr->order = ReAlloc(infoPtr->order, sizeof(INT) * infoPtr->uNumItem);
/* make space for the new item */
memmove(&infoPtr->items[nItem + 1], &infoPtr->items[nItem],
(infoPtr->uNumItem - nItem - 1) * sizeof(HEADER_ITEM));
@ -1381,7 +1381,7 @@ static LRESULT
HEADER_GetBitmapMargin(HWND hwnd)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(hwnd);
return infoPtr->iMargin;
}
@ -1639,11 +1639,11 @@ HEADER_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HEADER_ITEM *lpItem = &infoPtr->items[infoPtr->iMoveItem];
INT iNewOrder;
ImageList_DragShowNolock(FALSE);
ImageList_EndDrag();
lpItem->bDown=FALSE;
if (infoPtr->iHotDivider == -1)
iNewOrder = -1;
else if (infoPtr->iHotDivider == infoPtr->uNumItem)
@ -1664,7 +1664,7 @@ HEADER_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
}
else
InvalidateRect(hwnd, &infoPtr->items[infoPtr->iMoveItem].rect, FALSE);
HEADER_SetHotDivider(hwnd, FALSE, -1);
}
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);
ReleaseDC (hwnd, hdc);
}
if (!HEADER_SendNotifyWithIntFieldT(hwnd, HDN_ITEMCHANGINGW, infoPtr->iMoveItem, HDI_WIDTH, iNewWidth))
{
infoPtr->items[infoPtr->iMoveItem].cxy = iNewWidth;
@ -1796,7 +1796,7 @@ HEADER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
}
}
}
if (infoPtr->bDragging)
{
POINT drag;
@ -1806,7 +1806,7 @@ HEADER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
ImageList_DragMove(drag.x, drag.y);
HEADER_SetHotDivider(hwnd, TRUE, lParam);
}
if (infoPtr->bPressed && !infoPtr->bDragging) {
BOOL oldState = infoPtr->items[infoPtr->iMoveItem].bDown;
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;
RECT rcClient;
RECT rcScroll;
if (nWidth < 0) nWidth = 0;
infoPtr->items[infoPtr->iMoveItem].cxy = nWidth;
HEADER_SetItemBounds(hwnd);
GetClientRect(hwnd, &rcClient);
rcScroll = rcClient;
rcScroll.left = lpItem->rect.left + nOldWidth;
ScrollWindowEx(hwnd, nWidth - nOldWidth, 0, &rcScroll, &rcClient, NULL, NULL, 0);
InvalidateRect(hwnd, &lpItem->rect, FALSE);
UpdateWindow(hwnd);
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
* 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
* the specification mentioned above.
* If you discover missing features or bugs please note them below.
@ -74,15 +74,15 @@ HOTKEY_IsCombInv(const HOTKEY_INFO *infoPtr)
return TRUE;
if((infoPtr->InvComb & HKCOMB_A) && IsOnlySet(HOTKEYF_ALT))
return TRUE;
if((infoPtr->InvComb & HKCOMB_SC) &&
if((infoPtr->InvComb & HKCOMB_SC) &&
IsOnlySet(HOTKEYF_SHIFT | HOTKEYF_CONTROL))
return TRUE;
if((infoPtr->InvComb & HKCOMB_SA) && IsOnlySet(HOTKEYF_SHIFT | HOTKEYF_ALT))
return TRUE;
if((infoPtr->InvComb & HKCOMB_CA) &&
if((infoPtr->InvComb & HKCOMB_CA) &&
IsOnlySet(HOTKEYF_CONTROL | HOTKEYF_ALT))
return TRUE;
if((infoPtr->InvComb & HKCOMB_SCA) &&
if((infoPtr->InvComb & HKCOMB_SCA) &&
IsOnlySet(HOTKEYF_SHIFT | HOTKEYF_CONTROL | HOTKEYF_ALT))
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 */
static void
static void
HOTKEY_Refresh(HOTKEY_INFO *infoPtr, HDC hdc)
{
WCHAR KeyName[64];
@ -143,10 +143,10 @@ HOTKEY_Refresh(HOTKEY_INFO *infoPtr, HDC hdc)
HOTKEY_DrawHotKey (infoPtr, hdc, infoPtr->strNone, 4);
return;
}
if(infoPtr->HotKey)
Modifier = HIBYTE(infoPtr->HotKey);
else if(HOTKEY_IsCombInv(infoPtr))
else if(HOTKEY_IsCombInv(infoPtr))
Modifier = infoPtr->InvMod;
else
Modifier = infoPtr->CurrMod;
@ -199,7 +199,7 @@ HOTKEY_Paint(HOTKEY_INFO *infoPtr, HDC hdc)
static LRESULT
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));
return (LRESULT)infoPtr->HotKey;
}
@ -208,14 +208,14 @@ static void
HOTKEY_SetHotKey(HOTKEY_INFO *infoPtr, WORD hotKey)
{
infoPtr->HotKey = hotKey;
infoPtr->ScanCode =
infoPtr->ScanCode =
MAKELPARAM(0, MapVirtualKeyW(LOBYTE(infoPtr->HotKey), 0));
TRACE("(infoPtr=%p hotKey=%x) Modifiers: 0x%x, Virtual Key: %d\n", infoPtr,
hotKey, HIBYTE(infoPtr->HotKey), LOBYTE(infoPtr->HotKey));
InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
}
static void
static void
HOTKEY_SetRules(HOTKEY_INFO *infoPtr, WORD invComb, WORD invMod)
{
infoPtr->InvComb = invComb;
@ -407,7 +407,7 @@ HOTKEY_NCCreate (HWND hwnd, const CREATESTRUCTW *lpcs)
{
HOTKEY_INFO *infoPtr;
DWORD dwExStyle = GetWindowLongW (hwnd, GWL_EXSTYLE);
SetWindowLongW (hwnd, GWL_EXSTYLE,
SetWindowLongW (hwnd, GWL_EXSTYLE,
dwExStyle | WS_EX_CLIENTEDGE);
/* 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,
hdcOffScreen, origNewX - origRegX, origNewY - origRegY, SRCCOPY);
/* draw the image */
ImageList_InternalDragDraw(hdcOffScreen, origNewX - origRegX,
ImageList_InternalDragDraw(hdcOffScreen, origNewX - origRegX,
origNewY - origRegY);
/* draw the update region to the screen */
BitBlt(hdcDrag, origRegX, origRegY, sizeRegX, sizeRegY,
@ -955,7 +955,7 @@ ImageList_DragShowNolock (BOOL bShow)
if (!is_valid(InternalDrag.himl))
return FALSE;
TRACE("bShow=0x%X!\n", bShow);
/* DragImage is already visible/hidden */
@ -1024,7 +1024,7 @@ ImageList_DragShowNolock (BOOL bShow)
BOOL WINAPI
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);
}
@ -1144,9 +1144,9 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
if (!hImageListDC || !hImageDC || !hImageBmp ||
(bBlend && !hBlendMaskBmp) || (himl->hbmMask && !hMaskListDC))
goto cleanup;
hOldImageBmp = SelectObject(hImageDC, hImageBmp);
/*
* To obtain a transparent look, background color should be set
* to white and foreground color to black when blting the
@ -2291,8 +2291,6 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT nIndex, HICON hIcon)
return -1;
}
if (ii.hbmColor == 0)
ERR("no color!\n");
ret = GetObjectW (ii.hbmMask, sizeof(BITMAP), (LPVOID)&bmp);
if (!ret) {
ERR("couldn't get mask bitmap info\n");
@ -2317,18 +2315,32 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT nIndex, HICON hIcon)
if (hdcImage == 0)
ERR("invalid hdcImage!\n");
imagelist_point_from_index(himl, nIndex, &pt);
SetTextColor(himl->hdcImage, RGB(0,0,0));
SetBkColor (himl->hdcImage, RGB(255,255,255));
hbmOldSrc = SelectObject (hdcImage, ii.hbmColor);
imagelist_point_from_index(himl, nIndex, &pt);
StretchBlt (himl->hdcImage, pt.x, pt.y, himl->cx, himl->cy,
hdcImage, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY);
if (himl->hbmMask) {
SelectObject (hdcImage, ii.hbmMask);
StretchBlt (himl->hdcMask, pt.x, pt.y, himl->cx, himl->cy,
hdcImage, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY);
if (ii.hbmColor)
{
hbmOldSrc = SelectObject (hdcImage, ii.hbmColor);
StretchBlt (himl->hdcImage, pt.x, pt.y, himl->cx, himl->cy,
hdcImage, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY);
if (himl->hbmMask)
{
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);
@ -2570,8 +2582,6 @@ ImageList_SetImageCount (HIMAGELIST himl, UINT iImageCount)
if (!is_valid(himl))
return FALSE;
if (iImageCount < 0)
return FALSE;
if (himl->cMaxImage > iImageCount)
{
himl->cCurImage = iImageCount;

View file

@ -22,14 +22,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* NOTE
*
*
* This code was audited for completeness against the documented features
* 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
* the specification mentioned above.
* If you discover missing features, or bugs, please note them below.
*
*
*/
#include <ctype.h>
@ -66,7 +66,7 @@ typedef struct
IPPART_INFO Part[4];
} 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 };
#define POS_DEFAULT 0
@ -142,10 +142,10 @@ static LRESULT IPADDRESS_Draw (const IPADDRESS_INFO *infoPtr, HDC hdc)
bgCol = COLOR_3DFACE;
fgCol = COLOR_GRAYTEXT;
}
FillRect (hdc, &rect, (HBRUSH)(DWORD_PTR)(bgCol+1));
DrawEdge (hdc, &rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
SetBkColor (hdc, GetSysColor(bgCol));
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;
SetTimer(infoPtr->hwndSelf, MC_NEXTMONTHTIMER, MC_NEXTMONTHDELAY, 0);
InvalidateRect(infoPtr->hwndSelf, NULL, FALSE);
return TRUE;
return 0;
}
if(hit == MCHT_TITLEBTNPREV){
MONTHCAL_GoToPrevMonth(infoPtr);
infoPtr->status = MC_PREVPRESSED;
SetTimer(infoPtr->hwndSelf, MC_PREVMONTHTIMER, MC_NEXTMONTHDELAY, 0);
InvalidateRect(infoPtr->hwndSelf, NULL, FALSE);
return TRUE;
return 0;
}
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_SETBUDDY, (WPARAM) infoPtr->hWndYearEdit, (LPARAM)0 );
SendMessageW( infoPtr->hWndYearUpDown, UDM_SETPOS, (WPARAM) 0,(LPARAM)infoPtr->currentYear );
return TRUE;
return 0;
}
if(hit == MCHT_TODAYLINK) {
NMSELCHANGE nmsc;
infoPtr->curSelDay = infoPtr->todaysDate.wDay;
infoPtr->firstSelDay = infoPtr->todaysDate.wDay;
infoPtr->currentMonth=infoPtr->todaysDate.wMonth;
infoPtr->currentYear=infoPtr->todaysDate.wYear;
MONTHCAL_CopyTime(&infoPtr->todaysDate, &infoPtr->minSel);
MONTHCAL_CopyTime(&infoPtr->todaysDate, &infoPtr->maxSel);
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) {
SYSTEMTIME selArray[2];
@ -1511,10 +1527,10 @@ MONTHCAL_LButtonDown(MONTHCAL_INFO *infoPtr, LPARAM lParam)
infoPtr->firstSelDay = ht.st.wDay;
infoPtr->curSelDay = ht.st.wDay;
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
* 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
* the specification mentioned above.
* If you discover missing features or bugs please note them below.
@ -43,11 +43,11 @@
*
* IMPLEMENTATION NOTES:
* 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
* region that is automatically set around the client area. As the
* entire client area now consists of the child window, we must
* allocate space (WM_NCCALCSIZE) for the buttons and draw them as
* region that is automatically set around the client area. As the
* entire client area now consists of the child window, we must
* allocate space (WM_NCCALCSIZE) for the buttons and draw them as
* a non-client area (WM_NCPAINT).
* Robert Shearman <rob@codeweavers.com>
*/
@ -493,7 +493,7 @@ PAGER_UpdateBtns(PAGER_INFO *infoPtr, INT scrollRange, BOOL hideGrayBtns)
SWP_NOZORDER | SWP_NOACTIVATE);
/* repaint when changing any state */
repaintBtns = (oldTLbtnState != infoPtr->TLbtnState) ||
repaintBtns = (oldTLbtnState != infoPtr->TLbtnState) ||
(oldBRbtnState != infoPtr->BRbtnState);
if (repaintBtns)
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)
{
DWORD oldStyle = infoPtr->dwStyle;
@ -1245,7 +1245,7 @@ PAGER_StyleChanged(PAGER_INFO *infoPtr, WPARAM wStyleType, const STYLESTRUCT *lp
wStyleType, lpss->styleOld, lpss->styleNew);
if (wStyleType != GWL_STYLE) return 0;
infoPtr->dwStyle = lpss->styleNew;
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
*
* NOTE
*
*
* This code was audited for completeness against the documented features
* 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
* the specification mentioned above.
* 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;
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);
/* 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);
if (IsThemeBackgroundPartiallyTransparent (pdi.theme, part, 0))
DrawThemeParentBackground (infoPtr->Self, hdc, NULL);
@ -402,7 +402,7 @@ static LRESULT PROGRESS_Draw (PROGRESS_INFO *infoPtr, HDC hdc)
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 */
const int gapStart = max((ledMEnd - leds) * ledW, 0);
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);
if(!barSmooth)
ledWidth = get_led_size( infoPtr, style, &rect ) +
ledWidth = get_led_size( infoPtr, style, &rect ) +
get_led_gap( infoPtr );
else
ledWidth = 1;
leds = (get_bar_size( style, &rect ) + ledWidth - 1) /
leds = (get_bar_size( style, &rect ) + ledWidth - 1) /
ledWidth;
/* increment the marquee progress */
@ -556,7 +556,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
case WM_CREATE:
{
DWORD dwExStyle = GetWindowLongW (hwnd, GWL_EXSTYLE);
theme = OpenThemeData (hwnd, themeClass);
dwExStyle &= ~(WS_EX_CLIENTEDGE | WS_EX_WINDOWEDGE);
@ -614,18 +614,18 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
case WM_THEMECHANGED:
{
DWORD dwExStyle = GetWindowLongW (hwnd, GWL_EXSTYLE);
theme = GetWindowTheme (hwnd);
CloseThemeData (theme);
theme = OpenThemeData (hwnd, themeClass);
/* WS_EX_STATICEDGE disappears when the control is themed */
if (theme)
dwExStyle &= ~WS_EX_STATICEDGE;
else
dwExStyle |= WS_EX_STATICEDGE;
SetWindowLongW (hwnd, GWL_EXSTYLE, dwExStyle);
InvalidateRect (hwnd, NULL, FALSE);
return 0;
}

View file

@ -22,7 +22,7 @@
*
* This code was audited for completeness against the documented features
* 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
* the specification mentioned above.
* If you discover missing features, or bugs, please note them below.
@ -157,7 +157,7 @@ static const WCHAR PropSheetInfoStr[] =
/* Wizard metrics specified in DLUs */
#define WIZARD_PADDING 7
#define WIZARD_HEADER_HEIGHT 36
/******************************************************************************
* Prototypes
*/
@ -212,7 +212,7 @@ static VOID PROPSHEET_UnImplementedFlags(DWORD dwFlags)
static void PROPSHEET_GetPageRect(const PropSheetInfo * psInfo, HWND hwndDlg,
RECT *rc, LPCPROPSHEETPAGEW ppshpage)
{
if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD) {
if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD) {
HWND hwndChild;
RECT r;
@ -990,7 +990,7 @@ static BOOL PROPSHEET_AdjustButtonsWizard(HWND hwndParent,
* All buttons will be at this y coordinate.
*/
y = rcSheet.bottom - (padding.y + buttonHeight);
/*
* Position the Back button.
*/
@ -1005,9 +1005,9 @@ static BOOL PROPSHEET_AdjustButtonsWizard(HWND hwndParent,
* Position the Next button.
*/
hwndButton = GetDlgItem(hwndParent, IDC_NEXT_BUTTON);
x += buttonWidth;
SetWindowPos(hwndButton, 0, x, y, 0, 0,
SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
@ -1015,7 +1015,7 @@ static BOOL PROPSHEET_AdjustButtonsWizard(HWND hwndParent,
* Position the Finish button.
*/
hwndButton = GetDlgItem(hwndParent, IDC_FINISH_BUTTON);
if (psInfo->hasFinish)
x += padding.x + buttonWidth;
@ -1051,7 +1051,7 @@ static BOOL PROPSHEET_AdjustButtonsWizard(HWND hwndParent,
ShowWindow(hwndButton, SW_HIDE);
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;
/*
@ -1067,7 +1067,7 @@ static BOOL PROPSHEET_AdjustButtonsWizard(HWND hwndParent,
/*
* Position and resize the header sunken line.
*/
SetWindowPos(hwndLineHeader, 0, 0, 0, rcSheet.right, 2,
SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);
if (!(psInfo->ppshheader.dwFlags & (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW)))
@ -1327,10 +1327,10 @@ static UINT GetTemplateSize(const DLGTEMPLATE* pTemplate)
while (nrofitems > 0)
{
p = (WORD*)(((DWORD_PTR)p + 3) & ~3); /* DWORD align */
/* skip header */
p += (istemplateex ? sizeof(MyDLGITEMTEMPLATEEX) : sizeof(DLGITEMTEMPLATE))/sizeof(WORD);
/* check class */
switch ((WORD)*p)
{
@ -1365,7 +1365,7 @@ static UINT GetTemplateSize(const DLGTEMPLATE* pTemplate)
p += *p / sizeof(WORD) + 1; /* Skip extra data */
--nrofitems;
}
ret = (p - (const WORD*)pTemplate) * sizeof(WORD);
TRACE("%p %p size 0x%08x\n", p, pTemplate, ret);
return ret;
@ -1445,7 +1445,7 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
temp = Alloc(resSize);
if (!temp)
return FALSE;
TRACE("copying pTemplate %p into temp %p (%d)\n", pTemplate, temp, resSize);
memcpy(temp, pTemplate, resSize);
pTemplate = temp;
@ -1521,13 +1521,13 @@ static VOID PROPSHEET_LoadWizardBitmaps(PropSheetInfo *psInfo)
{
if (psInfo->ppshheader.dwFlags & (PSH_WIZARD97_NEW | PSH_WIZARD97_OLD))
{
/* 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
/* 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
considers hbmWatermark as valid. */
if ((psInfo->ppshheader.dwFlags & PSH_WATERMARK) &&
!(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);
}
@ -1535,7 +1535,7 @@ static VOID PROPSHEET_LoadWizardBitmaps(PropSheetInfo *psInfo)
if ((psInfo->ppshheader.dwFlags & PSH_HEADER) &&
!(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);
}
}
@ -1590,7 +1590,7 @@ static BOOL PROPSHEET_ShowPage(HWND hwndDlg, int index, PropSheetInfo * psInfo)
{
hwndLineHeader = GetDlgItem(hwndDlg, IDC_SUNKEN_LINEHEADER);
ppshpage = (LPCPROPSHEETPAGEW)psInfo->proppage[index].hpage;
if ((ppshpage->dwFlags & PSP_HIDEHEADER) || (!(psInfo->ppshheader.dwFlags & PSH_HEADER)) )
ShowWindow(hwndLineHeader, SW_HIDE);
else
@ -2447,7 +2447,7 @@ EnumChildProc(HWND hwnd, LPARAM lParam)
SetFocus(hwnd);
return FALSE;
}
}
}
else
{
EnumChildWindows(hwnd, EnumChildProc, 0);
@ -2490,7 +2490,7 @@ static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags)
{
/* Hide the Next button */
ShowWindow(hwndNext, SW_HIDE);
/* Show the Finish button */
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 */
EnumChildWindows(PropSheet_GetCurrentPageHwnd(hwndDlg), EnumChildProc, 0);
}
/******************************************************************************
@ -3276,12 +3276,12 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
hdcSrc = CreateCompatibleDC(0);
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);
if ( (!(ppshpage->dwFlags & PSP_HIDEHEADER)) &&
(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);
HFONT hOldFont;
@ -3295,7 +3295,7 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
MapWindowPoints(hwndLineHeader, hwnd, (LPPOINT) &r, 2);
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)
{
@ -3345,7 +3345,7 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
}
clrOld = SetTextColor (hdc, 0x00000000);
oldBkMode = SetBkMode (hdc, TRANSPARENT);
oldBkMode = SetBkMode (hdc, TRANSPARENT);
if (ppshpage->dwFlags & PSP_USEHEADERTITLE) {
SetRect(&r, 20, 10, 0, 0);
@ -3388,9 +3388,9 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
if ( (ppshpage->dwFlags & PSP_HIDEHEADER) &&
(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);
MapWindowPoints(hwndLine, hwnd, (LPPOINT) &r, 2);
@ -3423,10 +3423,10 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
DeleteObject(hbr);
}
SelectObject(hdcSrc, hbmp);
SelectObject(hdcSrc, hbmp);
}
if (psInfo->ppshheader.dwFlags & PSH_USEHPLWATERMARK)
if (psInfo->ppshheader.dwFlags & PSH_USEHPLWATERMARK)
SelectPalette(hdc, hOldPal, FALSE);
DeleteDC(hdcSrc);
@ -3478,7 +3478,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
psInfo->hFont = CreateFontIndirectW (&logFont);
logFont.lfWeight = FW_BOLD;
psInfo->hFontBold = CreateFontIndirectW (&logFont);
/*
* Small icon in the title bar.
*/
@ -3612,7 +3612,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return FALSE;
}
case WM_SYSCOLORCHANGE:
COMCTL32_RefreshSysColors();
return FALSE;

View file

@ -21,7 +21,7 @@
*
* This code was audited for completeness against the documented features
* 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
* the specification mentioned above.
* 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;
dest->left = src->top;
dest->top = tmp;
tmp = src->right;
dest->right = src->bottom;
dest->bottom = tmp;
@ -626,7 +626,7 @@ REBAR_DrawBand (HDC hdc, const REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
{
if (theme)
{
int stateId;
int stateId;
if (lpBand->fDraw & DRAW_CHEVRONPUSHED)
stateId = CHEVS_PRESSED;
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->cyIntegral != lprbbi->cyIntegral ) ) ) ||
( (lprbbi->cbSize < sizeof (REBARBANDINFOA)) &&
( (lpBand->cyChild ||
lpBand->cyMaxChild ||
( (lpBand->cyChild ||
lpBand->cyMaxChild ||
lpBand->cyIntegral ) ) ) ) )
{
lpBand->cxMinChild = lprbbi->cxMinChild;
@ -2510,7 +2510,7 @@ REBAR_SetBandInfoT(REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, BOOL bUnic
else
Str_SetPtrAtoW(&wstr, (LPSTR)lprbbi->lpText);
if (REBAR_strdifW(wstr, lprbbi->lpText)) {
if (REBAR_strdifW(wstr, lpBand->lpText)) {
Free(lpBand->lpText);
lpBand->lpText = wstr;
bChanged = TRUE;
@ -2725,13 +2725,13 @@ REBAR_Create (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
}
TRACE("created!\n");
if ((theme = OpenThemeData (infoPtr->hwndSelf, themeClass)))
{
/* native seems to clear WS_BORDER when themed */
infoPtr->dwStyle &= ~WS_BORDER;
}
return 0;
}
@ -2767,7 +2767,7 @@ REBAR_Destroy (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
DestroyCursor (infoPtr->hcurDrag);
if(infoPtr->hDefaultFont) DeleteObject (infoPtr->hDefaultFont);
SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0);
CloseThemeData (GetWindowTheme (infoPtr->hwndSelf));
/* free rebar info data */
@ -3326,7 +3326,7 @@ REBAR_Size (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
infoPtr->fStatus, lParam);
return 0;
}
/* FIXME: wrong */
if (infoPtr->dwStyle & RBS_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
*
* NOTE
*
*
* This code was audited for completeness against the documented features
* 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
* the specification mentioned above.
* If you discover missing features, or bugs, please note them below.
*
*
* TODO:
* -- CCS_BOTTOM (default)
* -- CCS_LEFT
@ -115,13 +115,13 @@ STATUSBAR_DrawSizeGrip (HTHEME theme, HDC hdc, LPRECT lpRect)
INT i;
TRACE("draw size grip %d,%d - %d,%d\n", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);
if (theme)
{
RECT gripperRect;
SIZE gripperSize;
gripperRect = *lpRect;
if (SUCCEEDED (GetThemePartSize (theme, hdc, SP_GRIPPER, 0, lpRect,
if (SUCCEEDED (GetThemePartSize (theme, hdc, SP_GRIPPER, 0, lpRect,
TS_DRAW, &gripperSize)))
{
gripperRect.left = gripperRect.right - gripperSize.cx;
@ -633,9 +633,8 @@ STATUSBAR_SetMinHeight (STATUS_INFO *infoPtr, INT height)
RECT parent_rect;
HTHEME theme;
GetClientRect (infoPtr->Notify, &parent_rect);
infoPtr->height = height + infoPtr->verticalBorder;
if ((theme = GetWindowTheme (infoPtr->Self)))
{
/* Determine bar height from theme such that the content area is
@ -650,14 +649,15 @@ STATUSBAR_SetMinHeight (STATUS_INFO *infoPtr, INT height)
}
ReleaseDC (infoPtr->Self, hdc);
}
width = parent_rect.right - parent_rect.left;
x = parent_rect.left;
y = parent_rect.bottom - infoPtr->height;
MoveWindow (infoPtr->Self, parent_rect.left,
parent_rect.bottom - infoPtr->height,
width, infoPtr->height, TRUE);
STATUSBAR_SetPartBounds (infoPtr);
if (GetClientRect (infoPtr->Notify, &parent_rect))
{
width = parent_rect.right - parent_rect.left;
x = parent_rect.left;
y = parent_rect.bottom - infoPtr->height;
MoveWindow (infoPtr->Self, x, y, width, infoPtr->height, TRUE);
STATUSBAR_SetPartBounds (infoPtr);
}
}
return TRUE;
@ -958,7 +958,7 @@ STATUSBAR_WMCreate (HWND hwnd, const CREATESTRUCTA *lpCreate)
infoPtr->parts[0].x = -1;
infoPtr->parts[0].style = 0;
infoPtr->parts[0].hIcon = 0;
OpenThemeData (hwnd, themeClass);
if (IsWindowUnicode (hwnd)) {
@ -1029,7 +1029,7 @@ STATUSBAR_WMCreate (HWND hwnd, const CREATESTRUCTA *lpCreate)
GetClientRect (infoPtr->Notify, &rect);
width = rect.right - rect.left;
infoPtr->height = textHeight + 4 + infoPtr->verticalBorder;
if ((theme = GetWindowTheme (hwnd)))
{
/* Determine bar height from theme such that the content area is
@ -1044,7 +1044,7 @@ STATUSBAR_WMCreate (HWND hwnd, const CREATESTRUCTA *lpCreate)
}
ReleaseDC (hwnd, hdc);
}
SetWindowPos(hwnd, 0, lpCreate->x, lpCreate->y - 1,
width, infoPtr->height, SWP_NOZORDER);
STATUSBAR_SetPartBounds (infoPtr);
@ -1191,13 +1191,13 @@ STATUSBAR_WMSize (STATUS_INFO *infoPtr, WORD flags)
if (GetWindowLongW(infoPtr->Self, GWL_STYLE) & CCS_NORESIZE) return FALSE;
/* 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;
x = parent_rect.left;
y = parent_rect.bottom - infoPtr->height;
MoveWindow (infoPtr->Self, parent_rect.left,
parent_rect.bottom - infoPtr->height,
width, infoPtr->height, TRUE);
MoveWindow (infoPtr->Self, x, y, width, infoPtr->height, TRUE);
STATUSBAR_SetPartBounds (infoPtr);
return TRUE;
}

View file

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

View file

@ -21,7 +21,7 @@
*
* This code was audited for completeness against the documented features
* 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
* the specification mentioned above.
* 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->Type = type;
Item->Blocks = NULL;
if(LastItem != NULL)
{
LastItem->Next = Item;
@ -157,9 +157,9 @@ static PDOC_ITEM SYSLINK_AppendDocItem (SYSLINK_INFO *infoPtr, LPCWSTR Text, UIN
{
infoPtr->Items = Item;
}
lstrcpynW(Item->Text, Text, textlen + 1);
return Item;
}
@ -170,7 +170,7 @@ static PDOC_ITEM SYSLINK_AppendDocItem (SYSLINK_INFO *infoPtr, LPCWSTR Text, UIN
static VOID SYSLINK_ClearDoc (SYSLINK_INFO *infoPtr)
{
PDOC_ITEM Item, Next;
Item = infoPtr->Items;
while(Item != NULL)
{
@ -178,7 +178,7 @@ static VOID SYSLINK_ClearDoc (SYSLINK_INFO *infoPtr)
SYSLINK_FreeDocItem(Item);
Item = Next;
}
infoPtr->Items = NULL;
}
@ -225,7 +225,7 @@ static UINT SYSLINK_ParseText (SYSLINK_INFO *infoPtr, LPCWSTR Text)
tmp = current + taglen;
lpID = NULL;
lpUrl = NULL;
CheckParameter:
/* compare the current position with all known parameters */
if(!StrCmpNIW(tmp, SL_HREF, 6))
@ -246,7 +246,7 @@ CheckParameter:
{
ValidParam = FALSE;
}
if(ValidParam)
{
/* we got a known parameter, now search until the next " character.
@ -290,7 +290,7 @@ CheckParameter:
tmp++;
}
}
if(ValidLink && ValidParam)
{
/* the <a ...> tag appears to be valid. save all information
@ -326,7 +326,7 @@ CheckParameter:
textstart = NULL;
textlen = 0;
}
/* now it's time to add the link to the document */
current += 4;
if(linktext != NULL && linklen > 0)
@ -389,7 +389,7 @@ CheckParameter:
textstart = current;
}
}
textlen += taglen;
current += taglen;
}
@ -403,11 +403,11 @@ CheckParameter:
{
textstart = current;
}
current++;
}
}
if(textstart != NULL && textlen > 0)
{
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");
return;
}
bl = DocItem->Blocks;
if (bl != NULL)
{
n = DocItem->nText;
while(n > 0)
{
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 */
PDOC_ITEM Last = NULL;
for(Current = infoPtr->Items; Current != NULL; Current = Current->Next)
{
if(Current->Type == slLink)
@ -584,7 +584,7 @@ static PDOC_ITEM SYSLINK_GetPrevLink (const SYSLINK_INFO *infoPtr, PDOC_ITEM Cur
{
/* returns the previous link */
PDOC_ITEM Cur, Prev = NULL;
for(Cur = infoPtr->Items; Cur != NULL; Cur = Cur->Next)
{
if(Cur == Current)
@ -617,7 +617,7 @@ static BOOL SYSLINK_WrapLine (HDC hdc, LPWSTR Text, WCHAR BreakChar, int *LineLe
*LineLen = nFit;
Current = Text + nFit;
/* check if we're in the middle of a word */
if((*Current) != BreakChar)
{
@ -627,7 +627,7 @@ static BOOL SYSLINK_WrapLine (HDC hdc, LPWSTR Text, WCHAR BreakChar, int *LineLe
Current--;
(*LineLen)--;
}
if((*LineLen) == 0)
{
Extent->cx = 0;
@ -661,13 +661,13 @@ static VOID SYSLINK_Render (const SYSLINK_INFO *infoPtr, HDC hdc, PRECT pRect)
rc.right = MAXLONG;
if (rc.bottom - SL_TOPMARGIN < 0)
rc.bottom = MAXLONG;
hOldFont = SelectObject(hdc, infoPtr->Font);
x = SL_LEFTMARGIN;
y = SL_TOPMARGIN;
LineHeight = 0;
for(Current = infoPtr->Items; Current != NULL; Current = Current->Next)
{
int n, nBlocks;
@ -697,7 +697,7 @@ static VOID SYSLINK_Render (const SYSLINK_INFO *infoPtr, HDC hdc, PRECT pRect)
{
SelectObject(hdc, infoPtr->LinkFont);
}
while(n > 0)
{
int SkipChars = 0;
@ -719,7 +719,7 @@ static VOID SYSLINK_Render (const SYSLINK_INFO *infoPtr, HDC hdc, PRECT pRect)
int LineLen = n;
BOOL Wrap = FALSE;
PDOC_TEXTBLOCK nbl;
if(n != 0)
{
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));
if (nbl != NULL)
{
@ -764,7 +764,7 @@ static VOID SYSLINK_Render (const SYSLINK_INFO *infoPtr, HDC hdc, PRECT pRect)
nBlocks++;
cbl = bl + nBlocks - 1;
cbl->nChars = LineLen;
cbl->nSkip = SkipChars;
cbl->rc.left = x;
@ -813,7 +813,7 @@ static VOID SYSLINK_Render (const SYSLINK_INFO *infoPtr, HDC hdc, PRECT pRect)
Current->Blocks = bl;
}
}
SelectObject(hdc, hOldFont);
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);
OldTextColor = SetTextColor(hdc, infoPtr->TextColor);
OldBkColor = SetBkColor(hdc, GetSysColor(COLOR_BTNFACE));
GetClientRect(infoPtr->Self, &rc);
rc.right -= SL_RIGHTMARGIN + SL_LEFTMARGIN;
rc.bottom -= SL_BOTTOMMARGIN + SL_TOPMARGIN;
@ -846,7 +846,7 @@ static LRESULT SYSLINK_Draw (const SYSLINK_INFO *infoPtr, HDC hdc)
int n;
LPWSTR tx;
PDOC_TEXTBLOCK bl;
bl = Current->Blocks;
if(bl != NULL)
{
@ -885,7 +885,7 @@ static LRESULT SYSLINK_Draw (const SYSLINK_INFO *infoPtr, HDC hdc)
SetBkColor(hdc, OldBkColor);
SetTextColor(hdc, OldTextColor);
SelectObject(hdc, hOldFont);
return 0;
}
@ -921,7 +921,7 @@ static HFONT SYSLINK_SetFont (SYSLINK_INFO *infoPtr, HFONT hFont, BOOL bRedraw)
RECT rcClient;
HFONT hOldFont = infoPtr->Font;
infoPtr->Font = hFont;
/* free the underline font */
if(infoPtr->LinkFont != NULL)
{
@ -952,12 +952,12 @@ static HFONT SYSLINK_SetFont (SYSLINK_INFO *infoPtr, HFONT hFont, BOOL bRedraw)
ReleaseDC(infoPtr->Self, hdc);
}
}
if(bRedraw)
{
RedrawWindow(infoPtr->Self, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW);
}
return hOldFont;
}
@ -971,12 +971,12 @@ static LRESULT SYSLINK_SetText (SYSLINK_INFO *infoPtr, LPCWSTR Text)
/* clear the document */
SYSLINK_ClearDoc(infoPtr);
if(Text == NULL || (textlen = lstrlenW(Text)) == 0)
{
return TRUE;
}
/* let's parse the string and create a document */
if(SYSLINK_ParseText(infoPtr, Text) > 0)
{
@ -995,7 +995,7 @@ static LRESULT SYSLINK_SetText (SYSLINK_INFO *infoPtr, LPCWSTR Text)
}
}
}
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)
{
PDOC_ITEM Current, PrevFocus = NULL;
for(Current = infoPtr->Items; Current != NULL; Current = Current->Next)
{
if(Current->Type == slLink)
@ -1017,7 +1017,7 @@ static PDOC_ITEM SYSLINK_SetFocusLink (const SYSLINK_INFO *infoPtr, const DOC_IT
{
PrevFocus = Current;
}
if(Current == DocItem)
{
Current->u.Link.state |= LIS_FOCUSED;
@ -1028,7 +1028,7 @@ static PDOC_ITEM SYSLINK_SetFocusLink (const SYSLINK_INFO *infoPtr, const DOC_IT
}
}
}
return PrevFocus;
}
@ -1109,16 +1109,16 @@ static LRESULT SYSLINK_SetItem (const SYSLINK_INFO *infoPtr, const LITEM *Item)
/* copy the bits */
di->u.Link.state |= (Item->state & Item->stateMask) & LIS_MASK;
Repaint = (oldstate != di->u.Link.state);
/* update the focus */
SYSLINK_SetFocusLink(infoPtr, ((di->u.Link.state & LIS_FOCUSED) ? di : NULL));
}
if(Repaint)
{
SYSLINK_RepaintLink(infoPtr, di);
}
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)
{
PDOC_ITEM di;
if(!(Item->mask & LIF_ITEMINDEX) || !(Item->mask & (LIF_FLAGSMASK)))
{
ERR("Invalid Flags!\n");
return FALSE;
}
di = SYSLINK_GetLinkItemByIndex(infoPtr, Item->iLink);
if(di == NULL)
{
ERR("Link %d couldn't be found\n", Item->iLink);
return FALSE;
}
if(Item->mask & LIF_STATE)
{
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;
}
}
if(Item->mask & LIF_ITEMID)
{
if(di->u.Link.szID)
@ -1164,7 +1164,7 @@ static LRESULT SYSLINK_GetItem (const SYSLINK_INFO *infoPtr, PLITEM Item)
Item->szID[0] = 0;
}
}
if(Item->mask & LIF_URL)
{
if(di->u.Link.szUrl)
@ -1176,7 +1176,7 @@ static LRESULT SYSLINK_GetItem (const SYSLINK_INFO *infoPtr, PLITEM Item)
Item->szUrl[0] = 0;
}
}
return TRUE;
}
@ -1204,7 +1204,7 @@ static BOOL SYSLINK_PtInDocItem (const DOC_ITEM *DocItem, POINT pt)
bl++;
}
}
return FALSE;
}
@ -1248,7 +1248,7 @@ static LRESULT SYSLINK_HitTest (const SYSLINK_INFO *infoPtr, PLHITTESTINFO HitTe
id++;
}
}
return FALSE;
}
@ -1264,7 +1264,7 @@ static LRESULT SYSLINK_GetIdealHeight (const SYSLINK_INFO *infoPtr)
LRESULT height;
TEXTMETRICW tm;
HGDIOBJ hOldFont = SelectObject(hdc, infoPtr->Font);
if(GetTextMetricsW(hdc, &tm))
{
height = tm.tmHeight;
@ -1275,7 +1275,7 @@ static LRESULT SYSLINK_GetIdealHeight (const SYSLINK_INFO *infoPtr)
}
SelectObject(hdc, hOldFont);
ReleaseDC(infoPtr->Self, hdc);
return height;
}
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)
{
PDOC_ITEM Focus;
infoPtr->HasFocus = TRUE;
/* 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_RepaintLink(infoPtr, Focus);
return 0;
}
@ -1347,10 +1347,10 @@ static LRESULT SYSLINK_SetFocus (SYSLINK_INFO *infoPtr, HWND PrevFocusWindow)
static LRESULT SYSLINK_KillFocus (SYSLINK_INFO *infoPtr, HWND NewFocusWindow)
{
PDOC_ITEM Focus;
infoPtr->HasFocus = FALSE;
Focus = SYSLINK_GetFocusLink(infoPtr, NULL);
if(Focus != NULL)
{
SYSLINK_RepaintLink(infoPtr, Focus);
@ -1421,7 +1421,7 @@ static LRESULT SYSLINK_LButtonUp (SYSLINK_INFO *infoPtr, DWORD Buttons, const PO
{
PDOC_ITEM Current;
int id;
Current = SYSLINK_LinkAtPt(infoPtr, pt, &id, TRUE);
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;
int id;
Focus = SYSLINK_GetFocusLink(infoPtr, &id);
if(Focus != NULL)
{
@ -1561,10 +1561,10 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
{
LHITTESTINFO ht;
DWORD mp = GetMessagePos();
ht.pt.x = (short)LOWORD(mp);
ht.pt.y = (short)HIWORD(mp);
ScreenToClient(infoPtr->Self, &ht.pt);
if(SYSLINK_HitTest (infoPtr, &ht))
{
@ -1614,7 +1614,7 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
pt.y = (short)HIWORD(lParam);
return SYSLINK_LButtonUp(infoPtr, wParam, &pt);
}
case WM_KEYDOWN:
{
switch(wParam)
@ -1631,7 +1631,7 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
}
goto HandleDefaultMessage;
}
case WM_GETDLGCODE:
{
LRESULT Ret = DLGC_HASSETSEL;
@ -1657,14 +1657,14 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
}
return Ret;
}
case WM_NCHITTEST:
{
POINT pt;
RECT rc;
pt.x = (short)LOWORD(lParam);
pt.y = (short)HIWORD(lParam);
GetClientRect(infoPtr->Self, &rc);
ScreenToClient(infoPtr->Self, &pt);
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 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);
/* 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 */
InflateRect(prc, CONTROL_BORDER_SIZEX, CONTROL_BORDER_SIZEY);
@ -1098,7 +1098,7 @@ static void TAB_SetItemBounds (TAB_INFO *infoPtr)
/* Now use hPadding and vPadding */
infoPtr->uHItemPadding = infoPtr->uHItemPadding_s;
infoPtr->uVItemPadding = infoPtr->uVItemPadding_s;
/* The leftmost item will be "0" aligned */
curItemLeftPos = 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
* selected item + extra space for the selected item.
*/
infoPtr->tabHeight = item_height +
infoPtr->tabHeight = item_height +
((lStyle & TCS_BUTTONS) ? 2 : 1) *
infoPtr->uVItemPadding;
@ -1150,7 +1150,7 @@ static void TAB_SetItemBounds (TAB_INFO *infoPtr)
for (curItem = 0; curItem < infoPtr->uNumItem; curItem++)
{
TAB_ITEM *curr = TAB_GetItem(infoPtr, curItem);
/* Set the leftmost position of the tab. */
curr->rect.left = curItemLeftPos;
@ -1203,7 +1203,7 @@ static void TAB_SetItemBounds (TAB_INFO *infoPtr)
*/
if (((lStyle & TCS_MULTILINE) || (lStyle & TCS_VERTICAL)) &&
(curr->rect.right >
(curr->rect.right >
(clientRect.right - CONTROL_BORDER_SIZEX - DISPLAY_AREA_PADDINGX)))
{
curr->rect.right -= curr->rect.left;
@ -1283,7 +1283,7 @@ static void TAB_SetItemBounds (TAB_INFO *infoPtr)
{
/* normalize the current rect */
TAB_ITEM *curr = TAB_GetItem(infoPtr, iItm);
/* shift the item to the left side of the clientRect */
curr->rect.right -= curr->rect.left;
curr->rect.left = 0;
@ -1501,7 +1501,7 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect
HPEN holdPen;
INT oldBkMode;
HFONT hOldFont;
/* if (drawRect == NULL) */
{
BOOL isVisible;
@ -1530,7 +1530,7 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect
*drawRect = selectedRect;
else
*drawRect = itemRect;
if (lStyle & TCS_BUTTONS)
{
if (iItem == infoPtr->iSelected)
@ -1634,8 +1634,8 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect
*/
oldBkMode = SetBkMode(hdc, TRANSPARENT);
if (!GetWindowTheme (infoPtr->hwnd) || (lStyle & TCS_BUTTONS))
SetTextColor(hdc, (((lStyle & TCS_HOTTRACK) && (iItem == infoPtr->iHotTracked)
&& !(lStyle & TCS_FLATBUTTONS))
SetTextColor(hdc, (((lStyle & TCS_HOTTRACK) && (iItem == infoPtr->iHotTracked)
&& !(lStyle & TCS_FLATBUTTONS))
| (TAB_GetItem(infoPtr, iItem)->dwState & TCIS_HIGHLIGHTED)) ?
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;
if ( iItem == infoPtr->iSelected )
dis.itemState |= ODS_SELECTED;
if (infoPtr->uFocus == iItem)
if (infoPtr->uFocus == iItem)
dis.itemState |= ODS_FOCUS;
dis.hwndItem = infoPtr->hwnd;
dis.hDC = hdc;
@ -1713,7 +1713,7 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect
{
INT cx;
INT cy;
ImageList_GetIconSize(infoPtr->himl, &cx, &cy);
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)
center_offset_h = 2;
if (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",
debugstr_w(item->pszText), center_offset_h, center_offset_v,
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)
{
DrawEdge(hdc, &r, EDGE_SUNKEN, BF_SOFT|BF_RECT);
OffsetRect(&r, 1, 1);
}
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.
* However, since in Wine apps may get themed that did not opt in via
* a manifest avoid theming when we know the result will be wrong */
if ((theme = GetWindowTheme (infoPtr->hwnd))
if ((theme = GetWindowTheme (infoPtr->hwnd))
&& ((lStyle & (TCS_VERTICAL | TCS_BOTTOM)) == 0))
{
static const int partIds[8] = {
@ -2325,11 +2325,6 @@ static void TAB_Refresh (TAB_INFO *infoPtr, HDC hdc)
/* Then, draw the selected item */
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);
@ -2506,13 +2501,13 @@ static void TAB_InvalidateTabArea(const TAB_INFO *infoPtr)
if (infoPtr->uNumRows == 1)
rInvalidate.right = clientRect.left + rect.right + 2 * SELECTED_TAB_OFFSET;
}
else
else
{
rInvalidate.bottom = rAdjClient.top;
if (infoPtr->uNumRows == 1)
rInvalidate.right = clientRect.left + rect.right + 2 * SELECTED_TAB_OFFSET;
}
/* Punch out the updown control */
if (infoPtr->needsScrolling && (rInvalidate.right > 0)) {
RECT r;
@ -2522,11 +2517,11 @@ static void TAB_InvalidateTabArea(const TAB_INFO *infoPtr)
else
rInvalidate.right = clientRect.right - r.left;
}
TRACE("invalidate (%d,%d)-(%d,%d)\n",
rInvalidate.left, rInvalidate.top,
rInvalidate.right, rInvalidate.bottom);
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);
else
memset(item->extra, 0, infoPtr->cbInfo);
TAB_SetItemBounds(infoPtr);
if (infoPtr->uNumItem > 1)
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",
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;
}
@ -2688,7 +2687,7 @@ static inline LRESULT TAB_SetMinTabWidth (TAB_INFO *infoPtr, INT cx)
return oldcx;
}
static inline LRESULT
static inline LRESULT
TAB_HighlightItem (TAB_INFO *infoPtr, INT iItem, BOOL fHighlight)
{
LPDWORD lpState;
@ -2697,7 +2696,7 @@ TAB_HighlightItem (TAB_INFO *infoPtr, INT iItem, BOOL fHighlight)
if (!infoPtr || iItem < 0 || iItem >= infoPtr->uNumItem)
return FALSE;
lpState = &TAB_GetItem(infoPtr, iItem)->dwState;
if (fHighlight)
@ -3019,7 +3018,7 @@ static LRESULT TAB_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
}
OpenThemeData (infoPtr->hwnd, themeClass);
/*
* We need to get text information so we need a DC and we need to select
* a font.
@ -3064,8 +3063,7 @@ TAB_Destroy (TAB_INFO *infoPtr)
if (infoPtr->items) {
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);
}
@ -3080,7 +3078,7 @@ TAB_Destroy (TAB_INFO *infoPtr)
KillTimer(infoPtr->hwnd, TAB_HOTTRACK_TIMER);
CloseThemeData (GetWindowTheme (infoPtr->hwnd));
Free (infoPtr);
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 */
return FALSE;
}
infoPtr->cbInfo = cbInfo;
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);
InflateRect( &rectEdit, -1, -1 );
if(dwStyle & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE))
{
DRAWITEMSTRUCT dis;
@ -106,7 +106,7 @@ static void paint_text (HWND hwnd, HDC hdc, DWORD dwStyle, const COMBOBOXINFO *c
clipRegion=NULL;
}
if (!IsWindowEnabled(hwnd) & WS_DISABLED) itemState |= ODS_DISABLED;
if (!IsWindowEnabled(hwnd)) itemState |= ODS_DISABLED;
dis.CtlType = ODT_COMBOBOX;
dis.CtlID = ctlid;
@ -158,7 +158,7 @@ static void paint_text (HWND hwnd, HDC hdc, DWORD dwStyle, const COMBOBOXINFO *c
if( hPrevFont )
SelectObject(hdc, hPrevFont );
HeapFree( GetProcessHeap(), 0, pText );
}
@ -179,10 +179,10 @@ static LRESULT paint (HTHEME theme, HWND hwnd, HDC hParamDC, ULONG state)
{
RECT frameRect;
int buttonState;
cbi.cbSize = sizeof (cbi);
SendMessageW (hwnd, CB_GETCOMBOBOXINFO, 0, (LPARAM)&cbi);
/* paint border */
if ((dwStyle & CBS_DROPDOWNLIST) != CBS_SIMPLE)
GetClientRect (hwnd, &frameRect);
@ -190,14 +190,14 @@ static LRESULT paint (HTHEME theme, HWND hwnd, HDC hParamDC, ULONG state)
{
CopyRect (&frameRect, &cbi.rcItem);
InflateRect(&frameRect,
EDIT_CONTROL_PADDING + COMBO_XBORDERSIZE,
InflateRect(&frameRect,
EDIT_CONTROL_PADDING + COMBO_XBORDERSIZE,
EDIT_CONTROL_PADDING + COMBO_YBORDERSIZE);
}
DrawThemeBackground (theme, hDC, 0,
DrawThemeBackground (theme, hDC, 0,
IsWindowEnabled (hwnd) ? CBXS_NORMAL : CBXS_DISABLED, &frameRect, NULL);
/* paint button */
if (cbi.stateButton != STATE_SYSTEM_INVISIBLE)
{
@ -209,7 +209,7 @@ static LRESULT paint (HTHEME theme, HWND hwnd, HDC hParamDC, ULONG state)
buttonState = CBXS_HOT;
else
buttonState = CBXS_NORMAL;
DrawThemeBackground (theme, hDC, CP_DROPDOWNBUTTON, buttonState,
DrawThemeBackground (theme, hDC, CP_DROPDOWNBUTTON, buttonState,
&cbi.rcButton, NULL);
}
@ -228,21 +228,21 @@ static LRESULT paint (HTHEME theme, HWND hwnd, HDC hParamDC, ULONG state)
/**********************************************************************
* The combo control subclass window proc.
*/
LRESULT CALLBACK THEMING_ComboSubclassProc (HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam,
LRESULT CALLBACK THEMING_ComboSubclassProc (HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam,
ULONG_PTR dwRefData)
{
const WCHAR* themeClass = WC_COMBOBOXW;
HTHEME theme;
LRESULT result;
switch (msg)
{
case WM_CREATE:
result = THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
OpenThemeData( hwnd, themeClass );
return result;
case WM_DESTROY:
theme = GetWindowTheme( hwnd );
CloseThemeData ( theme );
@ -253,21 +253,21 @@ LRESULT CALLBACK THEMING_ComboSubclassProc (HWND hwnd, UINT msg,
CloseThemeData ( theme );
OpenThemeData( hwnd, themeClass );
break;
case WM_SYSCOLORCHANGE:
theme = GetWindowTheme( hwnd );
if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
/* Do nothing. When themed, a WM_THEMECHANGED will be received, too,
* which will do the repaint. */
break;
case WM_PAINT:
theme = GetWindowTheme( hwnd );
if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
return paint (theme, hwnd, (HDC)wParam, dwRefData);
case WM_SETREDRAW:
/* Since there doesn't seem to be WM_GETREDRAW, do redraw tracking in
/* Since there doesn't seem to be WM_GETREDRAW, do redraw tracking in
* the subclass as well. */
if( wParam )
dwRefData &= ~STATE_NOREDRAW;
@ -275,7 +275,7 @@ LRESULT CALLBACK THEMING_ComboSubclassProc (HWND hwnd, UINT msg,
dwRefData |= STATE_NOREDRAW;
THEMING_SetSubclassData (hwnd, dwRefData);
return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
case WM_MOUSEMOVE:
{
/* Dropdown button hot-tracking */
@ -286,7 +286,7 @@ LRESULT CALLBACK THEMING_ComboSubclassProc (HWND hwnd, UINT msg,
pt.y = (short)HIWORD(lParam);
cbi.cbSize = sizeof (cbi);
SendMessageW (hwnd, CB_GETCOMBOBOXINFO, 0, (LPARAM)&cbi);
if (cbi.stateButton != STATE_SYSTEM_INVISIBLE)
{
if (PtInRect (&cbi.rcButton, pt))
@ -295,7 +295,7 @@ LRESULT CALLBACK THEMING_ComboSubclassProc (HWND hwnd, UINT msg,
{
dwRefData |= STATE_HOT;
THEMING_SetSubclassData (hwnd, dwRefData);
RedrawWindow (hwnd, &cbi.rcButton, 0,
RedrawWindow (hwnd, &cbi.rcButton, 0,
RDW_INVALIDATE | RDW_UPDATENOW);
}
}
@ -305,15 +305,15 @@ LRESULT CALLBACK THEMING_ComboSubclassProc (HWND hwnd, UINT msg,
{
dwRefData &= ~STATE_HOT;
THEMING_SetSubclassData (hwnd, dwRefData);
RedrawWindow (hwnd, &cbi.rcButton, 0,
RedrawWindow (hwnd, &cbi.rcButton, 0,
RDW_INVALIDATE | RDW_UPDATENOW);
}
}
}
}
return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
default:
default:
/* Call old proc */
return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
}

View file

@ -35,8 +35,8 @@
/**********************************************************************
* The dialog subclass window proc.
*/
LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg,
WPARAM wParam, LPARAM lParam,
LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg,
WPARAM wParam, LPARAM lParam,
ULONG_PTR dwRefData)
{
HTHEME theme = GetWindowTheme ( hWnd );
@ -44,14 +44,14 @@ LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg,
BOOL themingActive = IsThemeDialogTextureEnabled (hWnd);
BOOL doTheming = themingActive && (theme != NULL);
LRESULT result;
switch (msg)
{
case WM_CREATE:
result = THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
theme = OpenThemeData( hWnd, themeClass );
return result;
case WM_DESTROY:
CloseThemeData ( theme );
return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
@ -61,13 +61,13 @@ LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg,
OpenThemeData( hWnd, themeClass );
InvalidateRect( hWnd, NULL, TRUE );
return 0;
case WM_SYSCOLORCHANGE:
if (!doTheming) return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
/* Do nothing. When themed, a WM_THEMECHANGED will be received, too,
* which will do the repaint. */
break;
case WM_ERASEBKGND:
if (!doTheming) return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
{
@ -78,20 +78,20 @@ LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg,
/* Draw background*/
GetClientRect (hWnd, &rc);
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
* dialog theming is activated, the good ol' BTNFACE
* dialog theming is activated, the good ol' BTNFACE
* background seems to be used. */
#if 0
DrawThemeBackground (theme, (HDC)wParam, WP_DIALOG, 0, &rc,
DrawThemeBackground (theme, (HDC)wParam, WP_DIALOG, 0, &rc,
NULL);
#endif
return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
else
/* We might have gotten a TAB theme class, so check if we can
else
/* We might have gotten a TAB theme class, so check if we can
* draw as a tab page. */
if (IsThemePartDefined (theme, TABP_BODY, 0))
DrawThemeBackground (theme, (HDC)wParam, TABP_BODY, 0, &rc,
DrawThemeBackground (theme, (HDC)wParam, TABP_BODY, 0, &rc,
NULL);
else
return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
@ -112,11 +112,11 @@ LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg,
WCHAR controlClass[32];
RECT rc;
GetClassNameW (controlWnd, controlClass,
GetClassNameW (controlWnd, controlClass,
sizeof(controlClass) / sizeof(controlClass[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. */
GetClientRect (controlWnd, &rc);
DrawThemeParentBackground (controlWnd, controlDC, &rc);
@ -132,7 +132,7 @@ LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg,
return result;
}
default:
default:
/* Call old proc */
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 state = ETS_NORMAL;
DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE);
if (!IsWindowEnabled (hwnd))
state = ETS_DISABLED;
else if (dwStyle & ES_READONLY)
state = ETS_READONLY;
else if (GetFocus() == hwnd)
state = ETS_FOCUSED;
GetWindowRect(hwnd, &r);
/* New clipping region passed to default proc to exclude border */
cliprgn = CreateRectRgn (r.left + cxEdge, r.top + cyEdge,
r.right - cxEdge, r.bottom - cyEdge);
if (region != (HRGN)1)
CombineRgn (cliprgn, cliprgn, region, RGN_AND);
OffsetRect(&r, -r.left, -r.top);
dc = GetDCEx(hwnd, region, DCX_WINDOW|DCX_INTERSECTRGN);
OffsetRect(&r, -r.left, -r.top);
if (IsThemeBackgroundPartiallyTransparent (theme, part, state))
DrawThemeParentBackground(hwnd, dc, &r);
DrawThemeBackground (theme, dc, part, state, &r, 0);
@ -79,21 +79,21 @@ static void nc_paint (HTHEME theme, HWND hwnd, HRGN region)
/**********************************************************************
* The edit control subclass window proc.
*/
LRESULT CALLBACK THEMING_EditSubclassProc (HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam,
LRESULT CALLBACK THEMING_EditSubclassProc (HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam,
ULONG_PTR dwRefData)
{
const WCHAR* themeClass = WC_EDITW;
HTHEME theme;
LRESULT result;
switch (msg)
{
case WM_CREATE:
result = THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
OpenThemeData( hwnd, themeClass );
return result;
case WM_DESTROY:
theme = GetWindowTheme( hwnd );
CloseThemeData ( theme );
@ -104,14 +104,14 @@ LRESULT CALLBACK THEMING_EditSubclassProc (HWND hwnd, UINT msg,
CloseThemeData ( theme );
OpenThemeData( hwnd, themeClass );
break;
case WM_SYSCOLORCHANGE:
theme = GetWindowTheme( hwnd );
if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
/* Do nothing. When themed, a WM_THEMECHANGED will be received, too,
* which will do the repaint. */
break;
case WM_NCPAINT:
theme = GetWindowTheme( hwnd );
if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
@ -120,11 +120,11 @@ LRESULT CALLBACK THEMING_EditSubclassProc (HWND hwnd, UINT msg,
case WM_ENABLE:
theme = GetWindowTheme( hwnd );
if (theme) RedrawWindow (hwnd, NULL, NULL,
if (theme) RedrawWindow (hwnd, NULL, NULL,
RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW);
return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
default:
default:
/* Call old proc */
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;
int cxEdge = GetSystemMetrics (SM_CXEDGE),
cyEdge = GetSystemMetrics (SM_CYEDGE);
GetWindowRect(hwnd, &r);
/* New clipping region passed to default proc to exclude border */
cliprgn = CreateRectRgn (r.left + cxEdge, r.top + cyEdge,
r.right - cxEdge, r.bottom - cyEdge);
if (region != (HRGN)1)
CombineRgn (cliprgn, cliprgn, region, RGN_AND);
OffsetRect(&r, -r.left, -r.top);
dc = GetDCEx(hwnd, region, DCX_WINDOW|DCX_INTERSECTRGN);
OffsetRect(&r, -r.left, -r.top);
if (IsThemeBackgroundPartiallyTransparent (theme, 0, 0))
DrawThemeParentBackground(hwnd, dc, &r);
DrawThemeBackground (theme, dc, 0, 0, &r, 0);
@ -69,21 +69,21 @@ static void nc_paint (HTHEME theme, HWND hwnd, HRGN region)
/**********************************************************************
* The list control subclass window proc.
*/
LRESULT CALLBACK THEMING_ListBoxSubclassProc (HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam,
LRESULT CALLBACK THEMING_ListBoxSubclassProc (HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam,
ULONG_PTR dwRefData)
{
const WCHAR* themeClass = WC_LISTBOXW;
HTHEME theme;
LRESULT result;
switch (msg)
{
case WM_CREATE:
result = THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
OpenThemeData( hwnd, themeClass );
return result;
case WM_DESTROY:
theme = GetWindowTheme( hwnd );
CloseThemeData ( theme );
@ -94,21 +94,21 @@ LRESULT CALLBACK THEMING_ListBoxSubclassProc (HWND hwnd, UINT msg,
CloseThemeData ( theme );
OpenThemeData( hwnd, themeClass );
break;
case WM_SYSCOLORCHANGE:
theme = GetWindowTheme( hwnd );
if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
/* Do nothing. When themed, a WM_THEMECHANGED will be received, too,
* which will do the repaint. */
break;
case WM_NCPAINT:
theme = GetWindowTheme( hwnd );
if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
nc_paint (theme, hwnd, (HRGN)wParam);
break;
default:
default:
/* Call old proc */
return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
}

View file

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

View file

@ -23,11 +23,11 @@
*
* This code was audited for completeness against the documented features
* 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
* the specification mentioned above.
* If you discover missing features or bugs please note them below.
*
*
* TODO:
* - Styles:
* - TBSTYLE_REGISTERDROP
@ -279,7 +279,7 @@ TOOLBAR_DumpButton(const TOOLBAR_INFO *infoPtr, const TBUTTON_INFO *bP, INT btn_
{
if (TRACE_ON(toolbar)){
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);
TRACE("string %s\n", debugstr_w(TOOLBAR_GetText(infoPtr,bP)));
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,
(infoPtr->bUnicode) ? "via Unicode" : "via ANSI");
return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY,
return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY,
(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 ||
((tbcd->nmcd.uItemState & CDIS_HOT)
((tbcd->nmcd.uItemState & CDIS_HOT)
&& ((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 */
himl = TOOLBAR_GetImageListForDrawing(infoPtr, btnPtr, IMAGE_LIST_HOT, &index);
if (!himl)
@ -721,7 +721,7 @@ TOOLBAR_DrawImage(const TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, INT left, I
if (!himl)
return;
if (!(dwItemCDFlag & TBCDRF_NOOFFSET) &&
if (!(dwItemCDFlag & TBCDRF_NOOFFSET) &&
(tbcd->nmcd.uItemState & (CDIS_SELECTED | CDIS_CHECKED)))
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) ||
(tbcd->nmcd.uItemState & CDIS_INDETERMINATE);
BOOL pressed_look = !non_interactive_state &&
((tbcd->nmcd.uItemState & CDIS_SELECTED) ||
((tbcd->nmcd.uItemState & CDIS_SELECTED) ||
(tbcd->nmcd.uItemState & CDIS_CHECKED));
/* 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) &&
(btnPtr->fsStyle & BTNS_DROPDOWN)) ||
(btnPtr->fsStyle & BTNS_WHOLEDROPDOWN);
BOOL drawSepDropDownArrow = hasDropDownArrow &&
BOOL drawSepDropDownArrow = hasDropDownArrow &&
(~btnPtr->fsStyle & BTNS_WHOLEDROPDOWN);
RECT rc, rcArrow, rcBitmap, rcText;
LPWSTR lpText = NULL;
@ -839,8 +839,8 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc, DWORD dwBaseCustDr
if (btnPtr->fsStyle & BTNS_SEP) {
if (theme)
{
DrawThemeBackground (theme, hdc,
(dwStyle & CCS_VERT) ? TP_SEPARATORVERT : TP_SEPARATOR, 0,
DrawThemeBackground (theme, hdc,
(dwStyle & CCS_VERT) ? TP_SEPARATORVERT : TP_SEPARATOR, 0,
&rc, NULL);
}
else
@ -983,11 +983,11 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc, DWORD dwBaseCustDr
(btnPtr->fsState & (TBSTATE_PRESSED | TBSTATE_CHECKED)))
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)))
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))
{
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 stateId = TS_NORMAL;
if (tbcd.nmcd.uItemState & CDIS_DISABLED)
stateId = TS_DISABLED;
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)
|| (drawSepDropDownArrow && btnPtr->bDropDownPressed))
stateId = TS_HOT;
DrawThemeBackground (theme, hdc, partId, stateId, &tbcd.nmcd.rc, NULL);
}
else
@ -1027,7 +1027,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc, DWORD dwBaseCustDr
if (theme)
{
int stateId = TS_NORMAL;
if (tbcd.nmcd.uItemState & CDIS_DISABLED)
stateId = TS_DISABLED;
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;
else if (tbcd.nmcd.uItemState & CDIS_HOT)
stateId = TS_HOT;
DrawThemeBackground (theme, hdc, TP_DROPDOWNBUTTON, stateId, &rcArrow, NULL);
DrawThemeBackground (theme, hdc, TP_SPLITBUTTONDROPDOWN, stateId, &rcArrow, NULL);
}
@ -1704,7 +1704,7 @@ TOOLBAR_LayoutToolbar(HWND hwnd)
{
if (btnPtr->cx)
cx = btnPtr->cx;
else if ((infoPtr->dwExStyle & TBSTYLE_EX_MIXEDBUTTONS) ||
else if ((infoPtr->dwExStyle & TBSTYLE_EX_MIXEDBUTTONS) ||
(btnPtr->fsStyle & BTNS_AUTOSIZE))
{
SIZE sz;
@ -1729,7 +1729,7 @@ TOOLBAR_LayoutToolbar(HWND hwnd)
/* if size has been set manually then don't add on extra space
* for the drop down arrow */
if (!btnPtr->cx && hasDropDownArrows &&
if (!btnPtr->cx && hasDropDownArrows &&
((btnPtr->fsStyle & BTNS_DROPDOWN) || (btnPtr->fsStyle & BTNS_WHOLEDROPDOWN)))
cx += DDARROW_WIDTH;
}
@ -2353,7 +2353,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
break;
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.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
{
btnInfo = (PCUSTOMBUTTON)SendDlgItemMessageW (hwnd,
btnInfo = (PCUSTOMBUTTON)SendDlgItemMessageW (hwnd,
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))
lstrcpyW(btnInfo->text, nmtb.pszText);
else if (nmtb.tbButton.iString >= 0 &&
else if (nmtb.tbButton.iString >= 0 &&
nmtb.tbButton.iString < infoPtr->nNumStrings)
{
lstrcpyW(btnInfo->text,
lstrcpyW(btnInfo->text,
infoPtr->strings[nmtb.tbButton.iString]);
}
}
@ -2605,9 +2605,9 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* draw image and text */
if ((btnInfo->btn.fsStyle & BTNS_SEP) == 0) {
HIMAGELIST himl = GETDEFIMAGELIST(infoPtr, GETHIMLID(infoPtr,
HIMAGELIST himl = GETDEFIMAGELIST(infoPtr, GETHIMLID(infoPtr,
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);
}
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);
if (bitmap->hInst != COMCTL32_hModule)
COMCTL32_EnsureBitmapSize(&hbmLoad, cxIcon*(INT)bitmap->nButtons, cyIcon, comctl32_color.clrBtnFace);
nIndex = ImageList_AddMasked(himlDef, hbmLoad, comctl32_color.clrBtnFace);
DeleteObject(hbmLoad);
if (nIndex == -1)
return FALSE;
nCountAfter = ImageList_GetImageCount(himlDef);
nAdded = nCountAfter - nCountBefore;
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;
INT cx, cy;
INT i;
himlDef = GETDEFIMAGELIST(infoPtr, 0);
if (himlDef == NULL || himlDef != infoPtr->himlInt)
return;
@ -2800,7 +2800,7 @@ TOOLBAR_AddBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
info.nID = lpAddBmp->nID;
TRACE("adding %d bitmaps!\n", info.nButtons);
}
/* check if the bitmap is already loaded and compute iSumButtons */
iSumButtons = 0;
for (i = 0; i < infoPtr->nNumBitmapInfos; i++)
@ -3051,7 +3051,7 @@ TOOLBAR_AutoSize (HWND hwnd)
if (infoPtr->dwStyle & CCS_NOPARENTALIGN)
uPosFlags |= SWP_NOMOVE;
if (!(infoPtr->dwStyle & CCS_NODIVIDER))
cy += GetSystemMetrics(SM_CYEDGE);
@ -3934,10 +3934,10 @@ TOOLBAR_MapAccelerator (HWND hwnd, WPARAM wParam, LPARAM lParam)
UINT* pIDButton = (UINT*)lParam;
WCHAR wszAccel[] = {'&',wAccel,0};
int i;
TRACE("hwnd = %p, wAccel = %x(%s), pIDButton = %p\n",
hwnd, wAccel, debugstr_wn(&wAccel,1), pIDButton);
for (i = 0; i < infoPtr->nNumButtons; i++)
{
TBUTTON_INFO *btnPtr = infoPtr->buttons+i;
@ -3946,7 +3946,7 @@ TOOLBAR_MapAccelerator (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
int iLen = strlenW(wszAccel);
LPCWSTR lpszStr = TOOLBAR_GetText(infoPtr, btnPtr);
if (!lpszStr)
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);
return FALSE;
}
/* copy the bitmap before adding it as ImageList_AddMasked modifies the
* bitmap
*/
@ -4272,7 +4272,7 @@ TOOLBAR_Restore(TOOLBAR_INFO *infoPtr, const TBSAVEPARAMSW *lpSave)
nmtbr.tbButton.idCommand = (int)*nmtbr.pCurrent;
nmtbr.pCurrent++;
TOOLBAR_SendNotify(&nmtbr.hdr, infoPtr, TBN_RESTORE);
/* 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 (cy == 0) cx = 22;
cx = max(cx, infoPtr->szPadding.cx + infoPtr->nBitmapWidth);
cy = max(cy, infoPtr->szPadding.cy + infoPtr->nBitmapHeight);
infoPtr->nButtonWidth = cx;
infoPtr->nButtonHeight = cy;
infoPtr->iTopMargin = default_top_margin(infoPtr);
TOOLBAR_LayoutToolbar(hwnd);
return TRUE;
@ -4622,7 +4622,7 @@ TOOLBAR_SetDisabledImageList (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (infoPtr->iVersion >= 5)
id = wParam;
himlTemp = TOOLBAR_InsertImageList(&infoPtr->himlDis,
himlTemp = TOOLBAR_InsertImageList(&infoPtr->himlDis,
&infoPtr->cimlDis, himl, id);
/* 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);
himlTemp = TOOLBAR_InsertImageList(&infoPtr->himlHot,
himlTemp = TOOLBAR_InsertImageList(&infoPtr->himlHot,
&infoPtr->cimlHot, himl, id);
/* FIXME: redraw ? */
@ -4752,7 +4752,7 @@ TOOLBAR_SetHotItemEx (TOOLBAR_INFO *infoPtr, INT nHit, DWORD dwReason)
infoPtr->nHotItem = nHit;
}
else
infoPtr->nHotItem = -1;
infoPtr->nHotItem = -1;
}
}
}
@ -4767,7 +4767,7 @@ TOOLBAR_SetHotItem (HWND hwnd, WPARAM wParam)
if ((INT)wParam > infoPtr->nNumButtons)
return infoPtr->nHotItem;
if ((INT)wParam < 0)
wParam = -1;
@ -4795,7 +4795,7 @@ TOOLBAR_SetImageList (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (infoPtr->iVersion >= 5)
id = wParam;
himlTemp = TOOLBAR_InsertImageList(&infoPtr->himlDef,
himlTemp = TOOLBAR_InsertImageList(&infoPtr->himlDef,
&infoPtr->cimlDef, himl, id);
infoPtr->nNumBitmaps = 0;
@ -4857,7 +4857,7 @@ TOOLBAR_SetInsertMark (HWND hwnd, WPARAM wParam, LPARAM lParam)
return 0;
}
if ((lptbim->iButton == -1) ||
if ((lptbim->iButton == -1) ||
((lptbim->iButton < infoPtr->nNumButtons) &&
(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
* 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
* the gap between the image and text.
* 3. It is not applied to both sides. If TBSTYLE_LIST is set it is used
* the gap between the image and text.
* 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
* szPadding.cx - (GetSystemMetrics(SM_CXEDGE)+1)], otherwise the padding
* 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);
TRACE("hwnd=%p iListGap=%ld\n", hwnd, wParam);
if (lParam != 0)
FIXME("lParam = 0x%08lx. Please report\n", lParam);
infoPtr->iListGap = (INT)wParam;
InvalidateRect(hwnd, NULL, TRUE);
@ -5395,13 +5395,13 @@ TOOLBAR_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr->dwStyle = dwStyle;
infoPtr->tbim.iButton = -1;
GetClientRect(hwnd, &infoPtr->client_rect);
infoPtr->bUnicode = infoPtr->hwndNotify &&
infoPtr->bUnicode = infoPtr->hwndNotify &&
(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 */
SystemParametersInfoW (SPI_GETICONTITLELOGFONT, 0, &logFont, 0);
infoPtr->hFont = infoPtr->hDefaultFont = CreateFontIndirectW (&logFont);
OpenThemeData (hwnd, themeClass);
TOOLBAR_CheckStyle (hwnd, dwStyle);
@ -5430,8 +5430,7 @@ TOOLBAR_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (infoPtr->strings) {
INT i;
for (i = 0; i < infoPtr->nNumStrings; i++)
if (infoPtr->strings[i])
Free (infoPtr->strings[i]);
Free (infoPtr->strings[i]);
Free (infoPtr->strings);
}
@ -5446,7 +5445,7 @@ TOOLBAR_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
/* delete default font */
DeleteObject (infoPtr->hDefaultFont);
CloseThemeData (GetWindowTheme (hwnd));
/* free toolbar info data */
@ -5556,7 +5555,7 @@ TOOLBAR_SetRelativeHotItem(TOOLBAR_INFO *infoPtr, INT iDirection, DWORD dwReason
nmtbwhi.idNew = infoPtr->buttons[nNewHotItem].idCommand;
nmtbwhi.iDirection = iDirection;
nmtbwhi.dwReason = dwReason;
if (TOOLBAR_SendNotify(&nmtbwhi.hdr, infoPtr, TBN_WRAPHOTITEM))
return;
}
@ -5662,7 +5661,7 @@ TOOLBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
infoPtr->nButtonDrag = nHit;
SetCapture (hwnd);
/* If drag cursor has not been loaded, load it.
* Note: it doesn't need to be freed */
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);
/* 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_DROPDOWN) &&
((TOOLBAR_HasDropDownArrows(infoPtr->dwExStyle) && PtInRect(&arrowRect, pt)) ||
@ -5719,7 +5718,7 @@ TOOLBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
nHit = TOOLBAR_InternalHitTest(hwnd, &pt);
if (!infoPtr->bAnchor || (nHit >= 0))
TOOLBAR_SetHotItemEx(infoPtr, nHit, HICF_MOUSE | HICF_LMOUSE);
/* remove any left mouse button down or double-click messages
* so that we can get a toggle effect on the button */
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;
}
ClientToScreen(hwnd, &pt);
ClientToScreen(hwnd, &pt);
nmmouse.pt = pt;
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;
}
ClientToScreen(hwnd, &pt);
ClientToScreen(hwnd, &pt);
nmmouse.pt = pt;
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;
}
ClientToScreen(hwnd, &pt);
ClientToScreen(hwnd, &pt);
nmmouse.pt = pt;
if (!TOOLBAR_SendNotify((LPNMHDR)&nmmouse, infoPtr, NM_RCLICK))
@ -6055,10 +6054,10 @@ TOOLBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
TRACKMOUSEEVENT trackinfo;
INT nHit;
TBUTTON_INFO *btnPtr;
if ((infoPtr->dwStyle & TBSTYLE_TOOLTIPS) && (infoPtr->hwndToolTip == NULL))
TOOLBAR_TooltipCreateControl(infoPtr);
if ((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf)) {
/* fill in the TRACKMOUSEEVENT struct */
trackinfo.cbSize = sizeof(TRACKMOUSEEVENT);
@ -6087,7 +6086,7 @@ TOOLBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
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)))
TOOLBAR_SetHotItemEx(infoPtr, nHit, HICF_MOUSE);
@ -6208,7 +6207,7 @@ TOOLBAR_NCCreate (HWND hwnd, WPARAM wParam, LPARAM lParam)
* (Guy Albertelli 9/2001)
*
*/
if (((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf))
if (((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf))
&& !(cs->style & TBSTYLE_TRANSPARENT))
styleadd |= TBSTYLE_TRANSPARENT;
if (!(cs->style & (CCS_TOP | CCS_NOMOVEY))) {
@ -6333,7 +6332,7 @@ static LRESULT TOOLBAR_TTGetDispInfo (TOOLBAR_INFO *infoPtr, NMTTDISPINFOW *lpnm
return 0;
}
}
else if (len > 0)
else if (tbgit.pszText[0])
{
MultiByteToWideChar(CP_ACP, 0, tbgit.pszText, -1,
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 */
/* 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_INFO *infoPtr = TOOLBAR_GetInfoPtr(hwnd);
TRACE("font=%p redraw=%ld\n", (HFONT)wParam, lParam);
if (wParam == 0)
infoPtr->hFont = infoPtr->hDefaultFont;
else
@ -6616,7 +6615,7 @@ TOOLBAR_StyleChanged (HWND hwnd, INT nType, const STYLESTRUCT *lpStyle)
if ((dwOldStyle ^ lpStyle->styleNew) & COMMON_STYLES)
{
TOOLBAR_AutoSize (hwnd);
InvalidateRect(hwnd, NULL, TRUE);
}
}
@ -7034,7 +7033,7 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_SYSCOLORCHANGE:
return TOOLBAR_SysColorChange (hwnd);
case WM_THEMECHANGED:
return theme_changed (hwnd);
@ -7183,7 +7182,7 @@ static BOOL TOOLBAR_GetButtonInfo(const TOOLBAR_INFO *infoPtr, NMTOOLBARW *nmtb)
{
int ccht = strlen(nmtba.pszText);
if (ccht)
MultiByteToWideChar(CP_ACP, 0, (LPCSTR)nmtba.pszText, -1,
MultiByteToWideChar(CP_ACP, 0, (LPCSTR)nmtba.pszText, -1,
nmtb->pszText, nmtb->cchText);
memcpy(&nmtb->tbButton, &nmtba.tbButton, sizeof(TBBUTTON));

View file

@ -22,11 +22,11 @@
*
* This code was audited for completeness against the documented features
* 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
* the specification mentioned above.
* If you discover missing features or bugs please note them below.
*
*
* TODO:
* - Custom draw support.
* - Animation.
@ -261,7 +261,7 @@ TOOLTIPS_Refresh (HWND hwnd, HDC hdc)
BOOL icon_present;
/* draw icon */
icon_present = infoPtr->hTitleIcon &&
icon_present = infoPtr->hTitleIcon &&
DrawIconEx(hdc, rc.left, rc.top, infoPtr->hTitleIcon,
ICON_WIDTH, ICON_HEIGHT, 0, NULL, DI_NORMAL);
if (icon_present)
@ -515,7 +515,7 @@ TOOLTIPS_CalcTipSize (HWND hwnd, const TOOLTIPS_INFO *infoPtr, LPSIZE lpSize)
static void
TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr)
TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr, BOOL track_activate)
{
TTTOOL_INFO *toolPtr;
HMONITOR monitor;
@ -525,25 +525,40 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr)
NMHDR hdr;
int ptfx = 0;
DWORD style = GetWindowLongW(hwnd, GWL_STYLE);
INT nTool;
if (infoPtr->nTool == -1) {
TRACE("invalid tool (-1)!\n");
return;
if (track_activate)
{
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') {
infoPtr->nCurrentTool = -1;
return;
}
toolPtr = &infoPtr->tools[nTool];
TRACE("Show tooltip %d!\n", infoPtr->nCurrentTool);
toolPtr = &infoPtr->tools[infoPtr->nCurrentTool];
if (!track_activate)
infoPtr->nCurrentTool = infoPtr->nTool;
TRACE("Show tooltip %d!\n", nTool);
hdr.hwndFrom = hwnd;
hdr.idFrom = toolPtr->uId;
@ -556,61 +571,103 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr)
TOOLTIPS_CalcTipSize (hwnd, infoPtr, &size);
TRACE("size %d x %d\n", size.cx, size.cy);
if (toolPtr->uFlags & TTF_CENTERTIP) {
RECT rc;
if (track_activate)
{
rect.left = infoPtr->xTrackPos;
rect.top = infoPtr->yTrackPos;
ptfx = rect.left;
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)
{
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
if (toolPtr->uFlags & TTF_CENTERTIP)
{
rect.top = rc.bottom + 2;
infoPtr->bToolBelow = TRUE;
rect.left -= (size.cx / 2);
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 {
GetCursorPos ((LPPOINT)&rect);
if (style & TTS_BALLOON)
{
ptfx = rect.left;
if(rect.top - size.cy >= 0)
else
{
if (toolPtr->uFlags & TTF_CENTERTIP)
{
RECT rc;
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;
infoPtr->bToolBelow = FALSE;
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
{
infoPtr->bToolBelow = TRUE;
rect.top += 20;
rect.top = rc.bottom + 2;
infoPtr->bToolBelow = TRUE;
}
rect.left = max(0, rect.left - BALLOON_STEMINDENT);
}
else
{
rect.top += 20;
infoPtr->bToolBelow = TRUE;
GetCursorPos ((LPPOINT)&rect);
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);
hRgn = CreateRoundRectRgn(0,
(infoPtr->bToolBelow ? BALLOON_STEMHEIGHT : 0),
rect.right - rect.left,
@ -696,7 +753,7 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr)
DeleteObject(hrStem);
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 */
}
@ -708,10 +765,13 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr)
InvalidateRect(hwnd, NULL, TRUE);
UpdateWindow(hwnd);
SetTimer (hwnd, ID_TIMERPOP, infoPtr->nAutoPopTime, 0);
TRACE("timer 2 started!\n");
SetTimer (hwnd, ID_TIMERLEAVE, infoPtr->nReshowTime, 0);
TRACE("timer 3 started!\n");
if (!track_activate)
{
SetTimer (hwnd, ID_TIMERPOP, infoPtr->nAutoPopTime, 0);
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
TOOLTIPS_TrackShow (HWND hwnd, TOOLTIPS_INFO *infoPtr)
{
TTTOOL_INFO *toolPtr;
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);
TOOLTIPS_Show(hwnd, infoPtr, TRUE);
}
@ -2133,7 +2102,7 @@ TOOLTIPS_SetToolInfoW (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (infoPtr->szTipText[0] == 0)
TOOLTIPS_Hide(hwnd, infoPtr);
else
TOOLTIPS_Show (hwnd, infoPtr);
TOOLTIPS_Show (hwnd, infoPtr, FALSE);
}
return 0;
@ -2255,7 +2224,7 @@ TOOLTIPS_UpdateTipTextA (HWND hwnd, WPARAM wParam, LPARAM lParam)
if(infoPtr->nCurrentTool == -1) return 0;
/* force repaint */
if (infoPtr->bActive)
TOOLTIPS_Show (hwnd, infoPtr);
TOOLTIPS_Show (hwnd, infoPtr, FALSE);
else if (infoPtr->bTrackActive)
TOOLTIPS_TrackShow (hwnd, infoPtr);
@ -2311,9 +2280,9 @@ TOOLTIPS_UpdateTipTextW (HWND hwnd, WPARAM wParam, LPARAM lParam)
if(infoPtr->nCurrentTool == -1) return 0;
/* force repaint */
if (infoPtr->bActive)
TOOLTIPS_Show (hwnd, infoPtr);
TOOLTIPS_Show (hwnd, infoPtr, FALSE);
else if (infoPtr->bTrackActive)
TOOLTIPS_TrackShow (hwnd, infoPtr);
TOOLTIPS_Show (hwnd, infoPtr, TRUE);
return 0;
}
@ -2597,7 +2566,7 @@ TOOLTIPS_Timer (HWND hwnd, WPARAM wParam, LPARAM lParam)
KillTimer (hwnd, ID_TIMERSHOW);
nOldTool = infoPtr->nTool;
if ((infoPtr->nTool = TOOLTIPS_CheckTool (hwnd, TRUE)) == nOldTool)
TOOLTIPS_Show (hwnd, infoPtr);
TOOLTIPS_Show (hwnd, infoPtr, FALSE);
break;
case ID_TIMERPOP:

View file

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

View file

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

View file

@ -18,14 +18,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* NOTE
*
*
* This code was audited for completeness against the documented features
* 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
* the specification mentioned above.
* If you discover missing features, or bugs, please note them below.
*
*
*/
#include <stdlib.h>
@ -100,7 +100,7 @@ typedef struct
#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_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 };
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];
int len;
if (!((infoPtr->dwStyle & UDS_SETBUDDYINT) && IsWindow(infoPtr->Buddy)))
if (!((infoPtr->dwStyle & UDS_SETBUDDYINT) && IsWindow(infoPtr->Buddy)))
return FALSE;
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);
if (theme) {
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));
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));
needBuddyBg = IsWindow (infoPtr->Buddy)
&& (IsThemeBackgroundPartiallyTransparent (theme, uPart, uState)
@ -765,7 +765,7 @@ static void UPDOWN_HandleMouseEvent (UPDOWN_INFO *infoPtr, UINT msg, INT x, INT
if(temp != infoPtr->Flags)
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 */
tme.cbSize = sizeof( tme );
tme.dwFlags = TME_LEAVE;