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.
28 #include "ControlAdjuster.h"
32 class PropertyPage
:public Window
34 static bool DoOnceForSheet
;
37 BOOL (*cmdproc
) (HWND h
, int id
, HWND hwndctl
, UINT code
);
39 // The sheet that owns this page.
42 // For setting the back/finish buttons properly.
45 static INT_PTR CALLBACK
FirstDialogProcReflector (HWND hwnd
, UINT message
,
48 static INT_PTR CALLBACK
DialogProcReflector (HWND hwnd
, UINT message
,
49 WPARAM wParam
, LPARAM lParam
);
52 // this is an internal structure that is used to store information
53 // about static text controls in the dialog that have been turned
54 // into clickable URLs
57 // the URL to load when clicked
60 // location of the control's original winproc that we are subclassing
63 // font handle; note: it's our responsibility to DeleteObject() this
66 // handle to the brush we return in response to WM_CTLCOLORSTATIC
70 // the list of controls that we have modified to be clickable is
71 // stored in the following which maps the ID to the above data
72 static std::map
<int, ClickableURL
> urls
;
74 // subclass the static control with this winproc
75 static LRESULT CALLBACK
urlWinProc (HWND hwnd
, UINT uMsg
, WPARAM wParam
,
79 SizeProcessor sizeProcessor
;
81 virtual INT_PTR CALLBACK
DialogProc (UINT message
, WPARAM wParam
,
83 virtual INT_PTR CALLBACK
OnMouseWheel (UINT message
, WPARAM wParam
,
85 virtual INT_PTR CALLBACK
OnTimerMessage (UINT message
, WPARAM wParam
,
90 virtual ~ PropertyPage ();
92 PROPSHEETPAGE
*GetPROPSHEETPAGEPtr ()
97 // FIXME: These should be private and friended to PropSheet.
98 void YouAreBeingAddedToASheet (PropSheet
* ps
)
118 virtual bool Create (int TemplateID
);
119 virtual bool Create (DLGPROC dlgproc
, int TemplateID
);
120 virtual bool Create (DLGPROC dlgproc
,
121 BOOL (*cmdproc
) (HWND h
, int id
, HWND hwndctl
,
122 UINT code
), int TemplateID
);
124 virtual void OnInit ()
127 virtual void OnActivate ()
130 virtual bool wantsActivation () const
134 virtual void OnDeactivate ()
138 // Overload these to perform special processing when the user hits
139 // "Next" or "Back". Return:
140 // 0 == Go to next/previous page in sequence.
141 // -1 == Prevent wizard from changing page.
142 // Resource ID == go to a specific page specified by the resource ID.
143 virtual long OnNext ()
147 virtual long OnBack ()
152 virtual bool OnFinish ()
156 virtual long OnUnattended ()
161 PropSheet
*GetOwner () const
166 void makeClickable (int id
, std::string link
);
169 #endif /* SETUP_PROPPAGE_H */