]>
Commit | Line | Data |
---|---|---|
b7301c43 | 1 | /* |
5296fc07 | 2 | * Copyright (c) 2001, 2002, 2003 Gary R. Van Sickle. |
b7301c43 RC |
3 | * |
4 | * This program is free software; you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation; either version 2 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * A copy of the GNU General Public License can be found at | |
10 | * http://www.gnu.org/ | |
11 | * | |
12 | * Written by Gary R. Van Sickle <g.r.vansickle@worldnet.att.net> | |
13 | * | |
14 | */ | |
15 | ||
c93bc6d0 MB |
16 | #ifndef SETUP_PROPPAGE_H |
17 | #define SETUP_PROPPAGE_H | |
18 | ||
b7301c43 RC |
19 | // This is the header for the PropertyPage class. It works closely with the |
20 | // PropSheet class to implement a single page of the property sheet. | |
21 | ||
22 | ||
ac949c48 | 23 | #include "win32.h" |
b7301c43 RC |
24 | #include <prsht.h> |
25 | ||
26 | #include "window.h" | |
ee91d9be | 27 | #include "ControlAdjuster.h" |
b7301c43 RC |
28 | |
29 | class PropSheet; | |
30 | ||
31 | class PropertyPage:public Window | |
32 | { | |
33 | static bool DoOnceForSheet; | |
34 | PROPSHEETPAGE psp; | |
35 | DLGPROC proc; | |
36 | BOOL (*cmdproc) (HWND h, int id, HWND hwndctl, UINT code); | |
37 | ||
38 | // The sheet that owns this page. | |
39 | PropSheet *OurSheet; | |
40 | ||
41 | // For setting the back/finish buttons properly. | |
42 | bool IsFirst, IsLast; | |
ee91d9be | 43 | |
b7301c43 RC |
44 | static BOOL CALLBACK FirstDialogProcReflector (HWND hwnd, UINT message, |
45 | WPARAM wParam, | |
46 | LPARAM lParam); | |
47 | static BOOL CALLBACK DialogProcReflector (HWND hwnd, UINT message, | |
48 | WPARAM wParam, LPARAM lParam); | |
25130a4d | 49 | void setTitleFont (); |
b7301c43 RC |
50 | |
51 | protected: | |
ee91d9be RC |
52 | SizeProcessor sizeProcessor; |
53 | ||
b7301c43 RC |
54 | virtual BOOL CALLBACK DialogProc (UINT message, WPARAM wParam, |
55 | LPARAM lParam); | |
56 | ||
57 | public: | |
58 | PropertyPage (); | |
59 | virtual ~ PropertyPage (); | |
60 | ||
61 | PROPSHEETPAGE *GetPROPSHEETPAGEPtr () | |
62 | { | |
63 | return &psp; | |
64 | }; | |
65 | ||
66 | // FIXME: These should be private and friended to PropSheet. | |
67 | void YouAreBeingAddedToASheet (PropSheet * ps) | |
68 | { | |
69 | OurSheet = ps; | |
70 | }; | |
71 | void YouAreFirst () | |
72 | { | |
73 | IsFirst = true; | |
74 | IsLast = false; | |
75 | }; | |
76 | void YouAreLast () | |
77 | { | |
78 | IsFirst = false; | |
79 | IsLast = true; | |
80 | }; | |
81 | void YouAreMiddle () | |
82 | { | |
83 | IsFirst = false; | |
84 | IsLast = false; | |
85 | }; | |
86 | ||
87 | virtual bool Create (int TemplateID); | |
88 | virtual bool Create (DLGPROC dlgproc, int TemplateID); | |
89 | virtual bool Create (DLGPROC dlgproc, | |
90 | BOOL (*cmdproc) (HWND h, int id, HWND hwndctl, | |
91 | UINT code), int TemplateID); | |
92 | ||
93 | virtual void OnInit () | |
94 | { | |
95 | }; | |
96 | virtual void OnActivate () | |
97 | { | |
98 | }; | |
7f6de8c0 | 99 | virtual bool wantsActivation () const |
b28e9f01 MB |
100 | { |
101 | return true; | |
102 | }; | |
b7301c43 RC |
103 | virtual void OnDeactivate () |
104 | { | |
105 | }; | |
5296fc07 MB |
106 | |
107 | // Overload these to perform special processing when the user hits | |
108 | // "Next" or "Back". Return: | |
109 | // 0 == Go to next/previous page in sequence. | |
110 | // -1 == Prevent wizard from changing page. | |
111 | // Resource ID == go to a specific page specified by the resource ID. | |
b7301c43 RC |
112 | virtual long OnNext () |
113 | { | |
114 | return 0; | |
115 | }; | |
116 | virtual long OnBack () | |
117 | { | |
118 | return 0; | |
119 | }; | |
5296fc07 | 120 | |
b7301c43 RC |
121 | virtual bool OnFinish () |
122 | { | |
123 | return true; | |
124 | }; | |
f2ff9838 RC |
125 | virtual long OnUnattended () |
126 | { | |
127 | return -2; | |
128 | }; | |
b7301c43 RC |
129 | |
130 | PropSheet *GetOwner () const | |
131 | { | |
132 | return OurSheet; | |
133 | }; | |
134 | }; | |
135 | ||
c93bc6d0 | 136 | #endif /* SETUP_PROPPAGE_H */ |