55#define NONAMELESSUNION
68#include "wine/unicode.h"
144 {
'P',
'r',
'o',
'p',
'e',
'r',
't',
'y',
'S',
'h',
'e',
'e',
't',
'I',
'n',
'f',
'o',0 };
146#define PSP_INTERNAL_UNICODE 0x80000000
148#define MAX_CAPTION_LENGTH 255
149#define MAX_TABTEXT_LENGTH 255
150#define MAX_BUTTONTEXT_LENGTH 64
152#define INTRNL_ANY_WIZARD (PSH_WIZARD | PSH_WIZARD97_OLD | PSH_WIZARD97_NEW | PSH_WIZARD_LITE)
155#define WIZARD_PADDING 7
156#define WIZARD_HEADER_HEIGHT 36
198#define add_flag(a) if (dwFlags & a) {strcat(string, #a );strcat(string," ");}
220 if (
string[0] !=
'\0')
221 FIXME(
"%s\n",
string);
239 !(ppshpage->
dwFlags & PSP_HIDEHEADER)) ||
254 !(ppshpage->
dwFlags & PSP_HIDEHEADER))
259 rc->
top +=
r.bottom + 1;
326 TRACE(
"\n** PROPSHEETHEADER **\ndwSize\t\t%d\ndwFlags\t\t%08x\nhwndParent\t%p\nhInstance\t%p\npszCaption\t'%s'\nnPages\t\t%d\npfnCallback\t%p\n",
347 TRACE(
"PSH_USEPSTARTPAGE is on\n");
370 TRACE(
"\n** PROPSHEETHEADER **\ndwSize\t\t%d\ndwFlags\t\t%08x\nhwndParent\t%p\nhInstance\t%p\npszCaption\t%s\nnPages\t\t%d\npfnCallback\t%p\n",
384 TRACE(
"PSH_USEPSTARTPAGE is on\n");
458 p = (
const WORD *)pTemplate;
484 if (lppsp->
dwFlags & (PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE))
550 static const WCHAR pszNull[] = {
'(',
'n',
'u',
'l',
'l',
')',0 };
609 TRACE(
"(%p)\n", psInfo);
695 RECT rcOrigTab, rcPage;
771 TRACE(
"setting tab %p, rc (0,0)-(%d,%d)\n",
793 TRACE(
"setting dialog %p, rc (0,0)-(%d,%d)\n",
808 RECT rc, lineRect, dialogRect;
826 TRACE(
"setting dialog %p, rc (0,0)-(%d,%d)\n",
845 int buttonWidth, buttonHeight;
858 buttonWidth = rcSheet.
right;
859 buttonHeight = rcSheet.
bottom;
876 x = rcSheet.
right - ((
padding.x + buttonWidth) * num_buttons);
937 int buttonWidth, buttonHeight, lineHeight, lineWidth;
949 buttonWidth = rcSheet.
right;
950 buttonHeight = rcSheet.
bottom;
953 lineHeight = rcSheet.
bottom;
970 x = rcSheet.
right - ((
padding.x + buttonWidth) * (num_buttons - 1)) - buttonWidth;
1025 (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW | PSH_WIZARD_LITE))
1032 y = rcSheet.
bottom - ((
padding.y * 2) + buttonHeight + lineHeight);
1089 POINT ptButton, ptLine;
1112 ptButton.
x = rc.
left;
1113 ptButton.
y = rc.
top;
1125 ERR(
"padding negative ! Please report this !\n");
1160 for (
i = 0;
i < nTabs;
i++)
1165 item.iImage = iImage++;
1169 item.mask &= ~TCIF_IMAGE;
1212 const WORD*
p = (
const WORD *)pTemplate;
1221 TRACE(
"is DLGTEMPLATEEX\n");
1232 TRACE(
"is DLGTEMPLATE\n");
1237 nrofitems = (
WORD)*
p;
p++;
1281 p+=(istemplateex)?3:1;
1288 TRACE(
"%d items\n",nrofitems);
1289 while (nrofitems > 0)
1327 p += *
p /
sizeof(
WORD) + 1;
1332 TRACE(
"%p %p size 0x%08x\n",
p, pTemplate,
ret);
1356 if (ppshpage ==
NULL)
1410 pTemplateCopy =
Alloc(resSize);
1414 TRACE(
"copying pTemplate %p into pTemplateCopy %p (%d)\n", pTemplate, pTemplateCopy, resSize);
1415 memcpy(pTemplateCopy, pTemplate, resSize);
1433 pTemplateCopy->
style &= ~DS_MODALFRAME;
1434 pTemplateCopy->
style &= ~WS_CAPTION;
1435 pTemplateCopy->
style &= ~WS_SYSMENU;
1436 pTemplateCopy->
style &= ~WS_POPUP;
1437 pTemplateCopy->
style &= ~WS_DISABLED;
1438 pTemplateCopy->
style &= ~WS_VISIBLE;
1439 pTemplateCopy->
style &= ~WS_THICKFRAME;
1461 Free(pTemplateCopy);
1471 (ppshpage->
dwFlags & PSP_HIDEHEADER))
1526 HWND hwndLineHeader;
1611 if (
idx >= 0 && idx < psInfo->nPages)
1646 if (msgResult == -1)
1648 else if (msgResult == 0)
1653 if (idx < psInfo->nPages )
1689 TRACE(
"msg result %ld\n", msgResult);
1844 if (!psInfo)
return;
1876 if ( !psInfo )
return;
1885 noPageDirty =
FALSE;
1900 TRACE(
"buttonID %d\n", buttonID);
1925 FIXME(
"Invalid button index %d\n", buttonID);
1992 TRACE(
"index %d, skipdir %d, hpage %p\n",
index, skipdir, hpage);
1996 if (index < 0 || index >= psInfo->
nPages)
1998 TRACE(
"Could not find page to select!\n");
2038 TRACE(
"setting page %p, rc (%s) w=%d, h=%d\n",
2052 WARN(
"Tried to skip before first property sheet page!\n");
2056 WARN(
"Tried to skip after last property sheet page!\n");
2063 int old_index =
index;
2067 WARN(
"Tried to skip to nonexistent page by res id\n");
2112 if (idx < psInfo->nPages )
2153 int lentitle =
strlenW(lpszText);
2174 TRACE(
"'%s'\n", lpszText);
2235 while ((i < psInfo->nPages) && (msgResult == 0))
2257 TRACE(
"hwndDlg %p, hpageInsertAfter %p, hpage %p\n", hwndDlg, hpageInsertAfter, hpage);
2266 TRACE(
"Could not find page to insert after!\n");
2285 if (index < psInfo->nPages)
2345 TRACE(
"hwndDlg %p, hpage %p\n", hwndDlg, hpage);
2368 if (index < 0 || index >= psInfo->
nPages)
2370 TRACE(
"Could not find page to remove!\n");
2374 TRACE(
"total pages %d removing page %d active page %d\n",
2441 if (index < psInfo->nPages)
2523 if (!hwndFocus || hwndFocus == hwndCancel)
2539 if (page_index >= psInfo->
nPages)
2545 Free((
void *)
page->pszHeaderTitle);
2548 page->dwFlags |= PSP_USEHEADERTITLE;
2575 if (page_index >= psInfo->
nPages)
2581 Free((
void *)
page->pszHeaderSubTitle);
2584 page->dwFlags |= PSP_USEHEADERSUBTITLE;
2609 TRACE(
"(%p, %p)\n", hwndDlg, hPageDlg);
2614 WARN(
"%p not found\n", hPageDlg);
2624 TRACE(
"(%p, %d)\n", hwndDlg, iPageIndex);
2627 if (iPageIndex<0 || iPageIndex>=psInfo->
nPages) {
2628 WARN(
"%d out of range.\n", iPageIndex);
2641 TRACE(
"(%p, %p)\n", hwndDlg, hPage);
2652 TRACE(
"(%p, %d)\n", hwndDlg, iPageIndex);
2653 if (iPageIndex<0 || iPageIndex>=psInfo->
nPages) {
2654 WARN(
"%d out of range.\n", iPageIndex);
2668 TRACE(
"(%p, %d)\n", hwndDlg, iPageId);
2685 TRACE(
"(%p, %d)\n", hwndDlg, iPageIndex);
2686 if (iPageIndex<0 || iPageIndex>=psInfo->
nPages) {
2687 WARN(
"%d out of range.\n", iPageIndex);
2711 FIXME(
"(%p): stub\n", hwndDlg);
2726 TRACE(
"page %p index %d\n",
page, original_index);
2732 return original_index;
2744 if (!psInfo)
return;
2755 (psp->
dwFlags & PSP_HIDEHEADER))
2870 TRACE(
"(%p)\n", lppsh);
2911 TRACE(
"(%p)\n", lppsh);
2957 for (
i =
id & 0x0f;
i > 0;
i--)
ptr += *
ptr + 1;
3002 ppsp =
Alloc(2 *
sizeof(*ppsp));
3008 ppsp =
Alloc(
sizeof(*ppsp));
3012 ppsp->
dwFlags &= ~PSP_INTERNAL_UNICODE;
3041 if (ppsp->
dwFlags & PSP_HIDEHEADER)
3042 ppsp->
dwFlags &= ~(PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE);
3044 if (ppsp->
dwFlags & PSP_USEHEADERTITLE)
3049 ppsp->pszHeaderTitle =
heap_strdupAtoW( lpPropSheetPage->pszHeaderTitle );
3052 ppsp->pszHeaderTitle =
NULL;
3054 if (ppsp->
dwFlags & PSP_USEHEADERSUBTITLE)
3059 ppsp->pszHeaderSubTitle =
heap_strdupAtoW( lpPropSheetPage->pszHeaderSubTitle );
3062 ppsp->pszHeaderSubTitle =
NULL;
3085 ppsp =
Alloc(2 *
sizeof(*ppsp));
3091 ppsp =
Alloc(
sizeof(*ppsp));
3114 if (ppsp->
dwFlags & PSP_HIDEHEADER)
3115 ppsp->
dwFlags &= ~(PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE);
3117 if (ppsp->
dwFlags & PSP_USEHEADERTITLE)
3120 ppsp->pszHeaderTitle =
NULL;
3122 if (ppsp->
dwFlags & PSP_USEHEADERSUBTITLE)
3125 ppsp->pszHeaderSubTitle =
NULL;
3192 switch (lpMsg->wParam)
3201 case VK_NEXT: new_page = 1;
break;
3202 case VK_PRIOR: new_page = -1;
break;
3213 new_page = psInfo->
nPages - 1;
3214 else if (new_page >= psInfo->
nPages)
3299 HPALETTE hOldPal = 0;
3304 WCHAR szBuffer[256];
3320 if ( (ppshpage && !(ppshpage->
dwFlags & PSP_HIDEHEADER)) &&
3349 if (bm.bmWidth <
r.right || bm.bmHeight <
r.bottom)
3353 if (bm.bmWidth <
r.right)
3355 r.
left = bm.bmWidth;
3358 if (bm.bmHeight <
r.bottom)
3361 r.top = bm.bmHeight;
3379 margin = (rzone.
bottom - 49) / 2;
3381 min(bm.bmWidth, 49),
min(bm.bmHeight, 49),
3396 if (ppshpage->
dwFlags & PSP_USEHEADERTITLE) {
3411 if (ppshpage->
dwFlags & PSP_USEHEADERSUBTITLE) {
3431 offsety = rzone.
bottom + 2;
3438 if ( (ppshpage && (ppshpage->
dwFlags & PSP_HIDEHEADER)) &&
3460 r.right =
min(
r.right, 164);
3466 if (
r.top > bm.bmHeight) {
3467 r.bottom =
r.top - 1;
3468 r.top = bm.bmHeight;
3470 r.right = bm.bmWidth;
3495 TRACE(
"hwnd=%p msg=0x%04x wparam=%lx lparam=%lx\n",
3782 if(msgResult !=
FALSE)
3908 case PSM_INSERTPAGE:
3915 case PSM_SETHEADERTITLEW:
3919 case PSM_SETHEADERTITLEA:
3923 case PSM_SETHEADERSUBTITLEW:
3927 case PSM_SETHEADERSUBTITLEA:
3931 case PSM_HWNDTOINDEX:
3938 case PSM_INDEXTOHWND:
3945 case PSM_PAGETOINDEX:
3952 case PSM_INDEXTOPAGE:
3980 case PSM_RECALCPAGESIZES:
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
static const char * wine_dbgstr_rect(const RECT *prc)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
#define IDC_SUNKEN_LINEHEADER
#define IDC_FINISH_BUTTON
VOID COMCTL32_RefreshSysColors(void) DECLSPEC_HIDDEN
BOOL WINAPI SetWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR uIDSubclass, DWORD_PTR dwRef)
HBITMAP WINAPI CreateMappedBitmap(HINSTANCE hInstance, INT_PTR idBitmap, UINT wFlags, LPCOLORMAP lpColorMap, INT iNumMaps)
BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR uID)
LRESULT WINAPI DefSubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
static HINSTANCE instance
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
static LRESULT PROPSHEET_HwndToIndex(HWND hwndDlg, HWND hPageDlg)
static INT_PTR CALLBACK PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
static void PROPSHEET_SetHeaderSubTitleA(HWND hwndDlg, UINT page_index, const char *subtitle)
static LRESULT PROPSHEET_IdToIndex(HWND hwndDlg, int iPageId)
#define WIZARD_HEADER_HEIGHT
static void PROPSHEET_PressButton(HWND hwndDlg, int buttonID)
static void PROPSHEET_SetHeaderSubTitleW(HWND hwndDlg, UINT page_index, const WCHAR *subtitle)
static void PROPSHEET_SetFinishTextA(HWND hwndDlg, LPCSTR lpszText)
static BOOL PROPSHEET_AdjustButtonsWizard(HWND hwndParent, const PropSheetInfo *psInfo)
static INT_PTR PROPSHEET_CreateDialog(PropSheetInfo *psInfo)
#define INTRNL_ANY_WIZARD
static void PROPSHEET_CollectSheetInfoCommon(PropSheetInfo *psInfo, DWORD dwFlags)
static BOOL PROPSHEET_ShowPage(HWND hwndDlg, int index, PropSheetInfo *psInfo)
#define PSP_INTERNAL_UNICODE
static void PROPSHEET_CleanUp(HWND hwndDlg)
static void PROPSHEET_CollectSheetInfoA(LPCPROPSHEETHEADERA lppsh, PropSheetInfo *psInfo)
static BOOL PROPSHEET_AdjustSize(HWND hwndDlg, PropSheetInfo *psInfo)
static WCHAR * heap_strdupAtoW(const char *str)
INT_PTR WINAPI PropertySheetA(LPCPROPSHEETHEADERA lppsh)
static void PROPSHEET_CollectSheetInfoW(LPCPROPSHEETHEADERW lppsh, PropSheetInfo *psInfo)
static const WCHAR PropSheetInfoStr[]
#define MAX_TABTEXT_LENGTH
static void PROPSHEET_Cancel(HWND hwndDlg, LPARAM lParam)
static BOOL PROPSHEET_Finish(HWND hwndDlg)
static void PROPSHEET_SetHeaderTitleW(HWND hwndDlg, UINT page_index, const WCHAR *title)
static void PROPSHEET_SetCurSelId(HWND hwndDlg, int id)
static void PROPSHEET_GetPageRect(const PropSheetInfo *psInfo, HWND hwndDlg, RECT *rc, LPCPROPSHEETPAGEW ppshpage)
static BOOL PROPSHEET_Next(HWND hwndDlg)
static BOOL PROPSHEET_Apply(HWND hwndDlg, LPARAM lParam)
static PADDING_INFO PROPSHEET_GetPaddingInfoWizard(HWND hwndDlg, const PropSheetInfo *psInfo)
static BOOL PROPSHEET_AdjustButtons(HWND hwndParent, const PropSheetInfo *psInfo)
static LRESULT PROPSHEET_IndexToHwnd(HWND hwndDlg, int iPageIndex)
static void PROPSHEET_UnChanged(HWND hwndDlg, HWND hwndCleanPage)
static BOOL PROPSHEET_CreatePage(HWND hwndParent, int index, const PropSheetInfo *psInfo, LPCPROPSHEETPAGEW ppshpage)
static UINT GetTemplateSize(const DLGTEMPLATE *pTemplate)
static BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEW lppsp, PropSheetInfo *psInfo, int index, BOOL resize)
static BOOL PROPSHEET_DoCommand(HWND hwnd, WORD wID)
static PADDING_INFO PROPSHEET_GetPaddingInfo(HWND hwndDlg)
static BOOL PROPSHEET_InsertPage(HWND hwndDlg, HPROPSHEETPAGE hpageInsertAfter, HPROPSHEETPAGE hpage)
static BOOL PROPSHEET_CreateTabControl(HWND hwndParent, const PropSheetInfo *psInfo)
HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage)
static WCHAR * heap_strdupW(const WCHAR *str)
static BOOL PROPSHEET_RecalcPageSizes(HWND hwndDlg)
static void PROPSHEET_Changed(HWND hwndDlg, HWND hwndDirtyPage)
static INT_PTR PROPSHEET_PropertySheet(PropSheetInfo *psInfo, BOOL unicode)
static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags)
static BOOL PROPSHEET_IsDialogMessage(HWND hwnd, LPMSG lpMsg)
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
static INT PROPSHEET_FindPageByResId(const PropSheetInfo *psInfo, LRESULT resId)
static BOOL PROPSHEET_SizeMismatch(HWND hwndDlg, const PropSheetInfo *psInfo)
static int PROPSHEET_GetPageIndex(HPROPSHEETPAGE hpage, const PropSheetInfo *psInfo, int original_index)
static LRESULT PROPSHEET_IndexToPage(HWND hwndDlg, int iPageIndex)
#define MAX_BUTTONTEXT_LENGTH
HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(LPCPROPSHEETPAGEA lpPropSheetPage)
static LPWSTR load_string(HINSTANCE instance, LPCWSTR str)
static LRESULT PROPSHEET_IndexToId(HWND hwndDlg, int iPageIndex)
static BOOL PROPSHEET_SetCurSel(HWND hwndDlg, int index, int skipdir, HPROPSHEETPAGE hpage)
static BOOL PROPSHEET_CanSetCurSel(HWND hwndDlg)
static VOID PROPSHEET_UnImplementedFlags(DWORD dwFlags)
static BOOL PROPSHEET_RemovePage(HWND hwndDlg, int index, HPROPSHEETPAGE hpage)
BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage)
struct tagPropSheetInfo PropSheetInfo
static BOOL PROPSHEET_AdjustSizeWizard(HWND hwndDlg, const PropSheetInfo *psInfo)
static void PROPSHEET_SetHeaderTitleA(HWND hwndDlg, UINT page_index, const char *title)
struct tagPropPageInfo PropPageInfo
static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
static void PROPSHEET_Help(HWND hwndDlg)
static BOOL PROPSHEET_AddPage(HWND hwndDlg, HPROPSHEETPAGE hpage)
static BOOL PROPSHEET_Back(HWND hwndDlg)
static LRESULT CALLBACK PROPSHEET_WizardSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uID, DWORD_PTR dwRef)