55#define NONAMELESSUNION
143 {
'P',
'r',
'o',
'p',
'e',
'r',
't',
'y',
'S',
'h',
'e',
'e',
't',
'I',
'n',
'f',
'o',0 };
145#define PSP_INTERNAL_UNICODE 0x80000000
147#define MAX_CAPTION_LENGTH 255
148#define MAX_TABTEXT_LENGTH 255
149#define MAX_BUTTONTEXT_LENGTH 64
151#define INTRNL_ANY_WIZARD (PSH_WIZARD | PSH_WIZARD97_OLD | PSH_WIZARD97_NEW | PSH_WIZARD_LITE)
154#define WIZARD_PADDING 7
155#define WIZARD_HEADER_HEIGHT 36
197#define add_flag(a) if (dwFlags & a) {strcat(string, #a );strcat(string," ");}
219 if (
string[0] !=
'\0')
220 FIXME(
"%s\n",
string);
238 !(ppshpage->
dwFlags & PSP_HIDEHEADER)) ||
253 !(ppshpage->
dwFlags & PSP_HIDEHEADER))
258 rc->
top +=
r.bottom + 1;
325 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",
346 TRACE(
"PSH_USEPSTARTPAGE is on\n");
369 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",
383 TRACE(
"PSH_USEPSTARTPAGE is on\n");
457 p = (
const WORD *)pTemplate;
483 if (lppsp->
dwFlags & (PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE))
549 static const WCHAR pszNull[] = {
'(',
'n',
'u',
'l',
'l',
')',0 };
608 TRACE(
"(%p)\n", psInfo);
694 RECT rcOrigTab, rcPage;
770 TRACE(
"setting tab %p, rc (0,0)-(%d,%d)\n",
792 TRACE(
"setting dialog %p, rc (0,0)-(%d,%d)\n",
807 RECT rc, lineRect, dialogRect;
825 TRACE(
"setting dialog %p, rc (0,0)-(%d,%d)\n",
844 int buttonWidth, buttonHeight;
857 buttonWidth = rcSheet.
right;
858 buttonHeight = rcSheet.
bottom;
875 x = rcSheet.
right - ((
padding.x + buttonWidth) * num_buttons);
936 int buttonWidth, buttonHeight, lineHeight, lineWidth;
948 buttonWidth = rcSheet.
right;
949 buttonHeight = rcSheet.
bottom;
952 lineHeight = rcSheet.
bottom;
969 x = rcSheet.
right - ((
padding.x + buttonWidth) * (num_buttons - 1)) - buttonWidth;
1024 (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW | PSH_WIZARD_LITE))
1031 y = rcSheet.
bottom - ((
padding.y * 2) + buttonHeight + lineHeight);
1088 POINT ptButton, ptLine;
1111 ptButton.
x = rc.
left;
1112 ptButton.
y = rc.
top;
1124 ERR(
"padding negative ! Please report this !\n");
1159 for (
i = 0;
i < nTabs;
i++)
1164 item.iImage = iImage++;
1168 item.mask &= ~TCIF_IMAGE;
1211 const WORD*
p = (
const WORD *)pTemplate;
1220 TRACE(
"is DLGTEMPLATEEX\n");
1231 TRACE(
"is DLGTEMPLATE\n");
1236 nrofitems = (
WORD)*
p;
p++;
1280 p+=(istemplateex)?3:1;
1287 TRACE(
"%d items\n",nrofitems);
1288 while (nrofitems > 0)
1326 p += *
p /
sizeof(
WORD) + 1;
1331 TRACE(
"%p %p size 0x%08x\n",
p, pTemplate,
ret);
1355 if (ppshpage ==
NULL)
1409 pTemplateCopy =
Alloc(resSize);
1413 TRACE(
"copying pTemplate %p into pTemplateCopy %p (%d)\n", pTemplate, pTemplateCopy, resSize);
1414 memcpy(pTemplateCopy, pTemplate, resSize);
1432 pTemplateCopy->
style &= ~DS_MODALFRAME;
1433 pTemplateCopy->
style &= ~WS_CAPTION;
1434 pTemplateCopy->
style &= ~WS_SYSMENU;
1435 pTemplateCopy->
style &= ~WS_POPUP;
1436 pTemplateCopy->
style &= ~WS_DISABLED;
1437 pTemplateCopy->
style &= ~WS_VISIBLE;
1438 pTemplateCopy->
style &= ~WS_THICKFRAME;
1460 Free(pTemplateCopy);
1470 (ppshpage->
dwFlags & PSP_HIDEHEADER))
1525 HWND hwndLineHeader;
1610 if (
idx >= 0 && idx < psInfo->nPages)
1645 if (msgResult == -1)
1647 else if (msgResult == 0)
1652 if (idx < psInfo->nPages )
1688 TRACE(
"msg result %ld\n", msgResult);
1843 if (!psInfo)
return;
1875 if ( !psInfo )
return;
1884 noPageDirty =
FALSE;
1899 TRACE(
"buttonID %d\n", buttonID);
1924 FIXME(
"Invalid button index %d\n", buttonID);
1991 TRACE(
"index %d, skipdir %d, hpage %p\n",
index, skipdir, hpage);
1995 if (index < 0 || index >= psInfo->
nPages)
1997 TRACE(
"Could not find page to select!\n");
2044 TRACE(
"setting page %p, rc (%s) w=%d, h=%d\n",
2058 WARN(
"Tried to skip before first property sheet page!\n");
2062 WARN(
"Tried to skip after last property sheet page!\n");
2069 int old_index =
index;
2073 WARN(
"Tried to skip to nonexistent page by res id\n");
2118 if (idx < psInfo->nPages )
2180 TRACE(
"'%s'\n", lpszText);
2241 while ((i < psInfo->nPages) && (msgResult == 0))
2263 TRACE(
"hwndDlg %p, hpageInsertAfter %p, hpage %p\n", hwndDlg, hpageInsertAfter, hpage);
2272 TRACE(
"Could not find page to insert after!\n");
2291 if (index < psInfo->nPages)
2351 TRACE(
"hwndDlg %p, hpage %p\n", hwndDlg, hpage);
2374 if (index < 0 || index >= psInfo->
nPages)
2376 TRACE(
"Could not find page to remove!\n");
2380 TRACE(
"total pages %d removing page %d active page %d\n",
2447 if (index < psInfo->nPages)
2529 if (!hwndFocus || hwndFocus == hwndCancel)
2545 if (page_index >= psInfo->
nPages)
2551 Free((
void *)
page->pszHeaderTitle);
2554 page->dwFlags |= PSP_USEHEADERTITLE;
2581 if (page_index >= psInfo->
nPages)
2587 Free((
void *)
page->pszHeaderSubTitle);
2590 page->dwFlags |= PSP_USEHEADERSUBTITLE;
2615 TRACE(
"(%p, %p)\n", hwndDlg, hPageDlg);
2620 WARN(
"%p not found\n", hPageDlg);
2630 TRACE(
"(%p, %d)\n", hwndDlg, iPageIndex);
2633 if (iPageIndex<0 || iPageIndex>=psInfo->
nPages) {
2634 WARN(
"%d out of range.\n", iPageIndex);
2647 TRACE(
"(%p, %p)\n", hwndDlg, hPage);
2658 TRACE(
"(%p, %d)\n", hwndDlg, iPageIndex);
2659 if (iPageIndex<0 || iPageIndex>=psInfo->
nPages) {
2660 WARN(
"%d out of range.\n", iPageIndex);
2674 TRACE(
"(%p, %d)\n", hwndDlg, iPageId);
2691 TRACE(
"(%p, %d)\n", hwndDlg, iPageIndex);
2692 if (iPageIndex<0 || iPageIndex>=psInfo->
nPages) {
2693 WARN(
"%d out of range.\n", iPageIndex);
2717 FIXME(
"(%p): stub\n", hwndDlg);
2732 TRACE(
"page %p index %d\n",
page, original_index);
2738 return original_index;
2750 if (!psInfo)
return;
2761 (psp->
dwFlags & PSP_HIDEHEADER))
2823 if(
ret == 0 &&
msg.message)
2881 TRACE(
"(%p)\n", lppsh);
2922 TRACE(
"(%p)\n", lppsh);
2968 for (
i =
id & 0x0f;
i > 0;
i--)
ptr += *
ptr + 1;
3013 ppsp =
Alloc(2 *
sizeof(*ppsp));
3019 ppsp =
Alloc(
sizeof(*ppsp));
3023 ppsp->
dwFlags &= ~PSP_INTERNAL_UNICODE;
3052 if (ppsp->
dwFlags & PSP_HIDEHEADER)
3053 ppsp->
dwFlags &= ~(PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE);
3055 if (ppsp->
dwFlags & PSP_USEHEADERTITLE)
3060 ppsp->pszHeaderTitle =
heap_strdupAtoW( lpPropSheetPage->pszHeaderTitle );
3063 ppsp->pszHeaderTitle =
NULL;
3065 if (ppsp->
dwFlags & PSP_USEHEADERSUBTITLE)
3070 ppsp->pszHeaderSubTitle =
heap_strdupAtoW( lpPropSheetPage->pszHeaderSubTitle );
3073 ppsp->pszHeaderSubTitle =
NULL;
3096 ppsp =
Alloc(2 *
sizeof(*ppsp));
3102 ppsp =
Alloc(
sizeof(*ppsp));
3125 if (ppsp->
dwFlags & PSP_HIDEHEADER)
3126 ppsp->
dwFlags &= ~(PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE);
3128 if (ppsp->
dwFlags & PSP_USEHEADERTITLE)
3131 ppsp->pszHeaderTitle =
NULL;
3133 if (ppsp->
dwFlags & PSP_USEHEADERSUBTITLE)
3136 ppsp->pszHeaderSubTitle =
NULL;
3203 switch (lpMsg->wParam)
3212 case VK_NEXT: new_page = 1;
break;
3213 case VK_PRIOR: new_page = -1;
break;
3224 new_page = psInfo->
nPages - 1;
3225 else if (new_page >= psInfo->
nPages)
3310 HPALETTE hOldPal = 0;
3315 WCHAR szBuffer[256];
3331 if ( (ppshpage && !(ppshpage->
dwFlags & PSP_HIDEHEADER)) &&
3360 if (bm.bmWidth <
r.right || bm.bmHeight <
r.bottom)
3364 if (bm.bmWidth <
r.right)
3366 r.
left = bm.bmWidth;
3369 if (bm.bmHeight <
r.bottom)
3372 r.top = bm.bmHeight;
3390 margin = (rzone.
bottom - 49) / 2;
3392 min(bm.bmWidth, 49),
min(bm.bmHeight, 49),
3407 if (ppshpage->
dwFlags & PSP_USEHEADERTITLE) {
3422 if (ppshpage->
dwFlags & PSP_USEHEADERSUBTITLE) {
3442 offsety = rzone.
bottom + 2;
3449 if ( (ppshpage && (ppshpage->
dwFlags & PSP_HIDEHEADER)) &&
3471 r.right =
min(
r.right, 164);
3477 if (
r.top > bm.bmHeight) {
3478 r.bottom =
r.top - 1;
3479 r.top = bm.bmHeight;
3481 r.right = bm.bmWidth;
3506 TRACE(
"hwnd=%p msg=0x%04x wparam=%lx lparam=%lx\n",
3793 if(msgResult !=
FALSE)
3919 case PSM_INSERTPAGE:
3926 case PSM_SETHEADERTITLEW:
3930 case PSM_SETHEADERTITLEA:
3934 case PSM_SETHEADERSUBTITLEW:
3938 case PSM_SETHEADERSUBTITLEA:
3942 case PSM_HWNDTOINDEX:
3949 case PSM_INDEXTOHWND:
3956 case PSM_PAGETOINDEX:
3963 case PSM_INDEXTOPAGE:
3991 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_ind