2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
15 #include <WINNT/TaLocale.h>
16 #include <WINNT/subclass.h>
24 * DEFINITIONS ________________________________________________________________
29 #define THIS_HINST (HINSTANCE)GetModuleHandle(NULL)
32 #define IDC_WIZARD 898 // WM_COMMAND,IDC_WIZARD: HIWORD(wp)=WIZARD_COMAMND
34 typedef class EXPORTED WIZARD WIZARD, *LPWIZARD;
38 * WIZARD CLASS _______________________________________________________________
44 wcSTATE_ENTER, // now entering state (even w/o display)
45 wcSTATE_LEAVE, // now leaving state (even w/o display)
46 wcIS_STATE_DISABLED, // return TRUE if state disabled
51 int st; // numeric state identifier
52 int idd; // dialog template for wizard pane
53 DLGPROC dlgproc; // dialog procedure for this state
54 LPARAM lp; // lparam for dialog initialization
55 } WIZARD_STATE, *LPWIZARD_STATE;
57 #define BACK_BUTTON 0x0001
58 #define NEXT_BUTTON 0x0002
67 static LPWIZARD GetWizard (HWND hWnd);
68 HWND GetWindow (void);
70 void SetDialogTemplate (int iddTemplate, int idcLeftPane, int idcRightPane, int idcBack, int idcNext);
71 void SetGraphic (int idbGraphic16, int idbGraphic256);
72 void SetStates (LPWIZARD_STATE aStates, size_t cStates);
73 void SetGraphicCallback (void (CALLBACK *pfnCallback)(LPWIZARD pWiz, HDC hdcTarget, LPRECT prTarget, HPALETTE hPal));
76 void SetState (int stNew, BOOL fForce = FALSE);
77 BOOL Show (BOOL fShow = TRUE);
79 void SetBackground (int iddBackground, BOOL fBlue = TRUE, DLGPROC dlgproc = NULL);
80 void SetBackgroundText (LPTSTR pszText, HFONT hfText = NULL);
81 void SetBackgroundText (int idsText, HFONT hfText = NULL);
82 BOOL ShowBackground (BOOL fShow = TRUE);
83 HWND GetBackgroundWindow (void);
85 void EnableButton (int idcButton, BOOL fEnable);
86 void EnableButtons (DWORD dwButtonFlags = BACK_BUTTON | NEXT_BUTTON);
87 void SetButtonText (int idcButton, int idsText);
88 void SetDefaultControl (int idc);
90 BOOL SendStateCommand (int st, WIZARD_COMMAND wc);
94 void Refresh (DWORD dwRefFlags);
95 HWND GetRightHandWindow (void);
96 void GeneratePalette (RGBQUAD *pargb = NULL);
97 LPWIZARD_STATE FindState (int stFind);
99 static BOOL CALLBACK Background_DlgProc (HWND hBkg, UINT msg, WPARAM wp, LPARAM lp);
100 static BOOL CALLBACK Background_PaintHook (HWND hBkg, UINT msg, WPARAM wp, LPARAM lp);
101 void Background_OnInitDialog (HWND hBkg);
102 void Background_OnSize (void);
103 void Background_OnDestroy (void);
104 void Background_OnClose (void);
105 BOOL Background_OnPaint (void);
107 static BOOL CALLBACK Template_DlgProc (HWND hWnd, UINT msg, WPARAM wp, LPARAM lp);
108 static BOOL CALLBACK Template_LeftPaneHook (HWND hLHS, UINT msg, WPARAM wp, LPARAM lp);
109 BOOL Template_ForwardMessage (HWND hWnd, UINT msg, WPARAM wp, LPARAM lp);
110 void Template_OnInitDialog (HWND hWnd);
111 BOOL Template_OnPaintLHS (HWND hLHS);
119 HBITMAP m_bmpGraphic16;
121 HBITMAP m_bmpGraphic256;
122 HPALETTE m_palGraphic;
123 LPWIZARD_STATE m_aStates;
132 DLGPROC m_fnBackground;
133 TCHAR m_szBackground[ cchRESOURCE ];
134 HBITMAP m_bmpBackground;
135 HFONT m_hfBackground;
139 void (CALLBACK *m_pfnCallback)(LPWIZARD pWiz, HDC hdcTarget, LPRECT prTarget, HPALETTE hPal);