]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/latex/wx/propdlg.tex
added wxListBox::HitTest() from Ryan (patch 1446207)
[wxWidgets.git] / docs / latex / wx / propdlg.tex
... / ...
CommitLineData
1\section{\class{wxPropertySheetDialog}}\label{wxpropertysheetdialog}
2
3This class represents a property sheet dialog: a tabbed dialog
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.
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.
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).
38
39\wxheading{Derived from}
40
41\helpref{wxDialog}{wxdialog}\\
42\helpref{wxWindow}{wxwindow}\\
43\helpref{wxEvtHandler}{wxevthandler}\\
44\helpref{wxObject}{wxobject}
45
46\wxheading{Include files}
47
48<wx/propdlg.h>
49<wx/generic/propdlg.h>
50
51\latexignore{\rtfignore{\wxheading{Members}}}
52
53\membersection{wxPropertySheetDialog::wxPropertySheetDialog}\label{wxpropertysheetdialogctor}
54
55\func{}{wxPropertySheetDialog}{\param{wxWindow* }{parent}, \param{wxWindowID }{id},\rtfsp
56\param{const wxString\& }{title},\rtfsp
57\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
58\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
59\param{long}{ style = wxDEFAULT\_DIALOG\_STYLE},\rtfsp
60\param{const wxString\& }{name = ``dialogBox"}}
61
62Constructor.
63
64\membersection{wxPropertySheetDialog::AddBookCtrl}\label{wxpropertysheetdialogaddbookctrl}
65
66\func{virtual void}{AddBookCtrl}{\param{wxSizer* }{sizer}}
67
68Override this if you wish to add the book control in a way different from the
69standard way (for example, using different spacing).
70
71\membersection{wxPropertySheetDialog::Create}\label{wxpropertysheetdialogcreate}
72
73\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id},\rtfsp
74\param{const wxString\& }{title},\rtfsp
75\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
76\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
77\param{long}{ style = wxDEFAULT\_DIALOG\_STYLE},\rtfsp
78\param{const wxString\& }{name = ``dialogBox"}}
79
80Call this from your own Create function, before adding buttons and pages.
81
82\membersection{wxPropertySheetDialog::CreateBookCtrl}\label{wxpropertysheetdialogcreatebookctrl}
83
84\func{virtual wxBookCtrlBase*}{CreateBookCtrl}{\void}
85
86Override this if you wish to create a different kind of book control; by default, the value
87passed to \helpref{SetSheetStyle}{wxpropertysheetdialogsetsheetstyle} is used to determine the control.
88The default behaviour is to create a notebook except on Smartphone, where a choicebook is used.
89
90\membersection{wxPropertySheetDialog::CreateButtons}\label{wxpropertysheetdialogcreatebuttons}
91
92\func{void}{CreateButtons}{\param{int }{flags=wxOK|wxCANCEL}}
93
94Call this to create the buttons for the dialog. This calls \helpref{wxDialog::CreateButtonSizer}{wxdialogcreatebuttonsizer}, and
95the flags are the same. On PocketPC, no buttons are created.
96
97\membersection{wxPropertySheetDialog::GetBookCtrl}\label{wxpropertysheetdialoggetbookctrl}
98
99\constfunc{wxBookCtrlBase*}{GetBookCtrl}{\void}
100
101Returns the book control that will contain your settings pages.
102
103\membersection{wxPropertySheetDialog::GetInnerSizer}\label{wxpropertysheetdialoggetinnersizer}
104
105\constfunc{wxSizer*}{GetInnerSizer}{\void}
106
107Returns the inner sizer that contains the book control and button sizer.
108
109\membersection{wxPropertySheetDialog::GetSheetStyle}\label{wxpropertysheetdialoggetsheetstyle}
110
111\constfunc{long}{GetSheetStyle}{\void}
112
113Returns the sheet style. See \helpref{SetSheetStyle}{wxpropertysheetdialogsetsheetstyle} for
114permissable values.
115
116\membersection{wxPropertySheetDialog::LayoutDialog}\label{wxpropertysheetdialoglayoutdialog}
117
118\func{void}{LayoutDialog}{\param{int}{ centreFlags=wxBOTH}}
119
120Call this to lay out the dialog. On PocketPC, this does nothing, since the dialog will be shown
121full-screen, and the layout will be done when the dialog receives a size event.
122
123\membersection{wxPropertySheetDialog::SetBookCtrl}\label{wxpropertysheetdialogsetbookctrl}
124
125\func{void}{SetBookCtrl}{\param{wxBookCtrlBase* }{bookCtrl}}
126
127Sets the book control used for the dialog. You will normally not need to use this.
128
129\membersection{wxPropertySheetDialog::SetInnerSizer}\label{wxpropertysheetdialogsetinnersizer}
130
131\func{void}{SetInnerSizer}{\param{wxSizer*}{ sizer}}
132
133Sets the inner sizer that contains the book control and button sizer. You will normally not need to use this.
134
135\membersection{wxPropertySheetDialog::SetSheetStyle}\label{wxpropertysheetdialogsetsheetstyle}
136
137\func{void}{SetSheetStyle}{\param{long}{ style}}
138
139You can customize the look and feel of the dialog by setting the sheet style. It is
140a bit list of the following values:
141
142\twocolwidtha{5cm}
143\begin{twocollist}\itemsep=0pt
144\twocolitem{wxPROPSHEET\_DEFAULT}{Uses the default look and feel for the controller window,
145normally a notebook except on Smartphone where a choice control is used.}
146\twocolitem{wxPROPSHEET\_NOTEBOOK}{Uses a notebook for the controller window.}
147\twocolitem{wxPROPSHEET\_TOOLBOOK}{Uses a toolbook for the controller window.}
148\twocolitem{wxPROPSHEET\_CHOICEBOOK}{Uses a choicebook for the controller window.}
149\twocolitem{wxPROPSHEET\_LISTBOOK}{Uses a listbook for the controller window.}
150\twocolitem{wxPROPSHEET\_SHRINKTOFIT}{Shrinks the dialog window to fit the currently selected page (common behaviour for
151property sheets on Mac OS X).}
152\end{twocollist}
153