1// Windows/Control/PropertyPage.h
2
3#ifndef __WINDOWS_CONTROL_PROPERTYPAGE_H
4#define __WINDOWS_CONTROL_PROPERTYPAGE_H
5
6#include <prsht.h>
7
8#include "Dialog.h"
9
10namespace NWindows {
11namespace NControl {
12
13INT_PTR APIENTRY ProperyPageProcedure(HWND dialogHWND, UINT message, WPARAM wParam, LPARAM lParam);
14
15class CPropertyPage: public CDialog
16{
17public:
18  CPropertyPage(HWND window = NULL): CDialog(window){};
19
20  void Changed() { PropSheet_Changed(GetParent(), (HWND)*this); }
21  void UnChanged() { PropSheet_UnChanged(GetParent(), (HWND)*this); }
22
23  virtual bool OnNotify(UINT controlID, LPNMHDR lParam);
24
25  virtual bool OnKillActive() { return false; } // false = OK
26  virtual bool OnKillActive(const PSHNOTIFY *) { return OnKillActive(); }
27  virtual LONG OnSetActive() { return false; } // false = OK
28  virtual LONG OnSetActive(const PSHNOTIFY *) { return OnSetActive(); }
29  virtual LONG OnApply() { return PSNRET_NOERROR; }
30  virtual LONG OnApply(const PSHNOTIFY *) { return OnApply(); }
31  virtual void OnNotifyHelp() {}
32  virtual void OnNotifyHelp(const PSHNOTIFY *) { OnNotifyHelp(); }
33  virtual void OnReset() {}
34  virtual void OnReset(const PSHNOTIFY *) { OnReset(); }
35};
36
37struct CPageInfo
38{
39  CPropertyPage *Page;
40  UString Title;
41  UINT ID;
42};
43
44INT_PTR MyPropertySheet(const CObjectVector<CPageInfo> &pagesInfo, HWND hwndParent, const UString &title);
45
46}}
47
48#endif
49