]> cygwin.com Git - cygwin-apps/setup.git/blob - proppage.h
2003-08-02 Gary R. Van Sickle <g.r.vansickle@worldnet.att.net>
[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
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);
48 void setTitleFont ();
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 };
96 virtual bool wantsActivation ()
97 {
98 return true;
99 };
100 virtual void OnDeactivate ()
101 {
102 };
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.
109 virtual long OnNext ()
110 {
111 return 0;
112 };
113 virtual long OnBack ()
114 {
115 return 0;
116 };
117
118 virtual bool OnFinish ()
119 {
120 return true;
121 };
122 virtual long OnUnattended ()
123 {
124 return -2;
125 };
126
127 PropSheet *GetOwner () const
128 {
129 return OurSheet;
130 };
131 };
132
133 #endif /* SETUP_PROPPAGE_H */
This page took 0.041097 seconds and 6 git commands to generate.