Update NEWS for 1.6.22
[pkg-k5-afs_openafs.git] / src / WINNT / afsapplib / al_wizard.h
blobe44671f7bad07babdbdd74bc95c16573f5c06530
1 /*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * All Rights Reserved.
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
8 */
10 #ifndef AL_WIZARD_H
11 #define AL_WIZARD_H
13 #include <windows.h>
14 #include <prsht.h>
15 #include <WINNT/TaLocale.h>
16 #include <WINNT/subclass.h>
18 #ifndef EXPORTED
19 #define EXPORTED
20 #endif
24 * DEFINITIONS ________________________________________________________________
28 #ifndef THIS_HINST
29 #define THIS_HINST (HINSTANCE)GetModuleHandle(NULL)
30 #endif
32 #define IDC_WIZARD 898 // WM_COMMAND,IDC_WIZARD: HIWORD(wp)=WIZARD_COMAMND
34 typedef class EXPORTED WIZARD WIZARD, *LPWIZARD;
38 * WIZARD CLASS _______________________________________________________________
42 typedef enum
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
47 } WIZARD_COMMAND;
49 typedef struct
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
60 class EXPORTED WIZARD
62 public:
64 WIZARD (void);
65 ~WIZARD (void);
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));
75 int GetState (void);
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);
92 private:
94 void Refresh (DWORD dwRefFlags);
95 HWND GetRightHandWindow (void);
96 void GeneratePalette (RGBQUAD *pargb = NULL);
97 LPWIZARD_STATE FindState (int stFind);
99 static HRESULT CALLBACK Background_DlgProc (HWND hBkg, UINT msg, WPARAM wp, LPARAM lp);
100 static HRESULT 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 HRESULT CALLBACK Template_DlgProc (HWND hWnd, UINT msg, WPARAM wp, LPARAM lp);
108 static HRESULT 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);
113 int m_iddTemplate;
114 int m_idcLeftPane;
115 int m_idcRightPane;
116 int m_idcBack;
117 int m_idcNext;
118 int m_idbGraphic16;
119 HBITMAP m_bmpGraphic16;
120 int m_idbGraphic256;
121 HBITMAP m_bmpGraphic256;
122 HPALETTE m_palGraphic;
123 LPWIZARD_STATE m_aStates;
124 size_t m_cStates;
125 int m_stCurrent;
126 BOOL m_fShowing;
127 HWND m_hWnd;
129 int m_iddBackground;
130 BOOL m_fBlue;
131 HWND m_hBkg;
132 DLGPROC m_fnBackground;
133 TCHAR m_szBackground[ cchRESOURCE ];
134 HBITMAP m_bmpBackground;
135 HFONT m_hfBackground;
136 HBITMAP m_bmpBuffer;
137 RECT m_rBuffer;
139 void (CALLBACK *m_pfnCallback)(LPWIZARD pWiz, HDC hdcTarget, LPRECT prTarget, HPALETTE hPal);
143 #endif