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_
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "propdlg.h"
23 class WXDLLEXPORT wxBookCtrlBase
;
25 //-----------------------------------------------------------------------------
26 // wxPropertySheetDialog
27 // A platform-independent properties dialog.
29 // * on PocketPC, a flat-look 'property sheet' notebook will be used, with
30 // no OK/Cancel/Help buttons
31 // * on other platforms, a normal notebook will be used, with standard buttons
33 // To use this class, call Create from your derived class.
34 // Then create pages and add to the book control. Finally call CreateButtons and
39 // MyPropertySheetDialog::Create(...)
41 // wxPropertySheetDialog::Create(...);
44 // wxPanel* panel = new wxPanel(GetBookCtrl(), ...);
45 // GetBookCtrl()->AddPage(panel, wxT("General"));
51 // Override CreateBookCtrl and AddBookCtrl to create and add a different
52 // kind of book control.
53 //-----------------------------------------------------------------------------
55 class WXDLLIMPEXP_ADV wxPropertySheetDialog
: public wxDialog
58 wxPropertySheetDialog() : wxDialog() { Init(); }
60 wxPropertySheetDialog(wxWindow
* parent
, wxWindowID id
,
61 const wxString
& title
,
62 const wxPoint
& pos
= wxDefaultPosition
,
63 const wxSize
& sz
= wxDefaultSize
,
64 long style
= wxDEFAULT_DIALOG_STYLE
,
65 const wxString
& name
= wxDialogNameStr
)
68 Create(parent
, id
, title
, pos
, sz
, style
, name
);
71 bool Create(wxWindow
* parent
, wxWindowID id
,
72 const wxString
& title
,
73 const wxPoint
& pos
= wxDefaultPosition
,
74 const wxSize
& sz
= wxDefaultSize
,
75 long style
= wxDEFAULT_DIALOG_STYLE
,
76 const wxString
& name
= wxDialogNameStr
);
80 // Set and get the notebook
81 void SetBookCtrl(wxBookCtrlBase
* book
) { m_bookCtrl
= book
; }
82 wxBookCtrlBase
* GetBookCtrl() const { return m_bookCtrl
; }
84 // Set and get the inner sizer
85 void SetInnerSize(wxSizer
* sizer
) { m_innerSizer
= sizer
; }
86 wxSizer
* GetInnerSizer() const { return m_innerSizer
; }
90 // Creates the buttons (none on PocketPC)
91 virtual void CreateButtons(int flags
= wxOK
|wxCANCEL
);
93 // Lay out the dialog, to be called after pages have been created
94 virtual void LayoutDialog();
98 // Creates the book control. If you want to use a different kind of
100 virtual wxBookCtrlBase
* CreateBookCtrl();
102 // Adds the book control to the inner sizer.
103 virtual void AddBookCtrl(wxSizer
* sizer
);
106 void OnActivate(wxActivateEvent
& event
);
112 wxBookCtrlBase
* m_bookCtrl
;
113 wxSizer
* m_innerSizer
; // sizer for extra space
115 DECLARE_DYNAMIC_CLASS(wxPropertySheetDialog
)
116 DECLARE_EVENT_TABLE()
119 #endif // wxUSE_BOOKCTRL
121 #endif // _WX_PROPDLG_H_