]> cygwin.com Git - cygwin-apps/setup.git/blob - proppage.h
2001-12-22 Gary R. Van Sickle <g.r.vansickle@worldnet.att.net>
[cygwin-apps/setup.git] / proppage.h
1 #ifndef CINSTALL_PROPPAGE_H
2 #define CINSTALL_PROPPAGE_H
3
4 /*
5 * Copyright (c) 2001, Gary R. Van Sickle.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * A copy of the GNU General Public License can be found at
13 * http://www.gnu.org/
14 *
15 * Written by Gary R. Van Sickle <g.r.vansickle@worldnet.att.net>
16 *
17 */
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 <windows.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
49 protected:
50 virtual BOOL CALLBACK DialogProc (UINT message, WPARAM wParam,
51 LPARAM lParam);
52
53 public:
54 PropertyPage ();
55 virtual ~ PropertyPage ();
56
57 PROPSHEETPAGE *GetPROPSHEETPAGEPtr ()
58 {
59 return &psp;
60 };
61
62 // FIXME: These should be private and friended to PropSheet.
63 void YouAreBeingAddedToASheet (PropSheet * ps)
64 {
65 OurSheet = ps;
66 };
67 void YouAreFirst ()
68 {
69 IsFirst = true;
70 IsLast = false;
71 };
72 void YouAreLast ()
73 {
74 IsFirst = false;
75 IsLast = true;
76 };
77 void YouAreMiddle ()
78 {
79 IsFirst = false;
80 IsLast = false;
81 };
82
83 virtual bool Create (int TemplateID);
84 virtual bool Create (DLGPROC dlgproc, int TemplateID);
85 virtual bool Create (DLGPROC dlgproc,
86 BOOL (*cmdproc) (HWND h, int id, HWND hwndctl,
87 UINT code), int TemplateID);
88
89 virtual void OnInit ()
90 {
91 };
92 virtual void OnActivate ()
93 {
94 };
95 virtual void OnDeactivate ()
96 {
97 };
98 virtual long OnNext ()
99 {
100 return 0;
101 };
102 virtual long OnBack ()
103 {
104 return 0;
105 };
106 virtual bool OnFinish ()
107 {
108 return true;
109 };
110
111 PropSheet *GetOwner () const
112 {
113 return OurSheet;
114 };
115 };
116
117 #endif // CINSTALL_PROPPAGE_H
This page took 0.046309 seconds and 6 git commands to generate.