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 class WXDLLIMPEXP_ADV wxPropertySheetDialog
: public wxDialog
54 wxPropertySheetDialog() : wxDialog() { Init(); }
56 wxPropertySheetDialog(wxWindow
* parent
, wxWindowID id
,
57 const wxString
& title
,
58 const wxPoint
& pos
= wxDefaultPosition
,
59 const wxSize
& sz
= wxDefaultSize
,
60 long style
= wxDEFAULT_DIALOG_STYLE
,
61 const wxString
& name
= wxDialogNameStr
)
64 Create(parent
, id
, title
, pos
, sz
, style
, name
);
67 bool Create(wxWindow
* parent
, wxWindowID id
,
68 const wxString
& title
,
69 const wxPoint
& pos
= wxDefaultPosition
,
70 const wxSize
& sz
= wxDefaultSize
,
71 long style
= wxDEFAULT_DIALOG_STYLE
,
72 const wxString
& name
= wxDialogNameStr
);
76 // Set and get the notebook
77 void SetBookCtrl(wxBookCtrlBase
* book
) { m_bookCtrl
= book
; }
78 wxBookCtrlBase
* GetBookCtrl() const { return m_bookCtrl
; }
80 // Set and get the inner sizer
81 void SetInnerSize(wxSizer
* sizer
) { m_innerSizer
= sizer
; }
82 wxSizer
* GetInnerSizer() const { return m_innerSizer
; }
86 // Creates the buttons (none on PocketPC)
87 virtual void CreateButtons(int flags
= wxOK
|wxCANCEL
);
89 // Lay out the dialog, to be called after pages have been created
90 virtual void LayoutDialog();
94 // Creates the book control. If you want to use a different kind of
96 virtual wxBookCtrlBase
* CreateBookCtrl();
98 // Adds the book control to the inner sizer.
99 virtual void AddBookCtrl(wxSizer
* sizer
);
102 void OnActivate(wxActivateEvent
& event
);
108 wxBookCtrlBase
* m_bookCtrl
;
109 wxSizer
* m_innerSizer
; // sizer for extra space
111 DECLARE_DYNAMIC_CLASS(wxPropertySheetDialog
)
112 DECLARE_EVENT_TABLE()
115 #endif // wxUSE_BOOKCTRL
117 #endif // _WX_PROPDLG_H_