mirror of
https://github.com/reactos/reactos.git
synced 2025-05-20 17:45:06 +00:00
Merge second part of the comctl32 Wine 1.2 sync.
All code currently omits the reactos specific patches. It's been a long time since we synched this lib so it's possible we no longer need them. Time will tell. svn path=/trunk/; revision=47705
This commit is contained in:
parent
4829efbb66
commit
b589f99b78
13 changed files with 1148 additions and 1656 deletions
|
@ -841,7 +841,6 @@ static LRESULT
|
|||
PAGER_NCCalcSize(PAGER_INFO* infoPtr, WPARAM wParam, LPRECT lpRect)
|
||||
{
|
||||
RECT rcChild, rcWindow;
|
||||
INT scrollRange;
|
||||
|
||||
/*
|
||||
* lpRect points to a RECT struct. On entry, the struct
|
||||
|
@ -863,8 +862,6 @@ PAGER_NCCalcSize(PAGER_INFO* infoPtr, WPARAM wParam, LPRECT lpRect)
|
|||
infoPtr->nWidth = lpRect->right - lpRect->left;
|
||||
PAGER_CalcSize (infoPtr, &infoPtr->nWidth, TRUE);
|
||||
|
||||
scrollRange = infoPtr->nWidth - (rcWindow.right - rcWindow.left);
|
||||
|
||||
if (infoPtr->TLbtnState && (lpRect->left + infoPtr->nButtonSize < lpRect->right))
|
||||
lpRect->left += infoPtr->nButtonSize;
|
||||
if (infoPtr->BRbtnState && (lpRect->right - infoPtr->nButtonSize > lpRect->left))
|
||||
|
@ -875,8 +872,6 @@ PAGER_NCCalcSize(PAGER_INFO* infoPtr, WPARAM wParam, LPRECT lpRect)
|
|||
infoPtr->nHeight = lpRect->bottom - lpRect->top;
|
||||
PAGER_CalcSize (infoPtr, &infoPtr->nHeight, FALSE);
|
||||
|
||||
scrollRange = infoPtr->nHeight - (rcWindow.bottom - rcWindow.top);
|
||||
|
||||
if (infoPtr->TLbtnState && (lpRect->top + infoPtr->nButtonSize < lpRect->bottom))
|
||||
lpRect->top += infoPtr->nButtonSize;
|
||||
if (infoPtr->BRbtnState && (lpRect->bottom - infoPtr->nButtonSize > lpRect->top))
|
||||
|
|
|
@ -330,7 +330,7 @@ static void PROPSHEET_CollectSheetInfoA(LPCPROPSHEETHEADERA lppsh,
|
|||
psInfo->ppshheader.pszCaption = NULL;
|
||||
else
|
||||
{
|
||||
if (HIWORD(lppsh->pszCaption))
|
||||
if (!IS_INTRESOURCE(lppsh->pszCaption))
|
||||
{
|
||||
int len = MultiByteToWideChar(CP_ACP, 0, lppsh->pszCaption, -1, NULL, 0);
|
||||
WCHAR *caption = Alloc( len*sizeof (WCHAR) );
|
||||
|
@ -373,7 +373,7 @@ static void PROPSHEET_CollectSheetInfoW(LPCPROPSHEETHEADERW lppsh,
|
|||
psInfo->ppshheader.pszCaption = NULL;
|
||||
else
|
||||
{
|
||||
if (HIWORD(lppsh->pszCaption))
|
||||
if (!IS_INTRESOURCE(lppsh->pszCaption))
|
||||
{
|
||||
int len = strlenW(lppsh->pszCaption);
|
||||
WCHAR *caption = Alloc( (len+1)*sizeof(WCHAR) );
|
||||
|
@ -553,7 +553,7 @@ static BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEW lppsp,
|
|||
WCHAR *text;
|
||||
int len;
|
||||
|
||||
if ( !HIWORD( lppsp->pszTitle ) )
|
||||
if (IS_INTRESOURCE( lppsp->pszTitle ))
|
||||
{
|
||||
if (!LoadStringW( lppsp->hInstance, (DWORD_PTR)lppsp->pszTitle,szTitle,sizeof(szTitle)/sizeof(szTitle[0]) ))
|
||||
{
|
||||
|
@ -1197,7 +1197,7 @@ static BOOL PROPSHEET_CreateTabControl(HWND hwndParent,
|
|||
}
|
||||
|
||||
item.pszText = (LPWSTR) psInfo->proppage[i].pszText;
|
||||
SendMessageW(hwndTabCtrl, TCM_INSERTITEMW, (WPARAM)i, (LPARAM)&item);
|
||||
SendMessageW(hwndTabCtrl, TCM_INSERTITEMW, i, (LPARAM)&item);
|
||||
}
|
||||
SendMessageW(GetDlgItem(hwndTabCtrl, IDC_TABCONTROL), WM_SETREDRAW, 1, 0);
|
||||
|
||||
|
@ -1370,10 +1370,10 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
|
|||
const PropSheetInfo * psInfo,
|
||||
LPCPROPSHEETPAGEW ppshpage)
|
||||
{
|
||||
DLGTEMPLATE* pTemplate;
|
||||
const DLGTEMPLATE* pTemplate;
|
||||
HWND hwndPage;
|
||||
DWORD resSize;
|
||||
LPVOID temp = NULL;
|
||||
DLGTEMPLATE* pTemplateCopy = NULL;
|
||||
|
||||
TRACE("index %d\n", index);
|
||||
|
||||
|
@ -1384,7 +1384,7 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
|
|||
|
||||
if (ppshpage->dwFlags & PSP_DLGINDIRECT)
|
||||
{
|
||||
pTemplate = (DLGTEMPLATE*)ppshpage->u.pResource;
|
||||
pTemplate = ppshpage->u.pResource;
|
||||
resSize = GetTemplateSize(pTemplate);
|
||||
}
|
||||
else if(ppshpage->dwFlags & PSP_INTERNAL_UNICODE)
|
||||
|
@ -1431,39 +1431,38 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
|
|||
* Make a copy of the dialog template to make it writable
|
||||
*/
|
||||
}
|
||||
temp = Alloc(resSize);
|
||||
if (!temp)
|
||||
pTemplateCopy = Alloc(resSize);
|
||||
if (!pTemplateCopy)
|
||||
return FALSE;
|
||||
|
||||
TRACE("copying pTemplate %p into temp %p (%d)\n", pTemplate, temp, resSize);
|
||||
memcpy(temp, pTemplate, resSize);
|
||||
pTemplate = temp;
|
||||
TRACE("copying pTemplate %p into pTemplateCopy %p (%d)\n", pTemplate, pTemplateCopy, resSize);
|
||||
memcpy(pTemplateCopy, pTemplate, resSize);
|
||||
|
||||
if (((MyDLGTEMPLATEEX*)pTemplate)->signature == 0xFFFF)
|
||||
if (((MyDLGTEMPLATEEX*)pTemplateCopy)->signature == 0xFFFF)
|
||||
{
|
||||
((MyDLGTEMPLATEEX*)pTemplate)->style |= WS_CHILD | WS_TABSTOP | DS_CONTROL;
|
||||
((MyDLGTEMPLATEEX*)pTemplate)->style &= ~DS_MODALFRAME;
|
||||
((MyDLGTEMPLATEEX*)pTemplate)->style &= ~WS_CAPTION;
|
||||
((MyDLGTEMPLATEEX*)pTemplate)->style &= ~WS_SYSMENU;
|
||||
((MyDLGTEMPLATEEX*)pTemplate)->style &= ~WS_POPUP;
|
||||
((MyDLGTEMPLATEEX*)pTemplate)->style &= ~WS_DISABLED;
|
||||
((MyDLGTEMPLATEEX*)pTemplate)->style &= ~WS_VISIBLE;
|
||||
((MyDLGTEMPLATEEX*)pTemplate)->style &= ~WS_THICKFRAME;
|
||||
((MyDLGTEMPLATEEX*)pTemplateCopy)->style |= WS_CHILD | WS_TABSTOP | DS_CONTROL;
|
||||
((MyDLGTEMPLATEEX*)pTemplateCopy)->style &= ~DS_MODALFRAME;
|
||||
((MyDLGTEMPLATEEX*)pTemplateCopy)->style &= ~WS_CAPTION;
|
||||
((MyDLGTEMPLATEEX*)pTemplateCopy)->style &= ~WS_SYSMENU;
|
||||
((MyDLGTEMPLATEEX*)pTemplateCopy)->style &= ~WS_POPUP;
|
||||
((MyDLGTEMPLATEEX*)pTemplateCopy)->style &= ~WS_DISABLED;
|
||||
((MyDLGTEMPLATEEX*)pTemplateCopy)->style &= ~WS_VISIBLE;
|
||||
((MyDLGTEMPLATEEX*)pTemplateCopy)->style &= ~WS_THICKFRAME;
|
||||
|
||||
((MyDLGTEMPLATEEX*)pTemplate)->exStyle |= WS_EX_CONTROLPARENT;
|
||||
((MyDLGTEMPLATEEX*)pTemplateCopy)->exStyle |= WS_EX_CONTROLPARENT;
|
||||
}
|
||||
else
|
||||
{
|
||||
pTemplate->style |= WS_CHILD | WS_TABSTOP | DS_CONTROL;
|
||||
pTemplate->style &= ~DS_MODALFRAME;
|
||||
pTemplate->style &= ~WS_CAPTION;
|
||||
pTemplate->style &= ~WS_SYSMENU;
|
||||
pTemplate->style &= ~WS_POPUP;
|
||||
pTemplate->style &= ~WS_DISABLED;
|
||||
pTemplate->style &= ~WS_VISIBLE;
|
||||
pTemplate->style &= ~WS_THICKFRAME;
|
||||
pTemplateCopy->style |= WS_CHILD | WS_TABSTOP | DS_CONTROL;
|
||||
pTemplateCopy->style &= ~DS_MODALFRAME;
|
||||
pTemplateCopy->style &= ~WS_CAPTION;
|
||||
pTemplateCopy->style &= ~WS_SYSMENU;
|
||||
pTemplateCopy->style &= ~WS_POPUP;
|
||||
pTemplateCopy->style &= ~WS_DISABLED;
|
||||
pTemplateCopy->style &= ~WS_VISIBLE;
|
||||
pTemplateCopy->style &= ~WS_THICKFRAME;
|
||||
|
||||
pTemplate->dwExtendedStyle |= WS_EX_CONTROLPARENT;
|
||||
pTemplateCopy->dwExtendedStyle |= WS_EX_CONTROLPARENT;
|
||||
}
|
||||
|
||||
if (psInfo->proppage[index].useCallback)
|
||||
|
@ -1472,18 +1471,18 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
|
|||
|
||||
if(ppshpage->dwFlags & PSP_INTERNAL_UNICODE)
|
||||
hwndPage = CreateDialogIndirectParamW(ppshpage->hInstance,
|
||||
pTemplate,
|
||||
pTemplateCopy,
|
||||
hwndParent,
|
||||
ppshpage->pfnDlgProc,
|
||||
(LPARAM)ppshpage);
|
||||
else
|
||||
hwndPage = CreateDialogIndirectParamA(ppshpage->hInstance,
|
||||
pTemplate,
|
||||
pTemplateCopy,
|
||||
hwndParent,
|
||||
ppshpage->pfnDlgProc,
|
||||
(LPARAM)ppshpage);
|
||||
/* Free a no more needed copy */
|
||||
Free(temp);
|
||||
Free(pTemplateCopy);
|
||||
|
||||
psInfo->proppage[index].hwndPage = hwndPage;
|
||||
|
||||
|
@ -2131,7 +2130,7 @@ static void PROPSHEET_SetCurSelId(HWND hwndDlg, int id)
|
|||
*/
|
||||
static void PROPSHEET_SetTitleA(HWND hwndDlg, DWORD dwStyle, LPCSTR lpszText)
|
||||
{
|
||||
if(HIWORD(lpszText))
|
||||
if(!IS_INTRESOURCE(lpszText))
|
||||
{
|
||||
WCHAR szTitle[256];
|
||||
MultiByteToWideChar(CP_ACP, 0, lpszText, -1,
|
||||
|
@ -2153,7 +2152,7 @@ static void PROPSHEET_SetTitleW(HWND hwndDlg, DWORD dwStyle, LPCWSTR lpszText)
|
|||
WCHAR szTitle[256];
|
||||
|
||||
TRACE("%s (style %08x)\n", debugstr_w(lpszText), dwStyle);
|
||||
if (HIWORD(lpszText) == 0) {
|
||||
if (IS_INTRESOURCE(lpszText)) {
|
||||
if (!LoadStringW(psInfo->ppshheader.hInstance,
|
||||
LOWORD(lpszText), szTitle, sizeof(szTitle)/sizeof(szTitle[0])))
|
||||
return;
|
||||
|
@ -2422,28 +2421,6 @@ static BOOL PROPSHEET_RemovePage(HWND hwndDlg,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL CALLBACK
|
||||
EnumChildProc(HWND hwnd, LPARAM lParam)
|
||||
{
|
||||
WCHAR szType[20];
|
||||
RealGetWindowClassW(hwnd, szType, 20);
|
||||
|
||||
if (strcmpW(szType, WC_EDITW) == 0)
|
||||
{
|
||||
if (IsWindowEnabled(hwnd) && IsWindowVisible(hwnd))
|
||||
{
|
||||
SetFocus(hwnd);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
EnumChildWindows(hwnd, EnumChildProc, 0);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* PROPSHEET_SetWizButtons
|
||||
*
|
||||
|
@ -2465,6 +2442,17 @@ static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags)
|
|||
EnableWindow(hwndNext, FALSE);
|
||||
EnableWindow(hwndFinish, FALSE);
|
||||
|
||||
/* set the default pushbutton to an enabled button */
|
||||
if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH))
|
||||
SendMessageW(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0);
|
||||
else if (dwFlags & PSWIZB_NEXT)
|
||||
SendMessageW(hwndDlg, DM_SETDEFID, IDC_NEXT_BUTTON, 0);
|
||||
else if (dwFlags & PSWIZB_BACK)
|
||||
SendMessageW(hwndDlg, DM_SETDEFID, IDC_BACK_BUTTON, 0);
|
||||
else
|
||||
SendMessageW(hwndDlg, DM_SETDEFID, IDCANCEL, 0);
|
||||
|
||||
|
||||
if (dwFlags & PSWIZB_BACK)
|
||||
EnableWindow(hwndBack, TRUE);
|
||||
|
||||
|
@ -2494,31 +2482,6 @@ static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags)
|
|||
}
|
||||
else if (!(dwFlags & PSWIZB_DISABLEDFINISH))
|
||||
EnableWindow(hwndFinish, TRUE);
|
||||
|
||||
/* set the default pushbutton to an enabled button and give it focus */
|
||||
if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH))
|
||||
{
|
||||
SendMessageW(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0);
|
||||
SetFocus(hwndFinish);
|
||||
}
|
||||
else if (dwFlags & PSWIZB_NEXT)
|
||||
{
|
||||
SendMessageW(hwndDlg, DM_SETDEFID, IDC_NEXT_BUTTON, 0);
|
||||
SetFocus(hwndNext);
|
||||
}
|
||||
else if (dwFlags & PSWIZB_BACK)
|
||||
{
|
||||
SendMessageW(hwndDlg, DM_SETDEFID, IDC_BACK_BUTTON, 0);
|
||||
SetFocus(hwndBack);
|
||||
}
|
||||
else
|
||||
{
|
||||
SendMessageW(hwndDlg, DM_SETDEFID, IDCANCEL, 0);
|
||||
SetFocus(GetDlgItem(hwndDlg, IDCANCEL));
|
||||
}
|
||||
|
||||
/* Now try to find an edit control that deserves focus */
|
||||
EnumChildWindows(PropSheet_GetCurrentPageHwnd(hwndDlg), EnumChildProc, 0);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -2526,7 +2489,7 @@ static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags)
|
|||
*/
|
||||
static BOOL PROPSHEET_InsertPage(HWND hwndDlg, HPROPSHEETPAGE hpageInsertAfter, HPROPSHEETPAGE hpage)
|
||||
{
|
||||
if (!HIWORD(hpageInsertAfter))
|
||||
if (IS_INTRESOURCE(hpageInsertAfter))
|
||||
FIXME("(%p, %d, %p): stub\n", hwndDlg, LOWORD(hpageInsertAfter), hpage);
|
||||
else
|
||||
FIXME("(%p, %p, %p): stub\n", hwndDlg, hpageInsertAfter, hpage);
|
||||
|
@ -2589,6 +2552,8 @@ static LRESULT PROPSHEET_IndexToHwnd(HWND hwndDlg, int iPageIndex)
|
|||
{
|
||||
PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
|
||||
TRACE("(%p, %d)\n", hwndDlg, iPageIndex);
|
||||
if (!psInfo)
|
||||
return 0;
|
||||
if (iPageIndex<0 || iPageIndex>=psInfo->nPages) {
|
||||
WARN("%d out of range.\n", iPageIndex);
|
||||
return 0;
|
||||
|
@ -2658,7 +2623,7 @@ static LRESULT PROPSHEET_IndexToId(HWND hwndDlg, int iPageIndex)
|
|||
return 0;
|
||||
}
|
||||
psp = (LPCPROPSHEETPAGEW)psInfo->proppage[iPageIndex].hpage;
|
||||
if (psp->dwFlags & PSP_DLGINDIRECT || HIWORD(psp->u.pszTemplate)) {
|
||||
if (psp->dwFlags & PSP_DLGINDIRECT || !IS_INTRESOURCE(psp->u.pszTemplate)) {
|
||||
return 0;
|
||||
}
|
||||
return (LRESULT)psp->u.pszTemplate;
|
||||
|
@ -2718,7 +2683,7 @@ static void PROPSHEET_CleanUp(HWND hwndDlg)
|
|||
|
||||
TRACE("\n");
|
||||
if (!psInfo) return;
|
||||
if (HIWORD(psInfo->ppshheader.pszCaption))
|
||||
if (!IS_INTRESOURCE(psInfo->ppshheader.pszCaption))
|
||||
Free ((LPVOID)psInfo->ppshheader.pszCaption);
|
||||
|
||||
for (i = 0; i < psInfo->nPages; i++)
|
||||
|
@ -2974,7 +2939,7 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(
|
|||
|
||||
if ( !(ppsp->dwFlags & PSP_DLGINDIRECT) )
|
||||
{
|
||||
if (HIWORD( ppsp->u.pszTemplate ))
|
||||
if (!IS_INTRESOURCE( ppsp->u.pszTemplate ))
|
||||
{
|
||||
int len = strlen(lpPropSheetPage->u.pszTemplate) + 1;
|
||||
char *template = Alloc( len );
|
||||
|
@ -2985,13 +2950,13 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(
|
|||
|
||||
if (ppsp->dwFlags & PSP_USEICONID)
|
||||
{
|
||||
if (HIWORD( ppsp->u2.pszIcon ))
|
||||
if (!IS_INTRESOURCE( ppsp->u2.pszIcon ))
|
||||
PROPSHEET_AtoW(&ppsp->u2.pszIcon, lpPropSheetPage->u2.pszIcon);
|
||||
}
|
||||
|
||||
if (ppsp->dwFlags & PSP_USETITLE)
|
||||
{
|
||||
if (HIWORD( ppsp->pszTitle ))
|
||||
if (!IS_INTRESOURCE( ppsp->pszTitle ))
|
||||
PROPSHEET_AtoW( &ppsp->pszTitle, lpPropSheetPage->pszTitle );
|
||||
else
|
||||
ppsp->pszTitle = load_string( ppsp->hInstance, ppsp->pszTitle );
|
||||
|
@ -3004,7 +2969,7 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(
|
|||
|
||||
if (ppsp->dwFlags & PSP_USEHEADERTITLE)
|
||||
{
|
||||
if (HIWORD( ppsp->pszHeaderTitle ))
|
||||
if (!IS_INTRESOURCE( ppsp->pszHeaderTitle ))
|
||||
PROPSHEET_AtoW(&ppsp->pszHeaderTitle, lpPropSheetPage->pszHeaderTitle);
|
||||
else
|
||||
ppsp->pszHeaderTitle = load_string( ppsp->hInstance, ppsp->pszHeaderTitle );
|
||||
|
@ -3014,7 +2979,7 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(
|
|||
|
||||
if (ppsp->dwFlags & PSP_USEHEADERSUBTITLE)
|
||||
{
|
||||
if (HIWORD( ppsp->pszHeaderSubTitle ))
|
||||
if (!IS_INTRESOURCE( ppsp->pszHeaderSubTitle ))
|
||||
PROPSHEET_AtoW(&ppsp->pszHeaderSubTitle, lpPropSheetPage->pszHeaderSubTitle);
|
||||
else
|
||||
ppsp->pszHeaderSubTitle = load_string( ppsp->hInstance, ppsp->pszHeaderSubTitle );
|
||||
|
@ -3040,7 +3005,7 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage
|
|||
|
||||
if ( !(ppsp->dwFlags & PSP_DLGINDIRECT) )
|
||||
{
|
||||
if (HIWORD( ppsp->u.pszTemplate ))
|
||||
if (!IS_INTRESOURCE( ppsp->u.pszTemplate ))
|
||||
{
|
||||
int len = strlenW(lpPropSheetPage->u.pszTemplate) + 1;
|
||||
WCHAR *template = Alloc( len * sizeof (WCHAR) );
|
||||
|
@ -3051,7 +3016,7 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage
|
|||
|
||||
if ( ppsp->dwFlags & PSP_USEICONID )
|
||||
{
|
||||
if (HIWORD( ppsp->u2.pszIcon ))
|
||||
if (!IS_INTRESOURCE( ppsp->u2.pszIcon ))
|
||||
{
|
||||
int len = strlenW(lpPropSheetPage->u2.pszIcon) + 1;
|
||||
WCHAR *icon = Alloc( len * sizeof (WCHAR) );
|
||||
|
@ -3099,13 +3064,13 @@ BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage)
|
|||
if (!psp)
|
||||
return FALSE;
|
||||
|
||||
if ( !(psp->dwFlags & PSP_DLGINDIRECT) && HIWORD( psp->u.pszTemplate ) )
|
||||
if (!(psp->dwFlags & PSP_DLGINDIRECT) && !IS_INTRESOURCE( psp->u.pszTemplate ))
|
||||
Free ((LPVOID)psp->u.pszTemplate);
|
||||
|
||||
if ( (psp->dwFlags & PSP_USEICONID) && HIWORD( psp->u2.pszIcon ) )
|
||||
if ((psp->dwFlags & PSP_USEICONID) && !IS_INTRESOURCE( psp->u2.pszIcon ))
|
||||
Free ((LPVOID)psp->u2.pszIcon);
|
||||
|
||||
if ((psp->dwFlags & PSP_USETITLE) && HIWORD( psp->pszTitle ))
|
||||
if ((psp->dwFlags & PSP_USETITLE) && !IS_INTRESOURCE( psp->pszTitle ))
|
||||
Free ((LPVOID)psp->pszTitle);
|
||||
|
||||
Free(hPropPage);
|
||||
|
@ -3326,7 +3291,7 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
|
|||
|
||||
if (ppshpage->dwFlags & PSP_USEHEADERTITLE) {
|
||||
SetRect(&r, 20, 10, 0, 0);
|
||||
if (HIWORD(ppshpage->pszHeaderTitle))
|
||||
if (!IS_INTRESOURCE(ppshpage->pszHeaderTitle))
|
||||
DrawTextW(hdc, ppshpage->pszHeaderTitle, -1, &r, DT_LEFT | DT_SINGLELINE | DT_NOCLIP);
|
||||
else
|
||||
{
|
||||
|
@ -3342,7 +3307,7 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
|
|||
if (ppshpage->dwFlags & PSP_USEHEADERSUBTITLE) {
|
||||
SelectObject(hdc, psInfo->hFont);
|
||||
SetRect(&r, 40, 25, rzone.right - 69, rzone.bottom);
|
||||
if (HIWORD(ppshpage->pszHeaderTitle))
|
||||
if (!IS_INTRESOURCE(ppshpage->pszHeaderTitle))
|
||||
DrawTextW(hdc, ppshpage->pszHeaderSubTitle, -1, &r, DT_LEFT | DT_WORDBREAK);
|
||||
else
|
||||
{
|
||||
|
@ -3504,7 +3469,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
}
|
||||
|
||||
if (!HIWORD(psInfo->ppshheader.pszCaption) &&
|
||||
if (IS_INTRESOURCE(psInfo->ppshheader.pszCaption) &&
|
||||
psInfo->ppshheader.hInstance)
|
||||
{
|
||||
WCHAR szText[256];
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -233,7 +233,7 @@ STATUSBAR_DrawPart (const STATUS_INFO *infoPtr, HDC hdc, const STATUSWINDOWPART
|
|||
dis.hDC = hdc;
|
||||
dis.rcItem = r;
|
||||
dis.itemData = (ULONG_PTR)part->text;
|
||||
SendMessageW (infoPtr->Notify, WM_DRAWITEM, (WPARAM)dis.CtlID, (LPARAM)&dis);
|
||||
SendMessageW (infoPtr->Notify, WM_DRAWITEM, dis.CtlID, (LPARAM)&dis);
|
||||
} else {
|
||||
if (part->hIcon) {
|
||||
INT cy = r.bottom - r.top;
|
||||
|
@ -728,7 +728,7 @@ STATUSBAR_SetParts (STATUS_INFO *infoPtr, INT count, LPINT parts)
|
|||
|
||||
static BOOL
|
||||
STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style,
|
||||
LPCWSTR text, BOOL isW)
|
||||
LPWSTR text, BOOL isW)
|
||||
{
|
||||
STATUSWINDOWPART *part=NULL;
|
||||
BOOL changed = FALSE;
|
||||
|
@ -759,7 +759,7 @@ STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style,
|
|||
if (style & SBT_OWNERDRAW) {
|
||||
if (!(oldStyle & SBT_OWNERDRAW))
|
||||
Free (part->text);
|
||||
part->text = (LPWSTR)text;
|
||||
part->text = text;
|
||||
} else {
|
||||
LPWSTR ntext;
|
||||
WCHAR *idx;
|
||||
|
@ -1162,7 +1162,7 @@ STATUSBAR_NotifyFormat (STATUS_INFO *infoPtr, HWND from, INT cmd)
|
|||
|
||||
|
||||
static LRESULT
|
||||
STATUSBAR_SendMouseNotify(const STATUS_INFO *infoPtr, UINT code, LPARAM lParam)
|
||||
STATUSBAR_SendMouseNotify(const STATUS_INFO *infoPtr, UINT code, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
NMMOUSE nm;
|
||||
|
||||
|
@ -1175,7 +1175,12 @@ STATUSBAR_SendMouseNotify(const STATUS_INFO *infoPtr, UINT code, LPARAM lParam)
|
|||
nm.dwItemSpec = STATUSBAR_InternalHitTest(infoPtr, &nm.pt);
|
||||
nm.dwItemData = 0;
|
||||
nm.dwHitInfo = 0x30000; /* seems constant */
|
||||
SendMessageW(infoPtr->Notify, WM_NOTIFY, 0, (LPARAM)&nm);
|
||||
|
||||
/* Do default processing if WM_NOTIFY returns zero */
|
||||
if(!SendMessageW(infoPtr->Notify, WM_NOTIFY, nm.hdr.idFrom, (LPARAM)&nm))
|
||||
{
|
||||
return DefWindowProcW(infoPtr->Self, msg, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1243,10 +1248,10 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
return STATUSBAR_SetParts (infoPtr, (INT)wParam, (LPINT)lParam);
|
||||
|
||||
case SB_SETTEXTA:
|
||||
return STATUSBAR_SetTextT (infoPtr, nPart, wParam & 0xff00, (LPCWSTR)lParam, FALSE);
|
||||
return STATUSBAR_SetTextT (infoPtr, nPart, wParam & 0xff00, (LPWSTR)lParam, FALSE);
|
||||
|
||||
case SB_SETTEXTW:
|
||||
return STATUSBAR_SetTextT (infoPtr, nPart, wParam & 0xff00, (LPCWSTR)lParam, TRUE);
|
||||
return STATUSBAR_SetTextT (infoPtr, nPart, wParam & 0xff00, (LPWSTR)lParam, TRUE);
|
||||
|
||||
case SB_SETTIPTEXTA:
|
||||
return STATUSBAR_SetTipTextA (infoPtr, (INT)wParam, (LPSTR)lParam);
|
||||
|
@ -1276,10 +1281,10 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
return STATUSBAR_GetTextLength (infoPtr, 0);
|
||||
|
||||
case WM_LBUTTONDBLCLK:
|
||||
return STATUSBAR_SendMouseNotify(infoPtr, NM_DBLCLK, lParam);
|
||||
return STATUSBAR_SendMouseNotify(infoPtr, NM_DBLCLK, msg, wParam, lParam);
|
||||
|
||||
case WM_LBUTTONUP:
|
||||
return STATUSBAR_SendMouseNotify(infoPtr, NM_CLICK, lParam);
|
||||
return STATUSBAR_SendMouseNotify(infoPtr, NM_CLICK, msg, wParam, lParam);
|
||||
|
||||
case WM_MOUSEMOVE:
|
||||
return STATUSBAR_Relay2Tip (infoPtr, msg, wParam, lParam);
|
||||
|
@ -1303,10 +1308,10 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
return STATUSBAR_WMPaint (infoPtr, (HDC)wParam);
|
||||
|
||||
case WM_RBUTTONDBLCLK:
|
||||
return STATUSBAR_SendMouseNotify(infoPtr, NM_RDBLCLK, lParam);
|
||||
return STATUSBAR_SendMouseNotify(infoPtr, NM_RDBLCLK, msg, wParam, lParam);
|
||||
|
||||
case WM_RBUTTONUP:
|
||||
return STATUSBAR_SendMouseNotify(infoPtr, NM_RCLICK, lParam);
|
||||
return STATUSBAR_SendMouseNotify(infoPtr, NM_RCLICK, msg, wParam, lParam);
|
||||
|
||||
case WM_SETFONT:
|
||||
return STATUSBAR_WMSetFont (infoPtr, (HFONT)wParam, LOWORD(lParam));
|
||||
|
|
|
@ -235,7 +235,7 @@ INT WINAPI Str_GetPtrW (LPCWSTR lpSrc, LPWSTR lpDest, INT nMaxLen)
|
|||
*/
|
||||
BOOL WINAPI Str_SetPtrW (LPWSTR *lppDest, LPCWSTR lpSrc)
|
||||
{
|
||||
TRACE("(%p %p)\n", lppDest, lpSrc);
|
||||
TRACE("(%p %s)\n", lppDest, debugstr_w(lpSrc));
|
||||
|
||||
if (lpSrc) {
|
||||
INT len = strlenW (lpSrc) + 1;
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#include "wine/unicode.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(progress);
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(syslink);
|
||||
|
||||
INT WINAPI StrCmpNIW(LPCWSTR,LPCWSTR,INT);
|
||||
|
||||
|
@ -94,7 +94,9 @@ typedef struct
|
|||
COLORREF TextColor; /* Color of the text */
|
||||
COLORREF LinkColor; /* Color of links */
|
||||
COLORREF VisitedColor; /* Color of visited links */
|
||||
COLORREF BackColor; /* Background color, set on creation */
|
||||
WCHAR BreakChar; /* Break Character for the current font */
|
||||
BOOL IgnoreReturn; /* (infoPtr->Style & LWS_IGNORERETURN) on creation */
|
||||
} SYSLINK_INFO;
|
||||
|
||||
static const WCHAR SL_LINKOPEN[] = { '<','a', 0 };
|
||||
|
@ -196,6 +198,8 @@ static UINT SYSLINK_ParseText (SYSLINK_INFO *infoPtr, LPCWSTR Text)
|
|||
LPCWSTR lpID, lpUrl;
|
||||
UINT lenId, lenUrl;
|
||||
|
||||
TRACE("(%p %s)\n", infoPtr, debugstr_w(Text));
|
||||
|
||||
for(current = Text; *current != 0;)
|
||||
{
|
||||
if(*current == '<')
|
||||
|
@ -831,7 +835,7 @@ static LRESULT SYSLINK_Draw (const SYSLINK_INFO *infoPtr, HDC hdc)
|
|||
|
||||
hOldFont = SelectObject(hdc, infoPtr->Font);
|
||||
OldTextColor = SetTextColor(hdc, infoPtr->TextColor);
|
||||
OldBkColor = SetBkColor(hdc, comctl32_color.clrBtnFace);
|
||||
OldBkColor = SetBkColor(hdc, infoPtr->BackColor);
|
||||
|
||||
GetClientRect(infoPtr->Self, &rc);
|
||||
rc.right -= SL_RIGHTMARGIN + SL_LEFTMARGIN;
|
||||
|
@ -906,6 +910,22 @@ static LRESULT SYSLINK_Paint (const SYSLINK_INFO *infoPtr, HDC hdcParam)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* SYSLINK_EraseBkgnd
|
||||
* Handles the WM_ERASEBKGND message.
|
||||
*/
|
||||
static LRESULT SYSLINK_EraseBkgnd (const SYSLINK_INFO *infoPtr, HDC hdc)
|
||||
{
|
||||
HBRUSH hbr;
|
||||
RECT r;
|
||||
|
||||
GetClientRect(infoPtr->Self, &r);
|
||||
hbr = CreateSolidBrush(infoPtr->BackColor);
|
||||
FillRect(hdc, &r, hbr);
|
||||
DeleteObject(hbr);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* SYSLINK_SetFont
|
||||
|
@ -1434,13 +1454,13 @@ static LRESULT SYSLINK_LButtonUp (SYSLINK_INFO *infoPtr, const POINT *pt)
|
|||
*/
|
||||
static BOOL SYSLINK_OnEnter (const SYSLINK_INFO *infoPtr)
|
||||
{
|
||||
if(infoPtr->HasFocus)
|
||||
if(infoPtr->HasFocus && !infoPtr->IgnoreReturn)
|
||||
{
|
||||
PDOC_ITEM Focus;
|
||||
int id;
|
||||
|
||||
Focus = SYSLINK_GetFocusLink(infoPtr, &id);
|
||||
if(Focus != NULL)
|
||||
if(Focus)
|
||||
{
|
||||
SYSLINK_SendParentNotify(infoPtr, NM_RETURN, Focus, id);
|
||||
return TRUE;
|
||||
|
@ -1551,6 +1571,9 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
|
|||
case WM_PAINT:
|
||||
return SYSLINK_Paint (infoPtr, (HDC)wParam);
|
||||
|
||||
case WM_ERASEBKGND:
|
||||
return SYSLINK_EraseBkgnd(infoPtr, (HDC)wParam);
|
||||
|
||||
case WM_SETCURSOR:
|
||||
{
|
||||
LHITTESTINFO ht;
|
||||
|
@ -1730,7 +1753,10 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
|
|||
infoPtr->TextColor = comctl32_color.clrWindowText;
|
||||
infoPtr->LinkColor = comctl32_color.clrHighlight;
|
||||
infoPtr->VisitedColor = comctl32_color.clrHighlight;
|
||||
infoPtr->BackColor = infoPtr->Style & LWS_TRANSPARENT ?
|
||||
comctl32_color.clrWindow : comctl32_color.clrBtnFace;
|
||||
infoPtr->BreakChar = ' ';
|
||||
infoPtr->IgnoreReturn = infoPtr->Style & LWS_IGNORERETURN;
|
||||
TRACE("SysLink Ctrl creation, hwnd=%p\n", hwnd);
|
||||
SYSLINK_SetText(infoPtr, ((LPCREATESTRUCTW)lParam)->lpszName);
|
||||
return 0;
|
||||
|
@ -1746,6 +1772,8 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
|
|||
|
||||
case WM_SYSCOLORCHANGE:
|
||||
COMCTL32_RefreshSysColors();
|
||||
if (infoPtr->Style & LWS_TRANSPARENT)
|
||||
infoPtr->BackColor = comctl32_color.clrWindow;
|
||||
return 0;
|
||||
|
||||
default:
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -69,7 +69,7 @@ static void paint_text (HWND hwnd, HDC hdc, DWORD dwStyle, const COMBOBOXINFO *c
|
|||
if( (pText = HeapAlloc( GetProcessHeap(), 0, (size + 1) * sizeof(WCHAR))) )
|
||||
{
|
||||
/* size from LB_GETTEXTLEN may be too large, from LB_GETTEXT is accurate */
|
||||
size=SendMessageW (cbi->hwndList, LB_GETTEXT, (WPARAM)id, (LPARAM)pText);
|
||||
size = SendMessageW (cbi->hwndList, LB_GETTEXT, id, (LPARAM)pText);
|
||||
pText[size] = '\0'; /* just in case */
|
||||
} else return;
|
||||
}
|
||||
|
@ -116,8 +116,7 @@ static void paint_text (HWND hwnd, HDC hdc, DWORD dwStyle, const COMBOBOXINFO *c
|
|||
dis.itemState = itemState;
|
||||
dis.hDC = hdc;
|
||||
dis.rcItem = rectEdit;
|
||||
dis.itemData = SendMessageW(cbi->hwndList, LB_GETITEMDATA,
|
||||
(WPARAM)id, 0 );
|
||||
dis.itemData = SendMessageW(cbi->hwndList, LB_GETITEMDATA, id, 0);
|
||||
|
||||
/*
|
||||
* Clip the DC and have the parent draw the item.
|
||||
|
|
|
@ -264,7 +264,7 @@ TOOLBAR_GetText(const TOOLBAR_INFO *infoPtr, const TBUTTON_INFO *btnPtr)
|
|||
LPWSTR lpText = NULL;
|
||||
|
||||
/* NOTE: iString == -1 is undocumented */
|
||||
if ((HIWORD(btnPtr->iString) != 0) && (btnPtr->iString != -1))
|
||||
if (!IS_INTRESOURCE(btnPtr->iString) && (btnPtr->iString != -1))
|
||||
lpText = (LPWSTR)btnPtr->iString;
|
||||
else if ((btnPtr->iString >= 0) && (btnPtr->iString < infoPtr->nNumStrings))
|
||||
lpText = infoPtr->strings[btnPtr->iString];
|
||||
|
@ -315,6 +315,11 @@ TOOLBAR_DumpToolbar(const TOOLBAR_INFO *iP, INT line)
|
|||
}
|
||||
}
|
||||
|
||||
static inline BOOL
|
||||
TOOLBAR_ButtonHasString(const TBUTTON_INFO *btnPtr)
|
||||
{
|
||||
return HIWORD(btnPtr->iString) && btnPtr->iString != -1;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TOOLBAR_CheckStyle
|
||||
|
@ -1832,7 +1837,7 @@ TOOLBAR_InternalInsertButtonsT(TOOLBAR_INFO *infoPtr, INT iIndex, UINT nAddButto
|
|||
btnPtr->dwData = lpTbb[iButton].dwData;
|
||||
if (btnPtr->fsStyle & BTNS_SEP)
|
||||
btnPtr->iString = -1;
|
||||
else if(HIWORD(lpTbb[iButton].iString) && lpTbb[iButton].iString != -1)
|
||||
else if(!IS_INTRESOURCE(lpTbb[iButton].iString) && lpTbb[iButton].iString != -1)
|
||||
{
|
||||
if (fUnicode)
|
||||
Str_SetPtrW((LPWSTR*)&btnPtr->iString, (LPWSTR)lpTbb[iButton].iString );
|
||||
|
@ -2601,7 +2606,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
COLORREF oldBk = 0;
|
||||
|
||||
/* get item data */
|
||||
btnInfo = (PCUSTOMBUTTON)SendDlgItemMessageW (hwnd, wParam, LB_GETITEMDATA, (WPARAM)lpdis->itemID, 0);
|
||||
btnInfo = (PCUSTOMBUTTON)SendDlgItemMessageW (hwnd, wParam, LB_GETITEMDATA, lpdis->itemID, 0);
|
||||
if (btnInfo == NULL)
|
||||
{
|
||||
FIXME("btnInfo invalid!\n");
|
||||
|
@ -2892,7 +2897,7 @@ TOOLBAR_AddStringW (TOOLBAR_INFO *infoPtr, HINSTANCE hInstance, LPARAM lParam)
|
|||
BOOL fFirstString = (infoPtr->nNumStrings == 0);
|
||||
INT nIndex = infoPtr->nNumStrings;
|
||||
|
||||
if (hInstance && (HIWORD(lParam) == 0)) {
|
||||
if (hInstance && IS_INTRESOURCE(lParam)) {
|
||||
WCHAR szString[MAX_RESOURCE_STRING_LENGTH];
|
||||
WCHAR delimiter;
|
||||
WCHAR *next_delim;
|
||||
|
@ -2960,7 +2965,7 @@ TOOLBAR_AddStringA (TOOLBAR_INFO *infoPtr, HINSTANCE hInstance, LPARAM lParam)
|
|||
INT nIndex;
|
||||
INT len;
|
||||
|
||||
if (hInstance && (HIWORD(lParam) == 0)) /* load from resources */
|
||||
if (hInstance && IS_INTRESOURCE(lParam)) /* load from resources */
|
||||
return TOOLBAR_AddStringW(infoPtr, hInstance, lParam);
|
||||
|
||||
p = (LPSTR)lParam;
|
||||
|
@ -3151,8 +3156,6 @@ TOOLBAR_Customize (TOOLBAR_INFO *infoPtr)
|
|||
{
|
||||
CUSTDLG_INFO custInfo;
|
||||
LRESULT ret;
|
||||
LPCVOID template;
|
||||
HRSRC hRes;
|
||||
NMHDR nmhdr;
|
||||
|
||||
custInfo.tbInfo = infoPtr;
|
||||
|
@ -3161,17 +3164,8 @@ TOOLBAR_Customize (TOOLBAR_INFO *infoPtr)
|
|||
/* send TBN_BEGINADJUST notification */
|
||||
TOOLBAR_SendNotify (&nmhdr, infoPtr, TBN_BEGINADJUST);
|
||||
|
||||
if (!(hRes = FindResourceW (COMCTL32_hModule,
|
||||
MAKEINTRESOURCEW(IDD_TBCUSTOMIZE),
|
||||
(LPWSTR)RT_DIALOG)))
|
||||
return FALSE;
|
||||
|
||||
if(!(template = LoadResource (COMCTL32_hModule, hRes)))
|
||||
return FALSE;
|
||||
|
||||
ret = DialogBoxIndirectParamW ((HINSTANCE)GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_HINSTANCE),
|
||||
template, infoPtr->hwndSelf, TOOLBAR_CustomizeDialogProc,
|
||||
(LPARAM)&custInfo);
|
||||
ret = DialogBoxParamW (COMCTL32_hModule, MAKEINTRESOURCEW(IDD_TBCUSTOMIZE),
|
||||
infoPtr->hwndSelf, TOOLBAR_CustomizeDialogProc, (LPARAM)&custInfo);
|
||||
|
||||
/* send TBN_ENDADJUST notification */
|
||||
TOOLBAR_SendNotify (&nmhdr, infoPtr, TBN_ENDADJUST);
|
||||
|
@ -3203,6 +3197,8 @@ TOOLBAR_DeleteButton (TOOLBAR_INFO *infoPtr, INT nIndex)
|
|||
|
||||
if (infoPtr->nNumButtons == 1) {
|
||||
TRACE(" simple delete!\n");
|
||||
if (TOOLBAR_ButtonHasString(infoPtr->buttons))
|
||||
Free((LPWSTR)infoPtr->buttons[0].iString);
|
||||
Free (infoPtr->buttons);
|
||||
infoPtr->buttons = NULL;
|
||||
infoPtr->nNumButtons = 0;
|
||||
|
@ -3223,6 +3219,8 @@ TOOLBAR_DeleteButton (TOOLBAR_INFO *infoPtr, INT nIndex)
|
|||
(infoPtr->nNumButtons - nIndex) * sizeof(TBUTTON_INFO));
|
||||
}
|
||||
|
||||
if (TOOLBAR_ButtonHasString(&oldButtons[nIndex]))
|
||||
Free((LPWSTR)oldButtons[nIndex].iString);
|
||||
Free (oldButtons);
|
||||
}
|
||||
|
||||
|
@ -3364,7 +3362,7 @@ TOOLBAR_GetButtonInfoT(const TOOLBAR_INFO *infoPtr, INT Id, LPTBBUTTONINFOW lpTb
|
|||
if (lpTbInfo->dwMask & TBIF_TEXT) {
|
||||
/* TB_GETBUTTONINFO doesn't retrieve text from the string list, so we
|
||||
can't use TOOLBAR_GetText here */
|
||||
if (HIWORD(btnPtr->iString) && (btnPtr->iString != -1)) {
|
||||
if (!IS_INTRESOURCE(btnPtr->iString) && (btnPtr->iString != -1)) {
|
||||
LPWSTR lpText = (LPWSTR)btnPtr->iString;
|
||||
if (bUnicode)
|
||||
Str_GetPtrW(lpText, lpTbInfo->pszText, lpTbInfo->cchText);
|
||||
|
@ -3386,24 +3384,7 @@ TOOLBAR_GetButtonSize (const TOOLBAR_INFO *infoPtr)
|
|||
|
||||
|
||||
static LRESULT
|
||||
TOOLBAR_GetButtonTextA (const TOOLBAR_INFO *infoPtr, INT Id, LPSTR lpText)
|
||||
{
|
||||
INT nIndex;
|
||||
LPWSTR lpTextW;
|
||||
|
||||
nIndex = TOOLBAR_GetButtonIndex (infoPtr, Id, FALSE);
|
||||
if (nIndex == -1)
|
||||
return -1;
|
||||
|
||||
lpTextW = TOOLBAR_GetText(infoPtr,&infoPtr->buttons[nIndex]);
|
||||
|
||||
return WideCharToMultiByte( CP_ACP, 0, lpTextW, -1,
|
||||
lpText, lpText ? 0x7fffffff : 0, NULL, NULL ) - 1;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TOOLBAR_GetButtonTextW (const TOOLBAR_INFO *infoPtr, INT Id, LPWSTR lpStr)
|
||||
TOOLBAR_GetButtonText (const TOOLBAR_INFO *infoPtr, INT Id, LPWSTR lpStr, BOOL isW)
|
||||
{
|
||||
INT nIndex;
|
||||
LPWSTR lpText;
|
||||
|
@ -3415,14 +3396,17 @@ TOOLBAR_GetButtonTextW (const TOOLBAR_INFO *infoPtr, INT Id, LPWSTR lpStr)
|
|||
|
||||
lpText = TOOLBAR_GetText(infoPtr,&infoPtr->buttons[nIndex]);
|
||||
|
||||
if (lpText)
|
||||
if (isW)
|
||||
{
|
||||
ret = strlenW (lpText);
|
||||
|
||||
if (lpStr)
|
||||
strcpyW (lpStr, lpText);
|
||||
if (lpText)
|
||||
{
|
||||
ret = strlenW (lpText);
|
||||
if (lpStr) strcpyW (lpStr, lpText);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
ret = WideCharToMultiByte( CP_ACP, 0, lpText, -1,
|
||||
(LPSTR)lpStr, lpStr ? 0x7fffffff : 0, NULL, NULL ) - 1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -3996,7 +3980,7 @@ TOOLBAR_ReplaceBitmap (TOOLBAR_INFO *infoPtr, const TBREPLACEBITMAP *lpReplace)
|
|||
FIXME("changing standard bitmaps not implemented\n");
|
||||
return FALSE;
|
||||
}
|
||||
else if (lpReplace->hInstOld != 0)
|
||||
else if (lpReplace->hInstOld != 0 && lpReplace->hInstOld != lpReplace->hInstNew)
|
||||
FIXME("resources not in the current module not implemented\n");
|
||||
|
||||
TRACE("To be replaced hInstOld %p nIDOld %lx\n", lpReplace->hInstOld, lpReplace->nIDOld);
|
||||
|
@ -4158,7 +4142,7 @@ TOOLBAR_Restore(TOOLBAR_INFO *infoPtr, const TBSAVEPARAMSW *lpSave)
|
|||
|
||||
/* can't contain real string as we don't know whether
|
||||
* the client put an ANSI or Unicode string in there */
|
||||
if (HIWORD(nmtbr.tbButton.iString))
|
||||
if (!IS_INTRESOURCE(nmtbr.tbButton.iString))
|
||||
nmtbr.tbButton.iString = 0;
|
||||
|
||||
TOOLBAR_InsertButtonT(infoPtr, -1, &nmtbr.tbButton, TRUE);
|
||||
|
@ -4301,58 +4285,8 @@ TOOLBAR_SetBitmapSize (TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
|
||||
static LRESULT
|
||||
TOOLBAR_SetButtonInfoA (TOOLBAR_INFO *infoPtr, INT Id, const TBBUTTONINFOA *lptbbi)
|
||||
{
|
||||
TBUTTON_INFO *btnPtr;
|
||||
INT nIndex;
|
||||
RECT oldBtnRect;
|
||||
|
||||
if (lptbbi == NULL)
|
||||
return FALSE;
|
||||
if (lptbbi->cbSize < sizeof(TBBUTTONINFOA))
|
||||
return FALSE;
|
||||
|
||||
nIndex = TOOLBAR_GetButtonIndex (infoPtr, Id, lptbbi->dwMask & TBIF_BYINDEX);
|
||||
if (nIndex == -1)
|
||||
return FALSE;
|
||||
|
||||
btnPtr = &infoPtr->buttons[nIndex];
|
||||
if (lptbbi->dwMask & TBIF_COMMAND)
|
||||
btnPtr->idCommand = lptbbi->idCommand;
|
||||
if (lptbbi->dwMask & TBIF_IMAGE)
|
||||
btnPtr->iBitmap = lptbbi->iImage;
|
||||
if (lptbbi->dwMask & TBIF_LPARAM)
|
||||
btnPtr->dwData = lptbbi->lParam;
|
||||
if (lptbbi->dwMask & TBIF_SIZE)
|
||||
btnPtr->cx = lptbbi->cx;
|
||||
if (lptbbi->dwMask & TBIF_STATE)
|
||||
btnPtr->fsState = lptbbi->fsState;
|
||||
if (lptbbi->dwMask & TBIF_STYLE)
|
||||
btnPtr->fsStyle = lptbbi->fsStyle;
|
||||
|
||||
if ((lptbbi->dwMask & TBIF_TEXT) && ((INT_PTR)lptbbi->pszText != -1)) {
|
||||
if ((HIWORD(btnPtr->iString) == 0) || (btnPtr->iString == -1))
|
||||
/* iString is index, zero it to make Str_SetPtr succeed */
|
||||
btnPtr->iString=0;
|
||||
|
||||
Str_SetPtrAtoW ((LPWSTR *)&btnPtr->iString, lptbbi->pszText);
|
||||
}
|
||||
|
||||
/* save the button rect to see if we need to redraw the whole toolbar */
|
||||
oldBtnRect = btnPtr->rect;
|
||||
TOOLBAR_LayoutToolbar(infoPtr);
|
||||
|
||||
if (!EqualRect(&oldBtnRect, &btnPtr->rect))
|
||||
InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
|
||||
else
|
||||
InvalidateRect(infoPtr->hwndSelf, &btnPtr->rect, TRUE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TOOLBAR_SetButtonInfoW (TOOLBAR_INFO *infoPtr, INT Id, const TBBUTTONINFOW *lptbbi)
|
||||
TOOLBAR_SetButtonInfo (TOOLBAR_INFO *infoPtr, INT Id,
|
||||
const TBBUTTONINFOW *lptbbi, BOOL isW)
|
||||
{
|
||||
TBUTTON_INFO *btnPtr;
|
||||
INT nIndex;
|
||||
|
@ -4382,10 +4316,13 @@ TOOLBAR_SetButtonInfoW (TOOLBAR_INFO *infoPtr, INT Id, const TBBUTTONINFOW *lptb
|
|||
btnPtr->fsStyle = lptbbi->fsStyle;
|
||||
|
||||
if ((lptbbi->dwMask & TBIF_TEXT) && ((INT_PTR)lptbbi->pszText != -1)) {
|
||||
if ((HIWORD(btnPtr->iString) == 0) || (btnPtr->iString == -1))
|
||||
/* iString is index, zero it to make Str_SetPtr succeed */
|
||||
btnPtr->iString=0;
|
||||
Str_SetPtrW ((LPWSTR *)&btnPtr->iString, lptbbi->pszText);
|
||||
/* iString is index, zero it to make Str_SetPtr succeed */
|
||||
if (!TOOLBAR_ButtonHasString(btnPtr)) btnPtr->iString = 0;
|
||||
|
||||
if (isW)
|
||||
Str_SetPtrW ((LPWSTR *)&btnPtr->iString, lptbbi->pszText);
|
||||
else
|
||||
Str_SetPtrAtoW ((LPWSTR *)&btnPtr->iString, (LPSTR)lptbbi->pszText);
|
||||
}
|
||||
|
||||
/* save the button rect to see if we need to redraw the whole toolbar */
|
||||
|
@ -5205,7 +5142,7 @@ TOOLBAR_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
|
|||
infoPtr->dwStyle = dwStyle;
|
||||
GetClientRect(hwnd, &infoPtr->client_rect);
|
||||
infoPtr->bUnicode = infoPtr->hwndNotify &&
|
||||
(NFR_UNICODE == SendMessageW(hwnd, WM_NOTIFYFORMAT, (WPARAM)hwnd, (LPARAM)NF_REQUERY));
|
||||
(NFR_UNICODE == SendMessageW(hwnd, WM_NOTIFYFORMAT, (WPARAM)hwnd, NF_REQUERY));
|
||||
infoPtr->hwndToolTip = NULL; /* if needed the tooltip control will be created after a WM_MOUSEMOVE */
|
||||
|
||||
SystemParametersInfoW (SPI_GETICONTITLELOGFONT, 0, &logFont, 0);
|
||||
|
@ -5222,6 +5159,8 @@ TOOLBAR_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
|
|||
static LRESULT
|
||||
TOOLBAR_Destroy (TOOLBAR_INFO *infoPtr)
|
||||
{
|
||||
INT i;
|
||||
|
||||
/* delete tooltip control */
|
||||
if (infoPtr->hwndToolTip)
|
||||
DestroyWindow (infoPtr->hwndToolTip);
|
||||
|
@ -5231,11 +5170,13 @@ TOOLBAR_Destroy (TOOLBAR_INFO *infoPtr)
|
|||
Free (infoPtr->bitmaps); /* bitmaps list */
|
||||
|
||||
/* delete button data */
|
||||
for (i = 0; i < infoPtr->nNumButtons; i++)
|
||||
if (TOOLBAR_ButtonHasString(&infoPtr->buttons[i]))
|
||||
Free ((LPWSTR)infoPtr->buttons[i].iString);
|
||||
Free (infoPtr->buttons);
|
||||
|
||||
/* delete strings */
|
||||
if (infoPtr->strings) {
|
||||
INT i;
|
||||
for (i = 0; i < infoPtr->nNumStrings; i++)
|
||||
Free (infoPtr->strings[i]);
|
||||
|
||||
|
@ -5648,7 +5589,7 @@ TOOLBAR_LButtonUp (TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
|||
else
|
||||
{
|
||||
TRACE("button %d dragged out of toolbar\n", infoPtr->nButtonDrag);
|
||||
TOOLBAR_DeleteButton(infoPtr, (WPARAM)infoPtr->nButtonDrag);
|
||||
TOOLBAR_DeleteButton(infoPtr, infoPtr->nButtonDrag);
|
||||
}
|
||||
|
||||
/* button under cursor changed so need to re-set hot item */
|
||||
|
@ -6156,7 +6097,7 @@ static LRESULT TOOLBAR_TTGetDispInfo (TOOLBAR_INFO *infoPtr, NMTTDISPINFOW *lpnm
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
else if (tbgit.pszText[0])
|
||||
else if (tbgit.pszText && tbgit.pszText[0])
|
||||
{
|
||||
MultiByteToWideChar(CP_ACP, 0, tbgit.pszText, -1,
|
||||
lpnmtdi->lpszText, sizeof(lpnmtdi->szText)/sizeof(lpnmtdi->szText[0]));
|
||||
|
@ -6434,7 +6375,7 @@ TOOLBAR_StyleChanged (TOOLBAR_INFO *infoPtr, INT nType, const STYLESTRUCT *lpSty
|
|||
|
||||
|
||||
static LRESULT
|
||||
TOOLBAR_SysColorChange ()
|
||||
TOOLBAR_SysColorChange (void)
|
||||
{
|
||||
COMCTL32_RefreshSysColors();
|
||||
|
||||
|
@ -6469,11 +6410,9 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
return TOOLBAR_AddBitmap (infoPtr, (INT)wParam, (TBADDBITMAP*)lParam);
|
||||
|
||||
case TB_ADDBUTTONSA:
|
||||
return TOOLBAR_AddButtonsT(infoPtr, wParam, (LPTBBUTTON)lParam, FALSE);
|
||||
|
||||
case TB_ADDBUTTONSW:
|
||||
return TOOLBAR_AddButtonsT(infoPtr, wParam, (LPTBBUTTON)lParam, TRUE);
|
||||
|
||||
return TOOLBAR_AddButtonsT (infoPtr, wParam, (LPTBBUTTON)lParam,
|
||||
uMsg == TB_ADDBUTTONSW);
|
||||
case TB_ADDSTRINGA:
|
||||
return TOOLBAR_AddStringA (infoPtr, (HINSTANCE)wParam, lParam);
|
||||
|
||||
|
@ -6520,19 +6459,16 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
return TOOLBAR_GetButton (infoPtr, wParam, (TBBUTTON*)lParam);
|
||||
|
||||
case TB_GETBUTTONINFOA:
|
||||
return TOOLBAR_GetButtonInfoT(infoPtr, wParam, (LPTBBUTTONINFOW)lParam, FALSE);
|
||||
|
||||
case TB_GETBUTTONINFOW:
|
||||
return TOOLBAR_GetButtonInfoT(infoPtr, wParam, (LPTBBUTTONINFOW)lParam, TRUE);
|
||||
|
||||
return TOOLBAR_GetButtonInfoT (infoPtr, wParam, (LPTBBUTTONINFOW)lParam,
|
||||
uMsg == TB_GETBUTTONINFOW);
|
||||
case TB_GETBUTTONSIZE:
|
||||
return TOOLBAR_GetButtonSize (infoPtr);
|
||||
|
||||
case TB_GETBUTTONTEXTA:
|
||||
return TOOLBAR_GetButtonTextA (infoPtr, wParam, (LPSTR)lParam);
|
||||
|
||||
case TB_GETBUTTONTEXTW:
|
||||
return TOOLBAR_GetButtonTextW (infoPtr, wParam, (LPWSTR)lParam);
|
||||
return TOOLBAR_GetButtonText (infoPtr, wParam, (LPWSTR)lParam,
|
||||
uMsg == TB_GETBUTTONTEXTW);
|
||||
|
||||
case TB_GETDISABLEDIMAGELIST:
|
||||
return TOOLBAR_GetDisabledImageList (infoPtr, wParam);
|
||||
|
@ -6603,10 +6539,9 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
return TOOLBAR_Indeterminate (infoPtr, wParam, LOWORD(lParam));
|
||||
|
||||
case TB_INSERTBUTTONA:
|
||||
return TOOLBAR_InsertButtonT(infoPtr, wParam, (TBBUTTON*)lParam, FALSE);
|
||||
|
||||
case TB_INSERTBUTTONW:
|
||||
return TOOLBAR_InsertButtonT(infoPtr, wParam, (TBBUTTON*)lParam, TRUE);
|
||||
return TOOLBAR_InsertButtonT(infoPtr, wParam, (TBBUTTON*)lParam,
|
||||
uMsg == TB_INSERTBUTTONW);
|
||||
|
||||
/* case TB_INSERTMARKHITTEST: */ /* 4.71 */
|
||||
|
||||
|
@ -6660,11 +6595,9 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
return TOOLBAR_SetBitmapSize (infoPtr, wParam, lParam);
|
||||
|
||||
case TB_SETBUTTONINFOA:
|
||||
return TOOLBAR_SetButtonInfoA (infoPtr, wParam, (LPTBBUTTONINFOA)lParam);
|
||||
|
||||
case TB_SETBUTTONINFOW:
|
||||
return TOOLBAR_SetButtonInfoW (infoPtr, wParam, (LPTBBUTTONINFOW)lParam);
|
||||
|
||||
return TOOLBAR_SetButtonInfo (infoPtr, wParam, (LPTBBUTTONINFOW)lParam,
|
||||
uMsg == TB_SETBUTTONINFOW);
|
||||
case TB_SETBUTTONSIZE:
|
||||
return TOOLBAR_SetButtonSize (infoPtr, lParam);
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -135,18 +135,15 @@ static inline int notify (const TRACKBAR_INFO *infoPtr, INT code)
|
|||
return notify_hdr(infoPtr, code, &nmh);
|
||||
}
|
||||
|
||||
static BOOL
|
||||
notify_with_scroll (const TRACKBAR_INFO *infoPtr, UINT code)
|
||||
static void notify_with_scroll (const TRACKBAR_INFO *infoPtr, UINT code)
|
||||
{
|
||||
BOOL bVert = infoPtr->dwStyle & TBS_VERT;
|
||||
UINT scroll = infoPtr->dwStyle & TBS_VERT ? WM_VSCROLL : WM_HSCROLL;
|
||||
|
||||
TRACE("%x\n", code);
|
||||
|
||||
return (BOOL) SendMessageW (infoPtr->hwndNotify,
|
||||
bVert ? WM_VSCROLL : WM_HSCROLL,
|
||||
(WPARAM)code, (LPARAM)infoPtr->hwndSelf);
|
||||
SendMessageW (infoPtr->hwndNotify, scroll, code, (LPARAM)infoPtr->hwndSelf);
|
||||
}
|
||||
|
||||
|
||||
static void TRACKBAR_RecalculateTics (TRACKBAR_INFO *infoPtr)
|
||||
{
|
||||
int tic;
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
* We use callbackMask to keep track of fields to be updated.
|
||||
*
|
||||
* TODO:
|
||||
* missing notifications: NM_SETCURSOR, TVN_GETINFOTIP, TVN_KEYDOWN,
|
||||
* missing notifications: TVN_GETINFOTIP, TVN_KEYDOWN,
|
||||
* TVN_SETDISPINFO, TVN_SINGLEEXPAND
|
||||
*
|
||||
* missing styles: TVS_FULLROWSELECT, TVS_INFOTIP, TVS_RTLREADING,
|
||||
|
@ -63,6 +63,8 @@
|
|||
#include "wine/unicode.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(treeview);
|
||||
|
||||
/* internal structures */
|
||||
|
||||
typedef struct _TREEITEM /* HTREEITEM is a _TREEINFO *. */
|
||||
|
@ -153,10 +155,10 @@ typedef struct tagTREEVIEW_INFO
|
|||
int stateImageWidth;
|
||||
HDPA items;
|
||||
|
||||
DWORD lastKeyPressTimestamp; /* Added */
|
||||
WPARAM charCode; /* Added */
|
||||
INT nSearchParamLength; /* Added */
|
||||
WCHAR szSearchParam[ MAX_PATH ]; /* Added */
|
||||
DWORD lastKeyPressTimestamp;
|
||||
WPARAM charCode;
|
||||
INT nSearchParamLength;
|
||||
WCHAR szSearchParam[ MAX_PATH ];
|
||||
} TREEVIEW_INFO;
|
||||
|
||||
|
||||
|
@ -177,14 +179,6 @@ typedef struct tagTREEVIEW_INFO
|
|||
#define TV_EDIT_TIMER 2
|
||||
#define TV_EDIT_TIMER_SET 2
|
||||
|
||||
|
||||
VOID TREEVIEW_Register (VOID);
|
||||
VOID TREEVIEW_Unregister (VOID);
|
||||
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(treeview);
|
||||
|
||||
|
||||
#define TEXT_CALLBACK_SIZE 260
|
||||
|
||||
#define TREEVIEW_LEFT_MARGIN 8
|
||||
|
@ -197,6 +191,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(treeview);
|
|||
#define OVERLAYIMAGEINDEX(x) (((x) >> 8) & 0x0f)
|
||||
#define ISVISIBLE(x) ((x)->visibleOrder >= 0)
|
||||
|
||||
#define GETLINECOLOR(x) ((x) == CLR_DEFAULT ? comctl32_color.clrGrayText : (x))
|
||||
#define GETBKCOLOR(x) ((x) == CLR_NONE ? comctl32_color.clrWindow : (x))
|
||||
#define GETTXTCOLOR(x) ((x) == CLR_NONE ? comctl32_color.clrWindowText : (x))
|
||||
#define GETINSCOLOR(x) ((x) == CLR_DEFAULT ? comctl32_color.clrBtnText : (x))
|
||||
|
||||
static const WCHAR themeClass[] = { 'T','r','e','e','v','i','e','w',0 };
|
||||
|
||||
|
@ -213,8 +211,6 @@ static LRESULT TREEVIEW_RButtonUp(const TREEVIEW_INFO *, const POINT *);
|
|||
static LRESULT TREEVIEW_EndEditLabelNow(TREEVIEW_INFO *infoPtr, BOOL bCancel);
|
||||
static VOID TREEVIEW_UpdateScrollBars(TREEVIEW_INFO *infoPtr);
|
||||
static LRESULT TREEVIEW_HScroll(TREEVIEW_INFO *, WPARAM);
|
||||
static INT TREEVIEW_NotifyFormat (TREEVIEW_INFO *infoPtr, HWND wParam, UINT lParam);
|
||||
|
||||
|
||||
/* Random Utilities *****************************************************/
|
||||
|
||||
|
@ -842,6 +838,23 @@ TREEVIEW_HasChildren(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem)
|
|||
return wineItem->cChildren > 0;
|
||||
}
|
||||
|
||||
static INT TREEVIEW_NotifyFormat (TREEVIEW_INFO *infoPtr, HWND hwndFrom, UINT nCommand)
|
||||
{
|
||||
INT format;
|
||||
|
||||
TRACE("(hwndFrom=%p, nCommand=%d)\n", hwndFrom, nCommand);
|
||||
|
||||
if (nCommand != NF_REQUERY) return 0;
|
||||
|
||||
format = SendMessageW(hwndFrom, WM_NOTIFYFORMAT, (WPARAM)infoPtr->hwnd, NF_QUERY);
|
||||
TRACE("format=%d\n", format);
|
||||
|
||||
if (format != NFR_ANSI && format != NFR_UNICODE) return 0;
|
||||
|
||||
infoPtr->bNtfUnicode = (format == NFR_UNICODE);
|
||||
|
||||
return format;
|
||||
}
|
||||
|
||||
/* Item Position ********************************************************/
|
||||
|
||||
|
@ -1685,10 +1698,10 @@ TREEVIEW_GetImageList(const TREEVIEW_INFO *infoPtr, WPARAM wParam)
|
|||
|
||||
switch (wParam)
|
||||
{
|
||||
case (WPARAM)TVSIL_NORMAL:
|
||||
case TVSIL_NORMAL:
|
||||
return (LRESULT)infoPtr->himlNormal;
|
||||
|
||||
case (WPARAM)TVSIL_STATE:
|
||||
case TVSIL_STATE:
|
||||
return (LRESULT)infoPtr->himlState;
|
||||
|
||||
default:
|
||||
|
@ -1742,7 +1755,7 @@ TREEVIEW_SetImageList(TREEVIEW_INFO *infoPtr, WPARAM wParam, HIMAGELIST himlNew)
|
|||
|
||||
switch (wParam)
|
||||
{
|
||||
case (WPARAM)TVSIL_NORMAL:
|
||||
case TVSIL_NORMAL:
|
||||
himlOld = infoPtr->himlNormal;
|
||||
infoPtr->himlNormal = himlNew;
|
||||
|
||||
|
@ -1757,7 +1770,7 @@ TREEVIEW_SetImageList(TREEVIEW_INFO *infoPtr, WPARAM wParam, HIMAGELIST himlNew)
|
|||
|
||||
break;
|
||||
|
||||
case (WPARAM)TVSIL_STATE:
|
||||
case TVSIL_STATE:
|
||||
himlOld = infoPtr->himlState;
|
||||
infoPtr->himlState = himlNew;
|
||||
|
||||
|
@ -1871,6 +1884,7 @@ TREEVIEW_SetFont(TREEVIEW_INFO *infoPtr, HFONT hFont, BOOL bRedraw)
|
|||
infoPtr->hFont = hFont ? hFont : infoPtr->hDefaultFont;
|
||||
|
||||
DeleteObject(infoPtr->hBoldFont);
|
||||
DeleteObject(infoPtr->hUnderlineFont);
|
||||
infoPtr->hBoldFont = TREEVIEW_CreateBoldFont(infoPtr->hFont);
|
||||
infoPtr->hUnderlineFont = TREEVIEW_CreateUnderlineFont(infoPtr->hFont);
|
||||
|
||||
|
@ -2313,15 +2327,14 @@ TREEVIEW_DrawItemLines(const TREEVIEW_INFO *infoPtr, HDC hdc, const TREEVIEW_ITE
|
|||
& (TVS_LINESATROOT|TVS_HASLINES|TVS_HASBUTTONS))
|
||||
> TVS_LINESATROOT);
|
||||
HBRUSH hbr, hbrOld;
|
||||
COLORREF clrBk = infoPtr->clrBk == -1 ? comctl32_color.clrWindow:
|
||||
infoPtr->clrBk;
|
||||
COLORREF clrBk = GETBKCOLOR(infoPtr->clrBk);
|
||||
|
||||
if (!lar && item->iLevel == 0)
|
||||
return;
|
||||
|
||||
hbr = CreateSolidBrush(clrBk);
|
||||
hbrOld = SelectObject(hdc, hbr);
|
||||
|
||||
|
||||
centerx = (item->linesOffset + item->stateOffset) / 2;
|
||||
centery = (item->rect.top + item->rect.bottom) / 2;
|
||||
|
||||
|
@ -2333,7 +2346,7 @@ TREEVIEW_DrawItemLines(const TREEVIEW_INFO *infoPtr, HDC hdc, const TREEVIEW_ITE
|
|||
|
||||
/* Get a dotted grey pen */
|
||||
lb.lbStyle = BS_SOLID;
|
||||
lb.lbColor = infoPtr->clrLine;
|
||||
lb.lbColor = GETLINECOLOR(infoPtr->clrLine);
|
||||
hNewPen = ExtCreatePen(PS_COSMETIC|PS_ALTERNATE, 1, &lb, 0, NULL);
|
||||
hOldPen = SelectObject(hdc, hNewPen);
|
||||
|
||||
|
@ -2402,16 +2415,20 @@ 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);
|
||||
|
||||
|
||||
HPEN new_pen = CreatePen(PS_SOLID, 0, GETLINECOLOR(infoPtr->clrLine));
|
||||
HPEN old_pen = SelectObject(hdc, new_pen);
|
||||
|
||||
Rectangle(hdc, centerx - rectsize - 1, centery - rectsize - 1,
|
||||
centerx + rectsize + 2, centery + rectsize + 2);
|
||||
|
||||
SelectObject(hdc, hOldPen);
|
||||
DeleteObject(hNewPen);
|
||||
|
||||
|
||||
SelectObject(hdc, old_pen);
|
||||
DeleteObject(new_pen);
|
||||
|
||||
/* draw +/- signs with current text color */
|
||||
new_pen = CreatePen(PS_SOLID, 0, GETTXTCOLOR(infoPtr->clrText));
|
||||
old_pen = SelectObject(hdc, new_pen);
|
||||
|
||||
if (height < 18 || width < 18)
|
||||
{
|
||||
MoveToEx(hdc, centerx - plussize + 1, centery, NULL);
|
||||
|
@ -2436,6 +2453,9 @@ TREEVIEW_DrawItemLines(const TREEVIEW_INFO *infoPtr, HDC hdc, const TREEVIEW_ITE
|
|||
SetPixel(hdc, centerx + 1, centery, clrBk);
|
||||
}
|
||||
}
|
||||
|
||||
SelectObject(hdc, old_pen);
|
||||
DeleteObject(new_pen);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2473,22 +2493,16 @@ TREEVIEW_DrawItem(const TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *wineItem
|
|||
else
|
||||
{
|
||||
nmcdhdr.clrTextBk = comctl32_color.clrBtnFace;
|
||||
if (infoPtr->clrText == -1)
|
||||
nmcdhdr.clrText = comctl32_color.clrWindowText;
|
||||
else
|
||||
nmcdhdr.clrText = infoPtr->clrText;
|
||||
nmcdhdr.clrText = GETTXTCOLOR(infoPtr->clrText);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
nmcdhdr.clrTextBk = infoPtr->clrBk == -1 ? comctl32_color.clrWindow:
|
||||
infoPtr->clrBk;
|
||||
nmcdhdr.clrTextBk = GETBKCOLOR(infoPtr->clrBk);
|
||||
if ((infoPtr->dwStyle & TVS_TRACKSELECT) && (wineItem == infoPtr->hotItem))
|
||||
nmcdhdr.clrText = comctl32_color.clrHighlight;
|
||||
else if (infoPtr->clrText == -1)
|
||||
nmcdhdr.clrText = comctl32_color.clrWindowText;
|
||||
else
|
||||
nmcdhdr.clrText = infoPtr->clrText;
|
||||
nmcdhdr.clrText = GETTXTCOLOR(infoPtr->clrText);
|
||||
}
|
||||
|
||||
hOldFont = SelectObject(hdc, TREEVIEW_FontForItem(infoPtr, wineItem));
|
||||
|
@ -2620,7 +2634,7 @@ TREEVIEW_DrawItem(const TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *wineItem
|
|||
int offset;
|
||||
int left, right;
|
||||
|
||||
hNewPen = CreatePen(PS_SOLID, 2, infoPtr->clrInsertMark);
|
||||
hNewPen = CreatePen(PS_SOLID, 2, GETINSCOLOR(infoPtr->clrInsertMark));
|
||||
hOldPen = SelectObject(hdc, hNewPen);
|
||||
|
||||
if (infoPtr->insertBeforeorAfter)
|
||||
|
@ -2788,19 +2802,27 @@ TREEVIEW_UpdateScrollBars(TREEVIEW_INFO *infoPtr)
|
|||
infoPtr->uInternalStatus &= ~TV_HSCROLL;
|
||||
}
|
||||
|
||||
/* CtrlSpy doesn't mention this, but CorelDRAW's object manager needs it. */
|
||||
static LRESULT
|
||||
TREEVIEW_EraseBackground(const TREEVIEW_INFO *infoPtr, HDC hDC)
|
||||
static void
|
||||
TREEVIEW_FillBkgnd(const TREEVIEW_INFO *infoPtr, HDC hdc, const RECT *rc)
|
||||
{
|
||||
HBRUSH hBrush;
|
||||
COLORREF clrBk = infoPtr->clrBk == -1 ? comctl32_color.clrWindow:
|
||||
infoPtr->clrBk;
|
||||
RECT rect;
|
||||
COLORREF clrBk = GETBKCOLOR(infoPtr->clrBk);
|
||||
|
||||
hBrush = CreateSolidBrush(clrBk);
|
||||
GetClientRect(infoPtr->hwnd, &rect);
|
||||
FillRect(hDC, &rect, hBrush);
|
||||
FillRect(hdc, rc, hBrush);
|
||||
DeleteObject(hBrush);
|
||||
}
|
||||
|
||||
/* CtrlSpy doesn't mention this, but CorelDRAW's object manager needs it. */
|
||||
static LRESULT
|
||||
TREEVIEW_EraseBackground(const TREEVIEW_INFO *infoPtr, HDC hdc)
|
||||
{
|
||||
RECT rect;
|
||||
|
||||
TRACE("%p\n", infoPtr);
|
||||
|
||||
GetClientRect(infoPtr->hwnd, &rect);
|
||||
TREEVIEW_FillBkgnd(infoPtr, hdc, &rect);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -2843,29 +2865,30 @@ TREEVIEW_Refresh(TREEVIEW_INFO *infoPtr, HDC hdc, const RECT *rc)
|
|||
}
|
||||
}
|
||||
|
||||
//
|
||||
// This is correct, but is causes and infinite loop of WM_PAINT messages, resulting
|
||||
// in continuous painting of the scroll bar in reactos. Comment out until the real
|
||||
// bug is found
|
||||
//
|
||||
//TREEVIEW_UpdateScrollBars(infoPtr);
|
||||
TREEVIEW_UpdateScrollBars(infoPtr);
|
||||
|
||||
if (infoPtr->cdmode & CDRF_NOTIFYPOSTPAINT)
|
||||
infoPtr->cdmode =
|
||||
TREEVIEW_SendCustomDrawNotify(infoPtr, CDDS_POSTPAINT, hdc, rect);
|
||||
}
|
||||
|
||||
static inline void
|
||||
TREEVIEW_InvalidateItem(const TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *item)
|
||||
{
|
||||
if (item) InvalidateRect(infoPtr->hwnd, &item->rect, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
TREEVIEW_Invalidate(const TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *item)
|
||||
{
|
||||
if (item != NULL)
|
||||
if (item)
|
||||
InvalidateRect(infoPtr->hwnd, &item->rect, TRUE);
|
||||
else
|
||||
InvalidateRect(infoPtr->hwnd, NULL, TRUE);
|
||||
}
|
||||
|
||||
static LRESULT
|
||||
TREEVIEW_Paint(TREEVIEW_INFO *infoPtr, WPARAM wParam)
|
||||
TREEVIEW_Paint(TREEVIEW_INFO *infoPtr, HDC hdc_ref)
|
||||
{
|
||||
HDC hdc;
|
||||
PAINTSTRUCT ps;
|
||||
|
@ -2873,27 +2896,48 @@ TREEVIEW_Paint(TREEVIEW_INFO *infoPtr, WPARAM wParam)
|
|||
|
||||
TRACE("\n");
|
||||
|
||||
if (wParam)
|
||||
if (hdc_ref)
|
||||
{
|
||||
hdc = (HDC)wParam;
|
||||
GetClientRect(infoPtr->hwnd, &rc);
|
||||
TREEVIEW_EraseBackground(infoPtr, hdc);
|
||||
hdc = hdc_ref;
|
||||
GetClientRect(infoPtr->hwnd, &rc);
|
||||
}
|
||||
else
|
||||
{
|
||||
hdc = BeginPaint(infoPtr->hwnd, &ps);
|
||||
rc = ps.rcPaint;
|
||||
rc = ps.rcPaint;
|
||||
if(ps.fErase)
|
||||
TREEVIEW_FillBkgnd(infoPtr, hdc, &rc);
|
||||
}
|
||||
|
||||
if(infoPtr->bRedraw) /* WM_SETREDRAW sets bRedraw */
|
||||
TREEVIEW_Refresh(infoPtr, hdc, &rc);
|
||||
|
||||
if (!wParam)
|
||||
if (!hdc_ref)
|
||||
EndPaint(infoPtr->hwnd, &ps);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static LRESULT
|
||||
TREEVIEW_PrintClient(TREEVIEW_INFO *infoPtr, HDC hdc, DWORD options)
|
||||
{
|
||||
FIXME("Partial Stub: (hdc=%p options=0x%08x)\n", hdc, options);
|
||||
|
||||
if ((options & PRF_CHECKVISIBLE) && !IsWindowVisible(infoPtr->hwnd))
|
||||
return 0;
|
||||
|
||||
if (options & PRF_ERASEBKGND)
|
||||
TREEVIEW_EraseBackground(infoPtr, hdc);
|
||||
|
||||
if (options & PRF_CLIENT)
|
||||
{
|
||||
RECT rc;
|
||||
GetClientRect(infoPtr->hwnd, &rc);
|
||||
TREEVIEW_Refresh(infoPtr, hdc, &rc);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Sorting **************************************************************/
|
||||
|
||||
|
@ -3564,12 +3608,12 @@ TREEVIEW_Edit_SubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
return DLGC_WANTARROWS | DLGC_WANTALLKEYS;
|
||||
|
||||
case WM_KEYDOWN:
|
||||
if (wParam == (WPARAM)VK_ESCAPE)
|
||||
if (wParam == VK_ESCAPE)
|
||||
{
|
||||
bCancel = TRUE;
|
||||
break;
|
||||
}
|
||||
else if (wParam == (WPARAM)VK_RETURN)
|
||||
else if (wParam == VK_RETURN)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
@ -3679,7 +3723,6 @@ TREEVIEW_EditLabel(TREEVIEW_INFO *infoPtr, HTREEITEM hItem)
|
|||
HDC hdc;
|
||||
HFONT hOldFont=0;
|
||||
TEXTMETRICW textMetric;
|
||||
static const WCHAR EditW[] = {'E','d','i','t',0};
|
||||
|
||||
TRACE("%p %p\n", hwnd, hItem);
|
||||
if (!TREEVIEW_ValidItem(infoPtr, hItem))
|
||||
|
@ -3726,7 +3769,7 @@ TREEVIEW_EditLabel(TREEVIEW_INFO *infoPtr, HTREEITEM hItem)
|
|||
infoPtr->editItem = hItem;
|
||||
|
||||
hwndEdit = CreateWindowExW(WS_EX_LEFT,
|
||||
EditW,
|
||||
WC_EDITW,
|
||||
0,
|
||||
WS_CHILD | WS_BORDER | ES_AUTOHSCROLL |
|
||||
WS_CLIPSIBLINGS | ES_WANTRETURN |
|
||||
|
@ -4003,7 +4046,6 @@ TREEVIEW_LButtonDown(TREEVIEW_INFO *infoPtr, LPARAM lParam)
|
|||
HWND hwnd = infoPtr->hwnd;
|
||||
TVHITTESTINFO ht;
|
||||
BOOL bTrack, bDoLabelEdit;
|
||||
HTREEITEM tempItem;
|
||||
|
||||
/* If Edit control is active - kill it and return.
|
||||
* The best way to do it is to set focus to itself.
|
||||
|
@ -4026,10 +4068,8 @@ TREEVIEW_LButtonDown(TREEVIEW_INFO *infoPtr, LPARAM lParam)
|
|||
if(ht.hItem && (ht.flags & TVHT_ONITEM))
|
||||
{
|
||||
infoPtr->focusedItem = ht.hItem;
|
||||
InvalidateRect(hwnd, &ht.hItem->rect, TRUE);
|
||||
|
||||
if(infoPtr->selectedItem)
|
||||
InvalidateRect(hwnd, &(infoPtr->selectedItem->rect), TRUE);
|
||||
TREEVIEW_InvalidateItem(infoPtr, infoPtr->focusedItem);
|
||||
TREEVIEW_InvalidateItem(infoPtr, infoPtr->selectedItem);
|
||||
}
|
||||
|
||||
bTrack = (ht.flags & TVHT_ONITEM)
|
||||
|
@ -4063,12 +4103,11 @@ TREEVIEW_LButtonDown(TREEVIEW_INFO *infoPtr, LPARAM lParam)
|
|||
if(infoPtr->focusedItem)
|
||||
{
|
||||
/* refresh the item that was focused */
|
||||
tempItem = infoPtr->focusedItem;
|
||||
infoPtr->focusedItem = 0;
|
||||
InvalidateRect(infoPtr->hwnd, &tempItem->rect, TRUE);
|
||||
TREEVIEW_InvalidateItem(infoPtr, infoPtr->focusedItem);
|
||||
infoPtr->focusedItem = NULL;
|
||||
|
||||
/* refresh the selected item to return the filled background */
|
||||
InvalidateRect(infoPtr->hwnd, &(infoPtr->selectedItem->rect), TRUE);
|
||||
TREEVIEW_InvalidateItem(infoPtr, infoPtr->selectedItem);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -4288,7 +4327,6 @@ TREEVIEW_DoSelectItem(TREEVIEW_INFO *infoPtr, INT action, HTREEITEM newSelect,
|
|||
INT cause)
|
||||
{
|
||||
TREEVIEW_ITEM *prevSelect;
|
||||
RECT rcFocused;
|
||||
|
||||
assert(newSelect == NULL || TREEVIEW_ValidItem(infoPtr, newSelect));
|
||||
|
||||
|
@ -4298,12 +4336,8 @@ TREEVIEW_DoSelectItem(TREEVIEW_INFO *infoPtr, INT action, HTREEITEM newSelect,
|
|||
|
||||
/* reset and redraw focusedItem if focusedItem was set so we don't */
|
||||
/* have to worry about the previously focused item when we set a new one */
|
||||
if(infoPtr->focusedItem)
|
||||
{
|
||||
rcFocused = (infoPtr->focusedItem)->rect;
|
||||
infoPtr->focusedItem = 0;
|
||||
InvalidateRect(infoPtr->hwnd, &rcFocused, TRUE);
|
||||
}
|
||||
TREEVIEW_InvalidateItem(infoPtr, infoPtr->focusedItem);
|
||||
infoPtr->focusedItem = NULL;
|
||||
|
||||
switch (action)
|
||||
{
|
||||
|
@ -4332,10 +4366,8 @@ TREEVIEW_DoSelectItem(TREEVIEW_INFO *infoPtr, INT action, HTREEITEM newSelect,
|
|||
|
||||
TREEVIEW_EnsureVisible(infoPtr, infoPtr->selectedItem, FALSE);
|
||||
|
||||
if (prevSelect)
|
||||
TREEVIEW_Invalidate(infoPtr, prevSelect);
|
||||
if (newSelect)
|
||||
TREEVIEW_Invalidate(infoPtr, newSelect);
|
||||
TREEVIEW_InvalidateItem(infoPtr, prevSelect);
|
||||
TREEVIEW_InvalidateItem(infoPtr, newSelect);
|
||||
|
||||
TREEVIEW_SendTreeviewNotify(infoPtr,
|
||||
TVN_SELCHANGEDW,
|
||||
|
@ -4428,13 +4460,8 @@ TREEVIEW_SelectItem(TREEVIEW_INFO *infoPtr, INT wParam, HTREEITEM item)
|
|||
*
|
||||
* TREEVIEW_ProcessLetterKeys
|
||||
*/
|
||||
static INT TREEVIEW_ProcessLetterKeys(
|
||||
HWND hwnd, /* handle to the window */
|
||||
WPARAM charCode, /* the character code, the actual character */
|
||||
LPARAM keyData /* key data */
|
||||
)
|
||||
static INT TREEVIEW_ProcessLetterKeys(TREEVIEW_INFO *infoPtr, WPARAM charCode, LPARAM keyData)
|
||||
{
|
||||
TREEVIEW_INFO *infoPtr;
|
||||
HTREEITEM nItem;
|
||||
HTREEITEM endidx,idx;
|
||||
TVITEMEXW item;
|
||||
|
@ -4442,12 +4469,7 @@ static INT TREEVIEW_ProcessLetterKeys(
|
|||
DWORD timestamp,elapsed;
|
||||
|
||||
/* simple parameter checking */
|
||||
if (!hwnd || !charCode || !keyData)
|
||||
return 0;
|
||||
|
||||
infoPtr=(TREEVIEW_INFO*)GetWindowLongPtrW(hwnd, 0);
|
||||
if (!infoPtr)
|
||||
return 0;
|
||||
if (!charCode || !keyData) return 0;
|
||||
|
||||
/* only allow the valid WM_CHARs through */
|
||||
if (!isalnum(charCode) &&
|
||||
|
@ -4856,11 +4878,14 @@ scroll:
|
|||
}
|
||||
|
||||
static LRESULT
|
||||
TREEVIEW_MouseWheel(TREEVIEW_INFO *infoPtr, WPARAM wParam)
|
||||
TREEVIEW_MouseWheel(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
short gcWheelDelta;
|
||||
UINT pulScrollLines = 3;
|
||||
|
||||
if (wParam & (MK_SHIFT | MK_CONTROL))
|
||||
return DefWindowProcW(infoPtr->hwnd, WM_MOUSEWHEEL, wParam, lParam);
|
||||
|
||||
if (infoPtr->firstVisible == NULL)
|
||||
return TRUE;
|
||||
|
||||
|
@ -4978,10 +5003,10 @@ TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
|
|||
|
||||
infoPtr->scrollX = 0;
|
||||
|
||||
infoPtr->clrBk = -1; /* use system color */
|
||||
infoPtr->clrText = -1; /* use system color */
|
||||
infoPtr->clrLine = RGB(128, 128, 128);
|
||||
infoPtr->clrInsertMark = comctl32_color.clrBtnText;
|
||||
infoPtr->clrBk = CLR_NONE; /* use system color */
|
||||
infoPtr->clrText = CLR_NONE; /* use system color */
|
||||
infoPtr->clrLine = CLR_DEFAULT;
|
||||
infoPtr->clrInsertMark = CLR_DEFAULT;
|
||||
|
||||
/* hwndToolTip */
|
||||
|
||||
|
@ -5048,7 +5073,11 @@ TREEVIEW_Destroy(TREEVIEW_INFO *infoPtr)
|
|||
{
|
||||
TRACE("\n");
|
||||
|
||||
/* free item data */
|
||||
TREEVIEW_RemoveTree(infoPtr);
|
||||
/* root isn't freed with other items */
|
||||
TREEVIEW_FreeItem(infoPtr, infoPtr->root);
|
||||
DPA_Destroy(infoPtr->items);
|
||||
|
||||
/* tool tip is automatically destroyed: we are its owner */
|
||||
|
||||
|
@ -5236,12 +5265,10 @@ TREEVIEW_KeyDown(TREEVIEW_INFO *infoPtr, WPARAM wParam)
|
|||
static LRESULT
|
||||
TREEVIEW_MouseLeave (TREEVIEW_INFO * infoPtr)
|
||||
{
|
||||
if (infoPtr->hotItem)
|
||||
{
|
||||
/* remove hot effect from item */
|
||||
InvalidateRect(infoPtr->hwnd, &infoPtr->hotItem->rect, TRUE);
|
||||
infoPtr->hotItem = NULL;
|
||||
}
|
||||
/* remove hot effect from item */
|
||||
TREEVIEW_InvalidateItem(infoPtr, infoPtr->hotItem);
|
||||
infoPtr->hotItem = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -5252,11 +5279,12 @@ TREEVIEW_MouseMove (TREEVIEW_INFO * infoPtr, LPARAM lParam)
|
|||
TRACKMOUSEEVENT trackinfo;
|
||||
TREEVIEW_ITEM * item;
|
||||
|
||||
if (!(infoPtr->dwStyle & TVS_TRACKSELECT)) return 0;
|
||||
|
||||
/* fill in the TRACKMOUSEEVENT struct */
|
||||
trackinfo.cbSize = sizeof(TRACKMOUSEEVENT);
|
||||
trackinfo.dwFlags = TME_QUERY;
|
||||
trackinfo.hwndTrack = infoPtr->hwnd;
|
||||
trackinfo.dwHoverTime = HOVER_DEFAULT;
|
||||
|
||||
/* call _TrackMouseEvent to see if we are currently tracking for this hwnd */
|
||||
_TrackMouseEvent(&trackinfo);
|
||||
|
@ -5265,6 +5293,9 @@ TREEVIEW_MouseMove (TREEVIEW_INFO * infoPtr, LPARAM lParam)
|
|||
if(!(trackinfo.dwFlags & TME_LEAVE))
|
||||
{
|
||||
trackinfo.dwFlags = TME_LEAVE; /* notify upon leaving */
|
||||
trackinfo.hwndTrack = infoPtr->hwnd;
|
||||
/* do it as fast as possible, minimal systimer latency will be used */
|
||||
trackinfo.dwHoverTime = 1;
|
||||
|
||||
/* call TRACKMOUSEEVENT so we receive a WM_MOUSELEAVE message */
|
||||
/* and can properly deactivate the hot item */
|
||||
|
@ -5279,19 +5310,17 @@ TREEVIEW_MouseMove (TREEVIEW_INFO * infoPtr, LPARAM lParam)
|
|||
if (item != infoPtr->hotItem)
|
||||
{
|
||||
/* redraw old hot item */
|
||||
if (infoPtr->hotItem)
|
||||
InvalidateRect(infoPtr->hwnd, &infoPtr->hotItem->rect, TRUE);
|
||||
TREEVIEW_InvalidateItem(infoPtr, infoPtr->hotItem);
|
||||
infoPtr->hotItem = item;
|
||||
/* redraw new hot item */
|
||||
if (infoPtr->hotItem)
|
||||
InvalidateRect(infoPtr->hwnd, &infoPtr->hotItem->rect, TRUE);
|
||||
TREEVIEW_InvalidateItem(infoPtr, infoPtr->hotItem);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Draw themed border */
|
||||
static BOOL nc_paint (const TREEVIEW_INFO *infoPtr, HRGN region)
|
||||
static BOOL TREEVIEW_NCPaint (const TREEVIEW_INFO *infoPtr, HRGN region, LPARAM lParam)
|
||||
{
|
||||
HTHEME theme = GetWindowTheme (infoPtr->hwnd);
|
||||
HDC dc;
|
||||
|
@ -5300,7 +5329,8 @@ static BOOL nc_paint (const TREEVIEW_INFO *infoPtr, HRGN region)
|
|||
int cxEdge = GetSystemMetrics (SM_CXEDGE),
|
||||
cyEdge = GetSystemMetrics (SM_CYEDGE);
|
||||
|
||||
if (!theme) return FALSE;
|
||||
if (!theme)
|
||||
return DefWindowProcW (infoPtr->hwnd, WM_NCPAINT, (WPARAM)region, lParam);
|
||||
|
||||
GetWindowRect(infoPtr->hwnd, &r);
|
||||
|
||||
|
@ -5347,24 +5377,6 @@ TREEVIEW_Notify(const TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
|||
return DefWindowProcW(infoPtr->hwnd, WM_NOTIFY, wParam, lParam);
|
||||
}
|
||||
|
||||
static INT TREEVIEW_NotifyFormat (TREEVIEW_INFO *infoPtr, HWND hwndFrom, UINT nCommand)
|
||||
{
|
||||
INT format;
|
||||
|
||||
TRACE("(hwndFrom=%p, nCommand=%d)\n", hwndFrom, nCommand);
|
||||
|
||||
if (nCommand != NF_REQUERY) return 0;
|
||||
|
||||
format = SendMessageW(hwndFrom, WM_NOTIFYFORMAT, (WPARAM)infoPtr->hwnd, NF_QUERY);
|
||||
TRACE("format=%d\n", format);
|
||||
|
||||
if (format != NFR_ANSI && format != NFR_UNICODE) return 0;
|
||||
|
||||
infoPtr->bNtfUnicode = (format == NFR_UNICODE);
|
||||
|
||||
return format;
|
||||
}
|
||||
|
||||
static LRESULT
|
||||
TREEVIEW_Size(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
|
@ -5438,13 +5450,27 @@ TREEVIEW_SetCursor(const TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
|||
{
|
||||
POINT pt;
|
||||
TREEVIEW_ITEM * item;
|
||||
NMMOUSE nmmouse;
|
||||
|
||||
GetCursorPos(&pt);
|
||||
ScreenToClient(infoPtr->hwnd, &pt);
|
||||
|
||||
item = TREEVIEW_HitTestPoint(infoPtr, pt);
|
||||
|
||||
/* FIXME: send NM_SETCURSOR */
|
||||
memset(&nmmouse, 0, sizeof(nmmouse));
|
||||
nmmouse.hdr.hwndFrom = infoPtr->hwnd;
|
||||
nmmouse.hdr.idFrom = GetWindowLongPtrW(infoPtr->hwnd, GWLP_ID);
|
||||
nmmouse.hdr.code = NM_SETCURSOR;
|
||||
if (item)
|
||||
{
|
||||
nmmouse.dwItemSpec = (DWORD_PTR)item;
|
||||
nmmouse.dwItemData = item->lParam;
|
||||
}
|
||||
nmmouse.pt.x = 0;
|
||||
nmmouse.pt.y = 0;
|
||||
nmmouse.dwHitInfo = lParam;
|
||||
if (TREEVIEW_SendRealNotify(infoPtr, nmmouse.hdr.idFrom, (LPARAM)&nmmouse))
|
||||
return 0;
|
||||
|
||||
if (item && (infoPtr->dwStyle & TVS_TRACKSELECT))
|
||||
{
|
||||
|
@ -5483,7 +5509,7 @@ TREEVIEW_KillFocus(const TREEVIEW_INFO *infoPtr)
|
|||
}
|
||||
|
||||
/* update theme after a WM_THEMECHANGED message */
|
||||
static LRESULT theme_changed(const TREEVIEW_INFO *infoPtr)
|
||||
static LRESULT TREEVIEW_ThemeChanged(const TREEVIEW_INFO *infoPtr)
|
||||
{
|
||||
HTHEME theme = GetWindowTheme (infoPtr->hwnd);
|
||||
CloseThemeData (theme);
|
||||
|
@ -5517,8 +5543,6 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
return TREEVIEW_DeleteItem(infoPtr, (HTREEITEM)lParam);
|
||||
|
||||
case TVM_EDITLABELA:
|
||||
return (LRESULT)TREEVIEW_EditLabel(infoPtr, (HTREEITEM)lParam);
|
||||
|
||||
case TVM_EDITLABELW:
|
||||
return (LRESULT)TREEVIEW_EditLabel(infoPtr, (HTREEITEM)lParam);
|
||||
|
||||
|
@ -5558,11 +5582,9 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
return 0;
|
||||
|
||||
case TVM_GETITEMA:
|
||||
return TREEVIEW_GetItemT(infoPtr, (LPTVITEMEXW)lParam, FALSE);
|
||||
|
||||
case TVM_GETITEMW:
|
||||
return TREEVIEW_GetItemT(infoPtr, (LPTVITEMEXW)lParam, TRUE);
|
||||
|
||||
return TREEVIEW_GetItemT(infoPtr, (LPTVITEMEXW)lParam,
|
||||
uMsg == TVM_GETITEMW);
|
||||
case TVM_GETITEMHEIGHT:
|
||||
return TREEVIEW_GetItemHeight(infoPtr);
|
||||
|
||||
|
@ -5597,11 +5619,9 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
return TREEVIEW_HitTest(infoPtr, (LPTVHITTESTINFO)lParam);
|
||||
|
||||
case TVM_INSERTITEMA:
|
||||
return TREEVIEW_InsertItemT(infoPtr, (LPTVINSERTSTRUCTW)lParam, FALSE);
|
||||
|
||||
case TVM_INSERTITEMW:
|
||||
return TREEVIEW_InsertItemT(infoPtr, (LPTVINSERTSTRUCTW)lParam, TRUE);
|
||||
|
||||
return TREEVIEW_InsertItemT(infoPtr, (LPTVINSERTSTRUCTW)lParam,
|
||||
uMsg == TVM_INSERTITEMW);
|
||||
case TVM_SELECTITEM:
|
||||
return TREEVIEW_SelectItem(infoPtr, (INT)wParam, (HTREEITEM)lParam);
|
||||
|
||||
|
@ -5621,11 +5641,9 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
return TREEVIEW_SetInsertMarkColor(infoPtr, (COLORREF)lParam);
|
||||
|
||||
case TVM_SETITEMA:
|
||||
return TREEVIEW_SetItemT(infoPtr, (LPTVITEMEXW)lParam, FALSE);
|
||||
|
||||
case TVM_SETITEMW:
|
||||
return TREEVIEW_SetItemT(infoPtr, (LPTVITEMEXW)lParam, TRUE);
|
||||
|
||||
return TREEVIEW_SetItemT(infoPtr, (LPTVITEMEXW)lParam,
|
||||
uMsg == TVM_SETITEMW);
|
||||
case TVM_SETLINECOLOR:
|
||||
return TREEVIEW_SetLineColor(infoPtr, (COLORREF)lParam);
|
||||
|
||||
|
@ -5651,7 +5669,7 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
return TREEVIEW_SortChildrenCB(infoPtr, (LPTVSORTCB)lParam);
|
||||
|
||||
case WM_CHAR:
|
||||
return TREEVIEW_ProcessLetterKeys( hwnd, wParam, lParam );
|
||||
return TREEVIEW_ProcessLetterKeys(infoPtr, wParam, lParam);
|
||||
|
||||
case WM_COMMAND:
|
||||
return TREEVIEW_Command(infoPtr, wParam, lParam);
|
||||
|
@ -5691,10 +5709,7 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
return TREEVIEW_MouseLeave(infoPtr);
|
||||
|
||||
case WM_MOUSEMOVE:
|
||||
if (infoPtr->dwStyle & TVS_TRACKSELECT)
|
||||
return TREEVIEW_MouseMove(infoPtr, lParam);
|
||||
else
|
||||
return 0;
|
||||
return TREEVIEW_MouseMove(infoPtr, lParam);
|
||||
|
||||
case WM_NCLBUTTONDOWN:
|
||||
if (infoPtr->hwndEdit)
|
||||
|
@ -5702,9 +5717,7 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
goto def;
|
||||
|
||||
case WM_NCPAINT:
|
||||
if (nc_paint (infoPtr, (HRGN)wParam))
|
||||
return 0;
|
||||
goto def;
|
||||
return TREEVIEW_NCPaint (infoPtr, (HRGN)wParam, lParam);
|
||||
|
||||
case WM_NOTIFY:
|
||||
return TREEVIEW_Notify(infoPtr, wParam, lParam);
|
||||
|
@ -5713,8 +5726,10 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
return TREEVIEW_NotifyFormat(infoPtr, (HWND)wParam, (UINT)lParam);
|
||||
|
||||
case WM_PRINTCLIENT:
|
||||
return TREEVIEW_PrintClient(infoPtr, (HDC)wParam, lParam);
|
||||
|
||||
case WM_PAINT:
|
||||
return TREEVIEW_Paint(infoPtr, wParam);
|
||||
return TREEVIEW_Paint(infoPtr, (HDC)wParam);
|
||||
|
||||
case WM_RBUTTONDOWN:
|
||||
return TREEVIEW_RButtonDown(infoPtr, lParam);
|
||||
|
@ -5747,7 +5762,7 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
return TREEVIEW_HandleTimer(infoPtr, wParam);
|
||||
|
||||
case WM_THEMECHANGED:
|
||||
return theme_changed (infoPtr);
|
||||
return TREEVIEW_ThemeChanged (infoPtr);
|
||||
|
||||
case WM_VSCROLL:
|
||||
return TREEVIEW_VScroll(infoPtr, wParam);
|
||||
|
@ -5755,9 +5770,7 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
/* WM_WININICHANGE */
|
||||
|
||||
case WM_MOUSEWHEEL:
|
||||
if (wParam & (MK_SHIFT | MK_CONTROL))
|
||||
goto def;
|
||||
return TREEVIEW_MouseWheel(infoPtr, wParam);
|
||||
return TREEVIEW_MouseWheel(infoPtr, wParam, lParam);
|
||||
|
||||
case WM_DRAWITEM:
|
||||
TRACE("drawItem\n");
|
||||
|
|
|
@ -71,7 +71,7 @@ typedef struct
|
|||
#define AUTOPRESS_DELAY 250 /* time to keep arrow pressed on KEY_DOWN */
|
||||
#define REPEAT_DELAY 50 /* delay between auto-increments */
|
||||
|
||||
#define DEFAULT_WIDTH 14 /* default width of the ctrl */
|
||||
#define DEFAULT_WIDTH 16 /* default width of the ctrl */
|
||||
#define DEFAULT_XSEP 0 /* default separation between buddy and ctrl */
|
||||
#define DEFAULT_ADDTOP 0 /* amount to extend above the buddy window */
|
||||
#define DEFAULT_ADDBOT 0 /* amount to extend below the buddy window */
|
||||
|
@ -100,9 +100,9 @@ typedef struct
|
|||
#define UPDOWN_GetInfoPtr(hwnd) ((UPDOWN_INFO *)GetWindowLongPtrW (hwnd,0))
|
||||
#define COUNT_OF(a) (sizeof(a)/sizeof(a[0]))
|
||||
|
||||
static const WCHAR BUDDY_UPDOWN_HWND[] = { 'b', 'u', 'd', 'd', 'y', 'U', 'p', 'D', 'o', 'w', 'n', 'H', 'W', 'N', 'D', 0 };
|
||||
static const WCHAR BUDDY_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 };
|
||||
/* id used for SetWindowSubclass */
|
||||
#define BUDDY_SUBCLASSID 1
|
||||
|
||||
static void UPDOWN_DoAction (UPDOWN_INFO *infoPtr, int delta, int action);
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -200,7 +200,7 @@ static void UPDOWN_GetArrowRect (const UPDOWN_INFO* infoPtr, RECT *rect, int arr
|
|||
/* now figure out if we need a space away from the buddy */
|
||||
if (IsWindow(infoPtr->Buddy) ) {
|
||||
if (infoPtr->dwStyle & UDS_ALIGNLEFT) rect->right -= spacer;
|
||||
else rect->left += spacer;
|
||||
else if (infoPtr->dwStyle & UDS_ALIGNRIGHT) rect->left += spacer;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -309,8 +309,10 @@ static BOOL UPDOWN_GetBuddyInt (UPDOWN_INFO *infoPtr)
|
|||
*/
|
||||
static BOOL UPDOWN_SetBuddyInt (const UPDOWN_INFO *infoPtr)
|
||||
{
|
||||
WCHAR fmt[3] = { '%', 'd', '\0' };
|
||||
WCHAR txt[20];
|
||||
static const WCHAR fmt_hex[] = { '0', 'x', '%', '0', '4', 'X', 0 };
|
||||
static const WCHAR fmt_dec_oct[] = { '%', 'd', '\0' };
|
||||
const WCHAR *fmt;
|
||||
WCHAR txt[20], txt_old[20] = { 0 };
|
||||
int len;
|
||||
|
||||
if (!((infoPtr->Flags & FLAG_BUDDYINT) && IsWindow(infoPtr->Buddy)))
|
||||
|
@ -324,7 +326,7 @@ static BOOL UPDOWN_SetBuddyInt (const UPDOWN_INFO *infoPtr)
|
|||
}
|
||||
|
||||
/* Regular window, so set caption to the number */
|
||||
if (infoPtr->Base == 16) fmt[1] = 'X';
|
||||
fmt = (infoPtr->Base == 16) ? fmt_hex : fmt_dec_oct;
|
||||
len = wsprintfW(txt, fmt, infoPtr->CurVal);
|
||||
|
||||
|
||||
|
@ -345,6 +347,10 @@ static BOOL UPDOWN_SetBuddyInt (const UPDOWN_INFO *infoPtr)
|
|||
*dst = 0;
|
||||
}
|
||||
|
||||
/* if nothing changed exit earlier */
|
||||
GetWindowTextW(infoPtr->Buddy, txt_old, sizeof(txt_old)/sizeof(WCHAR));
|
||||
if (lstrcmpiW(txt_old, txt) == 0) return 0;
|
||||
|
||||
return SetWindowTextW(infoPtr->Buddy, txt);
|
||||
}
|
||||
|
||||
|
@ -455,7 +461,7 @@ static LRESULT UPDOWN_Paint (const UPDOWN_INFO *infoPtr, HDC hdc)
|
|||
*/
|
||||
static LRESULT UPDOWN_KeyPressed(UPDOWN_INFO *infoPtr, int key)
|
||||
{
|
||||
int arrow;
|
||||
int arrow, accel;
|
||||
|
||||
if (key == VK_UP) arrow = FLAG_INCR;
|
||||
else if (key == VK_DOWN) arrow = FLAG_DECR;
|
||||
|
@ -466,7 +472,8 @@ static LRESULT UPDOWN_KeyPressed(UPDOWN_INFO *infoPtr, int key)
|
|||
infoPtr->Flags |= FLAG_PRESSED | arrow;
|
||||
InvalidateRect (infoPtr->Self, NULL, FALSE);
|
||||
SetTimer(infoPtr->Self, TIMER_AUTOPRESS, AUTOPRESS_DELAY, 0);
|
||||
UPDOWN_DoAction (infoPtr, 1, arrow);
|
||||
accel = (infoPtr->AccelCount && infoPtr->AccelVect) ? infoPtr->AccelVect[0].nInc : 1;
|
||||
UPDOWN_DoAction (infoPtr, accel, arrow);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -518,14 +525,13 @@ static LRESULT UPDOWN_MouseWheel(UPDOWN_INFO *infoPtr, WPARAM wParam)
|
|||
* control.
|
||||
*/
|
||||
static LRESULT CALLBACK
|
||||
UPDOWN_Buddy_SubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
UPDOWN_Buddy_SubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
|
||||
UINT_PTR uId, DWORD_PTR ref_data)
|
||||
{
|
||||
WNDPROC superClassWndProc = (WNDPROC)GetPropW(hwnd, BUDDY_SUPERCLASS_WNDPROC);
|
||||
HWND upDownHwnd = GetPropW(hwnd, BUDDY_UPDOWN_HWND);
|
||||
UPDOWN_INFO *infoPtr = UPDOWN_GetInfoPtr(upDownHwnd);
|
||||
UPDOWN_INFO *infoPtr = UPDOWN_GetInfoPtr((HWND)ref_data);
|
||||
|
||||
TRACE("hwnd=%p, wndProc=%p, uMsg=%04x, wParam=%08lx, lParam=%08lx\n",
|
||||
hwnd, superClassWndProc, uMsg, wParam, lParam);
|
||||
TRACE("hwnd=%p, uMsg=%04x, wParam=%08lx, lParam=%08lx\n",
|
||||
hwnd, uMsg, wParam, lParam);
|
||||
|
||||
switch(uMsg)
|
||||
{
|
||||
|
@ -542,7 +548,7 @@ UPDOWN_Buddy_SubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
break;
|
||||
}
|
||||
|
||||
return CallWindowProcW( superClassWndProc, hwnd, uMsg, wParam, lParam);
|
||||
return DefSubclassProc(hwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -550,18 +556,15 @@ UPDOWN_Buddy_SubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
*
|
||||
* Sets bud as a new Buddy.
|
||||
* Then, it should subclass the buddy
|
||||
* If window has the UDS_ARROWKEYS, it subcalsses the buddy window to
|
||||
* If window has the UDS_ARROWKEYS, it subclasses the buddy window to
|
||||
* process the UP/DOWN arrow keys.
|
||||
* If window has the UDS_ALIGNLEFT or UDS_ALIGNRIGHT style
|
||||
* the size/pos of the buddy and the control are adjusted accordingly.
|
||||
*/
|
||||
static HWND UPDOWN_SetBuddy (UPDOWN_INFO* infoPtr, HWND bud)
|
||||
{
|
||||
static const WCHAR editW[] = { 'E', 'd', 'i', 't', 0 };
|
||||
static const WCHAR listboxW[] = { 'L', 'i', 's', 't', 'b', 'o', 'x', 0 };
|
||||
RECT budRect; /* new coord for the buddy */
|
||||
int x, width; /* new x position and width for the up-down */
|
||||
WNDPROC baseWndProc;
|
||||
WCHAR buddyClass[40];
|
||||
HWND ret;
|
||||
|
||||
|
@ -569,38 +572,27 @@ static HWND UPDOWN_SetBuddy (UPDOWN_INFO* infoPtr, HWND bud)
|
|||
|
||||
ret = infoPtr->Buddy;
|
||||
|
||||
/* there is already a body assigned */
|
||||
if (infoPtr->Buddy) RemovePropW(infoPtr->Buddy, BUDDY_UPDOWN_HWND);
|
||||
|
||||
if(!IsWindow(bud))
|
||||
bud = 0;
|
||||
/* there is already a buddy assigned */
|
||||
if (infoPtr->Buddy) RemoveWindowSubclass(infoPtr->Buddy, UPDOWN_Buddy_SubclassProc,
|
||||
BUDDY_SUBCLASSID);
|
||||
if (!IsWindow(bud)) bud = NULL;
|
||||
|
||||
/* Store buddy window handle */
|
||||
infoPtr->Buddy = bud;
|
||||
|
||||
if(bud) {
|
||||
|
||||
/* keep upDown ctrl hwnd in a buddy property */
|
||||
SetPropW( bud, BUDDY_UPDOWN_HWND, infoPtr->Self);
|
||||
|
||||
/* Store buddy window class type */
|
||||
infoPtr->BuddyType = BUDDY_TYPE_UNKNOWN;
|
||||
if (GetClassNameW(bud, buddyClass, COUNT_OF(buddyClass))) {
|
||||
if (lstrcmpiW(buddyClass, editW) == 0)
|
||||
if (lstrcmpiW(buddyClass, WC_EDITW) == 0)
|
||||
infoPtr->BuddyType = BUDDY_TYPE_EDIT;
|
||||
else if (lstrcmpiW(buddyClass, listboxW) == 0)
|
||||
else if (lstrcmpiW(buddyClass, WC_LISTBOXW) == 0)
|
||||
infoPtr->BuddyType = BUDDY_TYPE_LISTBOX;
|
||||
}
|
||||
|
||||
if (infoPtr->dwStyle & UDS_ARROWKEYS) {
|
||||
/* Note that I don't clear the BUDDY_SUPERCLASS_WNDPROC property
|
||||
when we reset the upDown ctrl buddy to another buddy because it is not
|
||||
good to break the window proc chain. */
|
||||
if (!GetPropW(bud, BUDDY_SUPERCLASS_WNDPROC)) {
|
||||
baseWndProc = (WNDPROC)SetWindowLongPtrW(bud, GWLP_WNDPROC, (LPARAM)UPDOWN_Buddy_SubclassProc);
|
||||
SetPropW(bud, BUDDY_SUPERCLASS_WNDPROC, baseWndProc);
|
||||
}
|
||||
}
|
||||
if (infoPtr->dwStyle & UDS_ARROWKEYS)
|
||||
SetWindowSubclass(bud, UPDOWN_Buddy_SubclassProc, BUDDY_SUBCLASSID,
|
||||
(DWORD_PTR)infoPtr->Self);
|
||||
|
||||
/* Get the rect of the buddy relative to its parent */
|
||||
GetWindowRect(infoPtr->Buddy, &budRect);
|
||||
|
@ -661,7 +653,7 @@ static HWND UPDOWN_SetBuddy (UPDOWN_INFO* infoPtr, HWND bud)
|
|||
* 'delta' amount according to the 'action' flag which can be a
|
||||
* combination of FLAG_INCR and FLAG_DECR
|
||||
* It notifies the parent as required.
|
||||
* It handles wraping and non-wraping correctly.
|
||||
* It handles wrapping and non-wrapping correctly.
|
||||
* It is assumed that delta>0
|
||||
*/
|
||||
static void UPDOWN_DoAction (UPDOWN_INFO *infoPtr, int delta, int action)
|
||||
|
@ -856,13 +848,16 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
|
|||
switch(message)
|
||||
{
|
||||
case WM_CREATE:
|
||||
{
|
||||
CREATESTRUCTW *pcs = (CREATESTRUCTW*)lParam;
|
||||
|
||||
infoPtr = Alloc (sizeof(UPDOWN_INFO));
|
||||
SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
|
||||
|
||||
/* initialize the info struct */
|
||||
infoPtr->Self = hwnd;
|
||||
infoPtr->Notify = ((LPCREATESTRUCTW)lParam)->hwndParent;
|
||||
infoPtr->dwStyle = ((LPCREATESTRUCTW)lParam)->style;
|
||||
infoPtr->Notify = pcs->hwndParent;
|
||||
infoPtr->dwStyle = pcs->style;
|
||||
infoPtr->AccelCount = 0;
|
||||
infoPtr->AccelVect = 0;
|
||||
infoPtr->AccelIndex = -1;
|
||||
|
@ -874,21 +869,26 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
|
|||
infoPtr->Flags = (infoPtr->dwStyle & UDS_SETBUDDYINT) ? FLAG_BUDDYINT : 0;
|
||||
|
||||
SetWindowLongW (hwnd, GWL_STYLE, infoPtr->dwStyle & ~WS_BORDER);
|
||||
if (!(infoPtr->dwStyle & UDS_HORZ))
|
||||
SetWindowPos (hwnd, NULL, 0, 0, DEFAULT_WIDTH, pcs->cy,
|
||||
SWP_NOOWNERZORDER | SWP_NOZORDER | SWP_NOMOVE);
|
||||
|
||||
/* Do we pick the buddy win ourselves? */
|
||||
if (infoPtr->dwStyle & UDS_AUTOBUDDY)
|
||||
UPDOWN_SetBuddy (infoPtr, GetWindow (hwnd, GW_HWNDPREV));
|
||||
|
||||
OpenThemeData (hwnd, themeClass);
|
||||
OpenThemeData (hwnd, themeClass);
|
||||
|
||||
TRACE("UpDown Ctrl creation, hwnd=%p\n", hwnd);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
Free (infoPtr->AccelVect);
|
||||
|
||||
if(infoPtr->Buddy) RemovePropW(infoPtr->Buddy, BUDDY_UPDOWN_HWND);
|
||||
|
||||
if (infoPtr->Buddy)
|
||||
RemoveWindowSubclass(infoPtr->Buddy, UPDOWN_Buddy_SubclassProc,
|
||||
BUDDY_SUBCLASSID);
|
||||
Free (infoPtr);
|
||||
SetWindowLongPtrW (hwnd, 0, 0);
|
||||
theme = GetWindowTheme (hwnd);
|
||||
|
@ -930,18 +930,18 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
|
|||
|
||||
/* if initial timer, kill it and start the repeat timer */
|
||||
if(wParam == TIMER_AUTOREPEAT) {
|
||||
int temp;
|
||||
INT delay;
|
||||
|
||||
KillTimer(hwnd, TIMER_AUTOREPEAT);
|
||||
/* if no accel info given, used default timer */
|
||||
if(infoPtr->AccelCount==0 || infoPtr->AccelVect==0) {
|
||||
infoPtr->AccelIndex = -1;
|
||||
temp = REPEAT_DELAY;
|
||||
delay = REPEAT_DELAY;
|
||||
} else {
|
||||
infoPtr->AccelIndex = 0; /* otherwise, use it */
|
||||
temp = infoPtr->AccelVect[infoPtr->AccelIndex].nSec * 1000 + 1;
|
||||
delay = infoPtr->AccelVect[infoPtr->AccelIndex].nSec * 1000 + 1;
|
||||
}
|
||||
SetTimer(hwnd, TIMER_ACCEL, temp, 0);
|
||||
SetTimer(hwnd, TIMER_ACCEL, delay, 0);
|
||||
}
|
||||
|
||||
/* now, if the mouse is above us, do the thing...*/
|
||||
|
@ -1011,8 +1011,6 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
|
|||
|
||||
case UDM_SETACCEL:
|
||||
{
|
||||
unsigned temp;
|
||||
|
||||
TRACE("UDM_SETACCEL\n");
|
||||
|
||||
if(infoPtr->AccelVect) {
|
||||
|
@ -1026,8 +1024,14 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
|
|||
memcpy(infoPtr->AccelVect, (void*)lParam, wParam*sizeof(UDACCEL));
|
||||
infoPtr->AccelCount = wParam;
|
||||
|
||||
for (temp = 0; temp < wParam; temp++)
|
||||
TRACE("%d: nSec %u nInc %u\n", temp, infoPtr->AccelVect[temp].nSec, infoPtr->AccelVect[temp].nInc);
|
||||
if (TRACE_ON(updown))
|
||||
{
|
||||
INT i;
|
||||
|
||||
for (i = 0; i < wParam; i++)
|
||||
TRACE("%d: nSec %u nInc %u\n", i,
|
||||
infoPtr->AccelVect[i].nSec, infoPtr->AccelVect[i].nInc);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue