1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/propdlg.h
3 // Purpose: wxPropertySheetDialog
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_PROPDLG_H_
13 #define _WX_PROPDLG_H_
19 class WXDLLEXPORT wxBookCtrlBase
;
21 //-----------------------------------------------------------------------------
22 // wxPropertySheetDialog
23 // A platform-independent properties dialog.
25 // * on PocketPC, a flat-look 'property sheet' notebook will be used, with
26 // no OK/Cancel/Help buttons
27 // * on other platforms, a normal notebook will be used, with standard buttons
29 // To use this class, call Create from your derived class.
30 // Then create pages and add to the book control. Finally call CreateButtons and
35 // MyPropertySheetDialog::Create(...)
37 // wxPropertySheetDialog::Create(...);
40 // wxPanel* panel = new wxPanel(GetBookCtrl(), ...);
41 // GetBookCtrl()->AddPage(panel, wxT("General"));
47 // Override CreateBookCtrl and AddBookCtrl to create and add a different
48 // kind of book control.
49 //-----------------------------------------------------------------------------
51 // Use the platform default
52 #define wxPROPSHEET_DEFAULT 0x0001
55 #define wxPROPSHEET_NOTEBOOK 0x0002
58 #define wxPROPSHEET_TOOLBOOK 0x0004
61 #define wxPROPSHEET_CHOICEBOOK 0x0008
64 #define wxPROPSHEET_LISTBOOK 0x0010
66 // Shrink dialog to fit current page
67 #define wxPROPSHEET_SHRINKTOFIT 0x0100
69 class WXDLLIMPEXP_ADV wxPropertySheetDialog
: public wxDialog
72 wxPropertySheetDialog() : wxDialog() { Init(); }
74 wxPropertySheetDialog(wxWindow
* parent
, wxWindowID id
,
75 const wxString
& title
,
76 const wxPoint
& pos
= wxDefaultPosition
,
77 const wxSize
& sz
= wxDefaultSize
,
78 long style
= wxDEFAULT_DIALOG_STYLE
,
79 const wxString
& name
= wxDialogNameStr
)
82 Create(parent
, id
, title
, pos
, sz
, style
, name
);
85 bool Create(wxWindow
* parent
, wxWindowID id
,
86 const wxString
& title
,
87 const wxPoint
& pos
= wxDefaultPosition
,
88 const wxSize
& sz
= wxDefaultSize
,
89 long style
= wxDEFAULT_DIALOG_STYLE
,
90 const wxString
& name
= wxDialogNameStr
);
94 // Set and get the notebook
95 void SetBookCtrl(wxBookCtrlBase
* book
) { m_bookCtrl
= book
; }
96 wxBookCtrlBase
* GetBookCtrl() const { return m_bookCtrl
; }
98 // Set and get the inner sizer
99 void SetInnerSize(wxSizer
* sizer
) { m_innerSizer
= sizer
; }
100 wxSizer
* GetInnerSizer() const { return m_innerSizer
; }
102 // Set and get the book style
103 void SetSheetStyle(long sheetStyle
) { m_sheetStyle
= sheetStyle
; }
104 long GetSheetStyle() const { return m_sheetStyle
; }
108 // Creates the buttons (none on PocketPC)
109 virtual void CreateButtons(int flags
= wxOK
|wxCANCEL
);
111 // Lay out the dialog, to be called after pages have been created
112 virtual void LayoutDialog(int centreFlags
= wxBOTH
);
116 // Creates the book control. If you want to use a different kind of
117 // control, override.
118 virtual wxBookCtrlBase
* CreateBookCtrl();
120 // Adds the book control to the inner sizer.
121 virtual void AddBookCtrl(wxSizer
* sizer
);
124 void OnActivate(wxActivateEvent
& event
);
126 // Resize dialog if necessary
127 void OnIdle(wxIdleEvent
& event
);
133 wxBookCtrlBase
* m_bookCtrl
;
134 wxSizer
* m_innerSizer
; // sizer for extra space
138 DECLARE_DYNAMIC_CLASS(wxPropertySheetDialog
)
139 DECLARE_EVENT_TABLE()
142 #endif // wxUSE_BOOKCTRL
144 #endif // _WX_PROPDLG_H_