]> cygwin.com Git - cygwin-apps/setup.git/blob - proppage.h
2003-10-16 Frank Richter <frichter@gmx.li>
[cygwin-apps/setup.git] / proppage.h
1 /*
2 * Copyright (c) 2001, 2002, 2003 Gary R. Van Sickle.
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
16 #ifndef SETUP_PROPPAGE_H
17 #define SETUP_PROPPAGE_H
18
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
23 #include "win32.h"
24 #include <prsht.h>
25
26 #include "window.h"
27 #include "ControlAdjuster.h"
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;
43
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);
49 void setTitleFont ();
50
51 protected:
52 SizeProcessor sizeProcessor;
53
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 };
99 virtual bool wantsActivation () const
100 {
101 return true;
102 };
103 virtual void OnDeactivate ()
104 {
105 };
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.
112 virtual long OnNext ()
113 {
114 return 0;
115 };
116 virtual long OnBack ()
117 {
118 return 0;
119 };
120
121 virtual bool OnFinish ()
122 {
123 return true;
124 };
125 virtual long OnUnattended ()
126 {
127 return -2;
128 };
129
130 PropSheet *GetOwner () const
131 {
132 return OurSheet;
133 };
134 };
135
136 #endif /* SETUP_PROPPAGE_H */
This page took 0.043179 seconds and 6 git commands to generate.