]>
git.saurik.com Git - wxWidgets.git/blob - interface/propdlg.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxPropertySheetDialog
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxPropertySheetDialog
13 This class represents a property sheet dialog: a tabbed dialog
14 for showing settings. It is optimized to show flat tabs
15 on PocketPC devices, and can be customized to use different
16 controllers instead of the default notebook style.
18 To use this class, call wxPropertySheetDialog::Create from your own
19 Create function. Then call wxPropertySheetDialog::CreateButtons, and create
20 pages, adding them to the book control.
21 Finally call wxPropertySheetDialog::LayoutDialog.
26 bool MyPropertySheetDialog::Create(...)
28 if (!wxPropertySheetDialog::Create(...))
31 CreateButtons(wxOK|wxCANCEL|wxHELP);
34 wxPanel* panel = new wxPanel(GetBookCtrl(), ...);
35 GetBookCtrl()-AddPage(panel, wxT("General"));
42 If necessary, override CreateBookCtrl and AddBookCtrl to create and add a
44 kind of book control. You would then need to use two-step construction for the
46 Or, change the style of book control by calling
47 wxPropertySheetDialog::SetSheetStyle
48 before calling Create.
50 The dialogs sample shows this class being used with notebook and toolbook
52 Windows-style and Mac-style settings dialogs).
54 To make pages of the dialog scroll when the display is too small to fit the
55 whole dialog, you can switch
56 layout adaptation on globally with wxDialog::EnableLayoutAdaptation or
57 per dialog with wxDialog::SetLayoutAdaptationMode. For more
58 about layout adaptation, see @ref overview_autoscrollingdialogs "Automatic
64 class wxPropertySheetDialog
: public wxDialog
70 wxPropertySheetDialog(wxWindow
* parent
, wxWindowID id
,
71 const wxString
& title
,
72 const wxPoint
& pos
= wxDefaultPosition
,
73 const wxSize
& size
= wxDefaultSize
,
74 long style
= wxDEFAULT_DIALOG_STYLE
,
75 const wxString
& name
= "dialogBox");
78 Override this if you wish to add the book control in a way different from the
79 standard way (for example, using different spacing).
81 virtual void AddBookCtrl(wxSizer
* sizer
);
84 Call this from your own Create function, before adding buttons and pages.
86 bool Create(wxWindow
* parent
, wxWindowID id
,
87 const wxString
& title
,
88 const wxPoint
& pos
= wxDefaultPosition
,
89 const wxSize
& size
= wxDefaultSize
,
90 long style
= wxDEFAULT_DIALOG_STYLE
,
91 const wxString
& name
= "dialogBox");
94 Override this if you wish to create a different kind of book control; by
96 passed to SetSheetStyle() is used to determine the control.
97 The default behaviour is to create a notebook except on Smartphone, where a
100 virtual wxBookCtrlBase
* CreateBookCtrl();
103 Call this to create the buttons for the dialog. This calls
104 wxDialog::CreateButtonSizer, and
105 the flags are the same. On PocketPC, no buttons are created.
107 void CreateButtons(int flags
= wxOK
|wxCANCEL
);
110 Returns the book control that will contain your settings pages.
112 wxBookCtrlBase
* GetBookCtrl() const;
115 Returns the inner sizer that contains the book control and button sizer.
117 wxSizer
* GetInnerSizer() const;
120 Returns the sheet style. See SetSheetStyle() for
123 long GetSheetStyle() const;
126 Call this to lay out the dialog. On PocketPC, this does nothing, since the
128 full-screen, and the layout will be done when the dialog receives a size event.
130 void LayoutDialog(int centreFlags
= wxBOTH
);
133 Sets the book control used for the dialog. You will normally not need to use
136 void SetBookCtrl(wxBookCtrlBase
* bookCtrl
);
139 Sets the inner sizer that contains the book control and button sizer. You will
140 normally not need to use this.
142 void SetInnerSizer(wxSizer
* sizer
);
145 You can customize the look and feel of the dialog by setting the sheet style.
147 a bit list of the following values:
151 Uses the default look and feel for the controller window,
152 normally a notebook except on Smartphone where a choice control is used.
156 Uses a notebook for the controller window.
160 Uses a toolbook for the controller window.
162 wxPROPSHEET_CHOICEBOOK
164 Uses a choicebook for the controller window.
168 Uses a listbook for the controller window.
172 Uses a treebook for the controller window.
174 wxPROPSHEET_SHRINKTOFIT
176 Shrinks the dialog window to fit the currently selected page (common behaviour
178 property sheets on Mac OS X).
180 void SetSheetStyle(long style
);