wx.adv.PropertySheetDialog¶
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.
Class Hierarchy¶
Known Subclasses¶
wx.richtext.RichTextFormattingDialog
Methods Summary¶
Default constructor. |
|
Override this if you wish to add the book control in a way different from the standard way (for example, using different spacing). |
|
Call this from your own Create function, before adding buttons and pages. |
|
Override this if you wish to create a different kind of book control; by default, the value passed to |
|
Call this to create the buttons for the dialog. |
|
Returns the book control that will contain your settings pages. |
|
Override this to return a window containing the main content of the dialog. |
|
Returns the inner sizer that contains the book control and button sizer. |
|
Returns the border around the book control only. |
|
Returns the border around the whole dialog. |
|
Returns the sheet style. |
|
Call this to lay out the dialog. |
|
Sets the book control used for the dialog. |
|
Set the inner sizer that contains the book control and button sizer. |
|
Set the border around the book control only. |
|
Set the border around the whole dialog. |
|
You can customize the look and feel of the dialog by setting the sheet style. |
Properties Summary¶
See |
|
See |
|
See |
|
See |
Class API¶
- class wx.adv.PropertySheetDialog(Dialog)¶
Possible constructors:
PropertySheetDialog() -> None PropertySheetDialog(parent, id=ID_ANY, title='', pos=DefaultPosition, size=DefaultSize, style=DEFAULT_DIALOG_STYLE, name=DialogNameStr) -> None
This class represents a property sheet dialog: a tabbed dialog for showing settings.
Methods¶
- __init__(self, *args, **kw)¶
-
__init__ (self)
Default constructor.
Call Create if using this form of constructor.
- Return type:
None
__init__ (self, parent, id=ID_ANY, title=’’, pos=DefaultPosition, size=DefaultSize, style=DEFAULT_DIALOG_STYLE, name=DialogNameStr)
Constructor.
- Parameters:
- Return type:
None
- 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)
- Return type:
None
- 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.
- 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)
- Return type:
None
Note
On PocketPC, no buttons are created.
- GetBookCtrl(self)¶
Returns the book control that will contain your settings pages.
- Return type:
BookCtrlBase
- static GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)¶
- Parameters:
variant (WindowVariant)
- Return type:
VisualAttributes
- 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:
int
- LayoutDialog(self, centreFlags=BOTH)¶
Call this to lay out the dialog.
- Parameters:
centreFlags (int)
- Return type:
None
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)
- Return type:
None
- SetInnerSizer(self, sizer)¶
Set the inner sizer that contains the book control and button sizer.
- Parameters:
sizer (wx.Sizer)
- Return type:
None
- SetSheetInnerBorder(self, border)¶
Set the border around the book control only.
- Parameters:
border (int)
- Return type:
None
- SetSheetOuterBorder(self, border)¶
Set the border around the whole dialog.
- Parameters:
border (int)
- Return type:
None
- 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)
- Return type:
None
Properties¶
- BookCtrl¶
See
GetBookCtrl
andSetBookCtrl
- ContentWindow¶
See
GetContentWindow
- InnerSizer¶
See
GetInnerSizer
andSetInnerSizer
- SheetInnerBorder¶
- SheetOuterBorder¶
- SheetStyle¶
See
GetSheetStyle
andSetSheetStyle