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