2 * Copyright (c) 2001, 2002, 2003 Gary R. Van Sickle.
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.
9 * A copy of the GNU General Public License can be found at
12 * Written by Gary R. Van Sickle <g.r.vansickle@worldnet.att.net>
16 #ifndef SETUP_PROPPAGE_H
17 #define SETUP_PROPPAGE_H
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.
29 #include "ControlAdjuster.h"
33 class PropertyPage
:public Window
35 static bool DoOnceForSheet
;
38 BOOL (*cmdproc
) (HWND h
, int id
, HWND hwndctl
, UINT code
);
40 // The sheet that owns this page.
43 // For setting the back/finish buttons properly.
46 static BOOL CALLBACK
FirstDialogProcReflector (HWND hwnd
, UINT message
,
49 static BOOL CALLBACK
DialogProcReflector (HWND hwnd
, UINT message
,
50 WPARAM wParam
, LPARAM lParam
);
53 // this is an internal structure that is used to store information
54 // about static text controls in the dialog that have been turned
55 // into clickable URLs
58 // the URL to load when clicked
61 // location of the control's original winproc that we are subclassing
64 // font handle; note: it's our responsibility to DeleteObject() this
67 // handle to the brush we return in response to WM_CTLCOLORSTATIC
71 // the list of controls that we have modified to be clickable is
72 // stored in the following which maps the ID to the above data
73 static std::map
<int, ClickableURL
> urls
;
75 // subclass the static control with this winproc
76 static LRESULT CALLBACK
urlWinProc (HWND hwnd
, UINT uMsg
, WPARAM wParam
,
80 SizeProcessor sizeProcessor
;
82 virtual BOOL CALLBACK
DialogProc (UINT message
, WPARAM wParam
,
87 virtual ~ PropertyPage ();
89 PROPSHEETPAGE
*GetPROPSHEETPAGEPtr ()
94 // FIXME: These should be private and friended to PropSheet.
95 void YouAreBeingAddedToASheet (PropSheet
* ps
)
115 virtual bool Create (int TemplateID
);
116 virtual bool Create (DLGPROC dlgproc
, int TemplateID
);
117 virtual bool Create (DLGPROC dlgproc
,
118 BOOL (*cmdproc
) (HWND h
, int id
, HWND hwndctl
,
119 UINT code
), int TemplateID
);
121 virtual void OnInit ()
124 virtual void OnActivate ()
127 virtual bool wantsActivation () const
131 virtual void OnDeactivate ()
135 // Overload these to perform special processing when the user hits
136 // "Next" or "Back". Return:
137 // 0 == Go to next/previous page in sequence.
138 // -1 == Prevent wizard from changing page.
139 // Resource ID == go to a specific page specified by the resource ID.
140 virtual long OnNext ()
144 virtual long OnBack ()
149 virtual bool OnFinish ()
153 virtual long OnUnattended ()
158 PropSheet
*GetOwner () const
163 void makeClickable (int id
, String URL
);
166 #endif /* SETUP_PROPPAGE_H */