]>
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" | |
27 | ||
28 | class PropSheet; | |
29 | ||
30 | class PropertyPage:public Window | |
31 | { | |
32 | static bool DoOnceForSheet; | |
33 | PROPSHEETPAGE psp; | |
34 | DLGPROC proc; | |
35 | BOOL (*cmdproc) (HWND h, int id, HWND hwndctl, UINT code); | |
36 | ||
37 | // The sheet that owns this page. | |
38 | PropSheet *OurSheet; | |
39 | ||
40 | // For setting the back/finish buttons properly. | |
41 | bool IsFirst, IsLast; | |
42 | ||
43 | static BOOL CALLBACK FirstDialogProcReflector (HWND hwnd, UINT message, | |
44 | WPARAM wParam, | |
45 | LPARAM lParam); | |
46 | static BOOL CALLBACK DialogProcReflector (HWND hwnd, UINT message, | |
47 | WPARAM wParam, LPARAM lParam); | |
25130a4d | 48 | void setTitleFont (); |
b7301c43 RC |
49 | |
50 | protected: | |
51 | virtual BOOL CALLBACK DialogProc (UINT message, WPARAM wParam, | |
52 | LPARAM lParam); | |
53 | ||
54 | public: | |
55 | PropertyPage (); | |
56 | virtual ~ PropertyPage (); | |
57 | ||
58 | PROPSHEETPAGE *GetPROPSHEETPAGEPtr () | |
59 | { | |
60 | return &psp; | |
61 | }; | |
62 | ||
63 | // FIXME: These should be private and friended to PropSheet. | |
64 | void YouAreBeingAddedToASheet (PropSheet * ps) | |
65 | { | |
66 | OurSheet = ps; | |
67 | }; | |
68 | void YouAreFirst () | |
69 | { | |
70 | IsFirst = true; | |
71 | IsLast = false; | |
72 | }; | |
73 | void YouAreLast () | |
74 | { | |
75 | IsFirst = false; | |
76 | IsLast = true; | |
77 | }; | |
78 | void YouAreMiddle () | |
79 | { | |
80 | IsFirst = false; | |
81 | IsLast = false; | |
82 | }; | |
83 | ||
84 | virtual bool Create (int TemplateID); | |
85 | virtual bool Create (DLGPROC dlgproc, int TemplateID); | |
86 | virtual bool Create (DLGPROC dlgproc, | |
87 | BOOL (*cmdproc) (HWND h, int id, HWND hwndctl, | |
88 | UINT code), int TemplateID); | |
89 | ||
90 | virtual void OnInit () | |
91 | { | |
92 | }; | |
93 | virtual void OnActivate () | |
94 | { | |
95 | }; | |
7f6de8c0 | 96 | virtual bool wantsActivation () const |
b28e9f01 MB |
97 | { |
98 | return true; | |
99 | }; | |
b7301c43 RC |
100 | virtual void OnDeactivate () |
101 | { | |
102 | }; | |
5296fc07 MB |
103 | |
104 | // Overload these to perform special processing when the user hits | |
105 | // "Next" or "Back". Return: | |
106 | // 0 == Go to next/previous page in sequence. | |
107 | // -1 == Prevent wizard from changing page. | |
108 | // Resource ID == go to a specific page specified by the resource ID. | |
b7301c43 RC |
109 | virtual long OnNext () |
110 | { | |
111 | return 0; | |
112 | }; | |
113 | virtual long OnBack () | |
114 | { | |
115 | return 0; | |
116 | }; | |
5296fc07 | 117 | |
b7301c43 RC |
118 | virtual bool OnFinish () |
119 | { | |
120 | return true; | |
121 | }; | |
f2ff9838 RC |
122 | virtual long OnUnattended () |
123 | { | |
124 | return -2; | |
125 | }; | |
b7301c43 RC |
126 | |
127 | PropSheet *GetOwner () const | |
128 | { | |
129 | return OurSheet; | |
130 | }; | |
131 | }; | |
132 | ||
c93bc6d0 | 133 | #endif /* SETUP_PROPPAGE_H */ |