This class represents a property sheet dialog: a tabbed dialog for showing settings.
It is optimized to show flat tabs on PocketPC devices, and can be customized to use different controllers instead of the default notebook style.
To use this class, call Create
from your own Create function. Then call CreateButtons
, and create pages, adding them to the book control. Finally call LayoutDialog
.
For example:
# To be written...
If necessary, override CreateBookCtrl
and AddBookCtrl
to create and add a different kind of book control. You will then need to use two-step construction for the dialog or change the style of the book control by calling SetSheetStyle
before calling Create
.
The Dialogs Sample shows this class being used with notebook and toolbook controllers (for Windows-style and Mac-style settings dialogs).
To make pages of the dialog scroll when the display is too small to fit the whole dialog, you can switch layout adaptation on globally with wx.Dialog.EnableLayoutAdaptation
or per dialog with wx.Dialog.SetLayoutAdaptationMode
.
For more about layout adaptation, see Automatic Scrolled Dialogs.
__init__ |
Default constructor. |
AddBookCtrl |
Override this if you wish to add the book control in a way different from the standard way (for example, using different spacing). |
Create |
Call this from your own Create function, before adding buttons and pages. |
CreateBookCtrl |
Override this if you wish to create a different kind of book control; by default, the value passed to SetSheetStyle is used to determine the control. |
CreateButtons |
Call this to create the buttons for the dialog. |
GetBookCtrl |
Returns the book control that will contain your settings pages. |
GetContentWindow |
Override this to return a window containing the main content of the dialog. |
GetInnerSizer |
Returns the inner sizer that contains the book control and button sizer. |
GetSheetInnerBorder |
Returns the border around the book control only. |
GetSheetOuterBorder |
Returns the border around the whole dialog. |
GetSheetStyle |
Returns the sheet style. |
LayoutDialog |
Call this to lay out the dialog. |
SetBookCtrl |
Sets the book control used for the dialog. |
SetInnerSizer |
Set the inner sizer that contains the book control and button sizer. |
SetSheetInnerBorder |
Set the border around the book control only. |
SetSheetOuterBorder |
Set the border around the whole dialog. |
SetSheetStyle |
You can customize the look and feel of the dialog by setting the sheet style. |
BookCtrl |
See GetBookCtrl and SetBookCtrl |
ContentWindow |
See GetContentWindow |
InnerSizer |
See GetInnerSizer and SetInnerSizer |
SheetInnerBorder |
See GetSheetInnerBorder and SetSheetInnerBorder |
SheetOuterBorder |
See GetSheetOuterBorder and SetSheetOuterBorder |
SheetStyle |
See GetSheetStyle and SetSheetStyle |
wx.adv.
PropertySheetDialog
(Dialog)¶Possible constructors:
PropertySheetDialog()
PropertySheetDialog(parent, id=ID_ANY, title="", pos=DefaultPosition,
size=DefaultSize, style=DEFAULT_DIALOG_STYLE, name=DialogNameStr)
This class represents a property sheet dialog: a tabbed dialog for showing settings.
__init__
(self, *args, **kw)¶__init__ (self)
Default constructor.
Call Create if using this form of constructor.
__init__ (self, parent, id=ID_ANY, title=””, pos=DefaultPosition, size=DefaultSize, style=DEFAULT_DIALOG_STYLE, name=DialogNameStr)
Constructor.
Parameters: |
---|
AddBookCtrl
(self, sizer)¶Override this if you wish to add the book control in a way different from the standard way (for example, using different spacing).
Parameters: | sizer (wx.Sizer) – |
---|
Create
(self, parent, id=ID_ANY, title="", pos=DefaultPosition, size=DefaultSize, style=DEFAULT_DIALOG_STYLE, name=DialogNameStr)¶Call this from your own Create function, before adding buttons and pages.
Parameters: | |
---|---|
Return type: | bool |
CreateBookCtrl
(self)¶Override this if you wish to create a different kind of book control; by default, the value passed to SetSheetStyle
is used to determine the control.
The default behaviour is to create a notebook except on Smartphone, where a choicebook is used.
Return type: | BookCtrlBase |
---|
CreateButtons
(self, flags=OK|CANCEL)¶Call this to create the buttons for the dialog.
This calls wx.Dialog.CreateButtonSizer
, and the flags are the same.
Parameters: | flags (int) – |
---|
Note
On PocketPC, no buttons are created.
GetBookCtrl
(self)¶Returns the book control that will contain your settings pages.
Return type: | BookCtrlBase |
---|
GetContentWindow
(self)¶Override this to return a window containing the main content of the dialog.
This is particularly useful when the dialog implements pages, such as wx.adv.PropertySheetDialog, and allows the layout adaptation code to know that only the pages need to be made scrollable.
Return type: | Window |
---|
GetInnerSizer
(self)¶Returns the inner sizer that contains the book control and button sizer.
Return type: | Sizer |
---|
GetSheetInnerBorder
(self)¶Returns the border around the book control only.
Return type: | int |
---|
GetSheetOuterBorder
(self)¶Returns the border around the whole dialog.
Return type: | int |
---|
GetSheetStyle
(self)¶Returns the sheet style.
See SetSheetStyle
for allowed values.
Return type: | long |
---|
LayoutDialog
(self, centreFlags=BOTH)¶Call this to lay out the dialog.
Parameters: | centreFlags (int) – |
---|
Note
On PocketPC, this does nothing, since the dialog will be shown full-screen, and the layout will be done when the dialog receives a size event.
SetBookCtrl
(self, bookCtrl)¶Sets the book control used for the dialog.
You will normally not need to use this.
Parameters: | bookCtrl (wx.BookCtrlBase) – |
---|
SetInnerSizer
(self, sizer)¶Set the inner sizer that contains the book control and button sizer.
Parameters: | sizer (wx.Sizer) – |
---|
SetSheetInnerBorder
(self, border)¶Set the border around the book control only.
Parameters: | border (int) – |
---|
SetSheetOuterBorder
(self, border)¶Set the border around the whole dialog.
Parameters: | border (int) – |
---|
SetSheetStyle
(self, style)¶You can customize the look and feel of the dialog by setting the sheet style.
It is a bit list of the wx.adv.PropertySheetDialogFlags values.
Parameters: | style (long) – |
---|
BookCtrl
¶See GetBookCtrl
and SetBookCtrl
ContentWindow
¶See GetContentWindow
InnerSizer
¶See GetInnerSizer
and SetInnerSizer
SheetInnerBorder
¶SheetOuterBorder
¶SheetStyle
¶See GetSheetStyle
and SetSheetStyle