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