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"
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
);
78 // Set and get the notebook
79 void SetBookCtrl(wxBookCtrlBase
* book
) { m_bookCtrl
= book
; }
80 wxBookCtrlBase
* GetBookCtrl() const { return m_bookCtrl
; }
82 // Set and get the inner sizer
83 void SetInnerSize(wxSizer
* sizer
) { m_innerSizer
= sizer
; }
84 wxSizer
* GetInnerSizer() const { return m_innerSizer
; }
88 // Creates the buttons (none on PocketPC)
89 virtual void CreateButtons(int flags
= wxOK
|wxCANCEL
);
91 // Lay out the dialog, to be called after pages have been created
92 virtual void LayoutDialog();
96 // Creates the book control. If you want to use a different kind of
98 virtual wxBookCtrlBase
* CreateBookCtrl();
100 // Adds the book control to the inner sizer.
101 virtual void AddBookCtrl(wxSizer
* sizer
);
104 wxBookCtrlBase
* m_bookCtrl
;
105 wxSizer
* m_innerSizer
; // sizer for extra space
107 DECLARE_DYNAMIC_CLASS(wxPropertySheetDialog
)
110 #endif // _WX_PROPDLG_H_