]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/propdlg.tex
added wxWindow::AlwaysShowScrollbars() and its wxMac implementation
[wxWidgets.git] / docs / latex / wx / propdlg.tex
CommitLineData
3c9287bb
JS
1\section{\class{wxPropertySheetDialog}}\label{wxpropertysheetdialog}
2
3This class represents a property sheet dialog: a tabbed dialog
cc8bc5aa
JS
4for showing settings. It is optimized to show flat tabs
5on PocketPC devices, and can be customized to use different
6controllers instead of the default notebook style.
3c9287bb
JS
7
8To use this class, call \helpref{wxPropertySheetDialog::Create}{wxpropertysheetdialogcreate} from your own
9Create function. Then call \helpref{CreateButtons}{wxpropertysheetdialogcreatebuttons}, and create pages, adding them to the book control.
10Finally call \helpref{LayoutDialog}{wxpropertysheetdialoglayoutdialog}.
11
12For example:
13
14\begin{verbatim}
15bool MyPropertySheetDialog::Create(...)
16{
17 if (!wxPropertySheetDialog::Create(...))
18 return false;
19
20 CreateButtons(wxOK|wxCANCEL|wxHELP);
21
22 // Add page
23 wxPanel* panel = new wxPanel(GetBookCtrl(), ...);
24 GetBookCtrl()->AddPage(panel, wxT("General"));
25
26 LayoutDialog();
27 return true;
28}
29\end{verbatim}
30
31If necessary, override CreateBookCtrl and AddBookCtrl to create and add a different
32kind of book control. You would then need to use two-step construction for the dialog.
cc8bc5aa
JS
33Or, change the style of book control by calling \helpref{SetSheetStyle}{wxpropertysheetdialogsetsheetstyle}
34before calling Create.
35
36The dialogs sample shows this class being used with notebook and toolbook controllers (for
37Windows-style and Mac-style settings dialogs).
3c9287bb
JS
38
39\wxheading{Derived from}
40
41\helpref{wxDialog}{wxdialog}\\
7376079d 42\helpref{wxTopLevelWindow}{wxtoplevelwindow}\\
3c9287bb
JS
43\helpref{wxWindow}{wxwindow}\\
44\helpref{wxEvtHandler}{wxevthandler}\\
45\helpref{wxObject}{wxobject}
46
47\wxheading{Include files}
48
49<wx/propdlg.h>
50<wx/generic/propdlg.h>
a7af285d
VZ
51\wxheading{Library}
52
53\helpref{wxAdv}{librarieslist}
54
3c9287bb
JS
55
56\latexignore{\rtfignore{\wxheading{Members}}}
57
58\membersection{wxPropertySheetDialog::wxPropertySheetDialog}\label{wxpropertysheetdialogctor}
59
60\func{}{wxPropertySheetDialog}{\param{wxWindow* }{parent}, \param{wxWindowID }{id},\rtfsp
61\param{const wxString\& }{title},\rtfsp
62\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
63\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
64\param{long}{ style = wxDEFAULT\_DIALOG\_STYLE},\rtfsp
65\param{const wxString\& }{name = ``dialogBox"}}
66
67Constructor.
68
69\membersection{wxPropertySheetDialog::AddBookCtrl}\label{wxpropertysheetdialogaddbookctrl}
70
71\func{virtual void}{AddBookCtrl}{\param{wxSizer* }{sizer}}
72
73Override this if you wish to add the book control in a way different from the
74standard way (for example, using different spacing).
75
76\membersection{wxPropertySheetDialog::Create}\label{wxpropertysheetdialogcreate}
77
78\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id},\rtfsp
79\param{const wxString\& }{title},\rtfsp
80\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
81\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
82\param{long}{ style = wxDEFAULT\_DIALOG\_STYLE},\rtfsp
83\param{const wxString\& }{name = ``dialogBox"}}
84
85Call this from your own Create function, before adding buttons and pages.
86
87\membersection{wxPropertySheetDialog::CreateBookCtrl}\label{wxpropertysheetdialogcreatebookctrl}
88
89\func{virtual wxBookCtrlBase*}{CreateBookCtrl}{\void}
90
cc8bc5aa
JS
91Override this if you wish to create a different kind of book control; by default, the value
92passed to \helpref{SetSheetStyle}{wxpropertysheetdialogsetsheetstyle} is used to determine the control.
93The default behaviour is to create a notebook except on Smartphone, where a choicebook is used.
3c9287bb
JS
94
95\membersection{wxPropertySheetDialog::CreateButtons}\label{wxpropertysheetdialogcreatebuttons}
96
97\func{void}{CreateButtons}{\param{int }{flags=wxOK|wxCANCEL}}
98
99Call this to create the buttons for the dialog. This calls \helpref{wxDialog::CreateButtonSizer}{wxdialogcreatebuttonsizer}, and
100the flags are the same. On PocketPC, no buttons are created.
101
102\membersection{wxPropertySheetDialog::GetBookCtrl}\label{wxpropertysheetdialoggetbookctrl}
103
104\constfunc{wxBookCtrlBase*}{GetBookCtrl}{\void}
105
106Returns the book control that will contain your settings pages.
107
108\membersection{wxPropertySheetDialog::GetInnerSizer}\label{wxpropertysheetdialoggetinnersizer}
109
110\constfunc{wxSizer*}{GetInnerSizer}{\void}
111
112Returns the inner sizer that contains the book control and button sizer.
113
cc8bc5aa
JS
114\membersection{wxPropertySheetDialog::GetSheetStyle}\label{wxpropertysheetdialoggetsheetstyle}
115
116\constfunc{long}{GetSheetStyle}{\void}
117
118Returns the sheet style. See \helpref{SetSheetStyle}{wxpropertysheetdialogsetsheetstyle} for
119permissable values.
120
3c9287bb
JS
121\membersection{wxPropertySheetDialog::LayoutDialog}\label{wxpropertysheetdialoglayoutdialog}
122
cc8bc5aa 123\func{void}{LayoutDialog}{\param{int}{ centreFlags=wxBOTH}}
3c9287bb
JS
124
125Call this to lay out the dialog. On PocketPC, this does nothing, since the dialog will be shown
126full-screen, and the layout will be done when the dialog receives a size event.
127
128\membersection{wxPropertySheetDialog::SetBookCtrl}\label{wxpropertysheetdialogsetbookctrl}
129
130\func{void}{SetBookCtrl}{\param{wxBookCtrlBase* }{bookCtrl}}
131
132Sets the book control used for the dialog. You will normally not need to use this.
133
134\membersection{wxPropertySheetDialog::SetInnerSizer}\label{wxpropertysheetdialogsetinnersizer}
135
136\func{void}{SetInnerSizer}{\param{wxSizer*}{ sizer}}
137
138Sets the inner sizer that contains the book control and button sizer. You will normally not need to use this.
139
cc8bc5aa
JS
140\membersection{wxPropertySheetDialog::SetSheetStyle}\label{wxpropertysheetdialogsetsheetstyle}
141
142\func{void}{SetSheetStyle}{\param{long}{ style}}
143
144You can customize the look and feel of the dialog by setting the sheet style. It is
145a bit list of the following values:
146
147\twocolwidtha{5cm}
148\begin{twocollist}\itemsep=0pt
149\twocolitem{wxPROPSHEET\_DEFAULT}{Uses the default look and feel for the controller window,
150normally a notebook except on Smartphone where a choice control is used.}
151\twocolitem{wxPROPSHEET\_NOTEBOOK}{Uses a notebook for the controller window.}
152\twocolitem{wxPROPSHEET\_TOOLBOOK}{Uses a toolbook for the controller window.}
153\twocolitem{wxPROPSHEET\_CHOICEBOOK}{Uses a choicebook for the controller window.}
154\twocolitem{wxPROPSHEET\_LISTBOOK}{Uses a listbook for the controller window.}
6334d903 155\twocolitem{wxPROPSHEET\_TREEBOOK}{Uses a treebook for the controller window.}
cc8bc5aa
JS
156\twocolitem{wxPROPSHEET\_SHRINKTOFIT}{Shrinks the dialog window to fit the currently selected page (common behaviour for
157property sheets on Mac OS X).}
158\end{twocollist}
159