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.
wx.richtext.RichTextFormattingDialog
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. |
See |
|
See |
|
See |
|
See |
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.
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).
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.
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.
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.
flags (int) –
Note
On PocketPC, no buttons are created.
GetBookCtrl
(self)¶Returns the book control that will contain your settings pages.
BookCtrlBase
GetClassDefaultAttributes
(variant=WINDOW_VARIANT_NORMAL)¶variant (WindowVariant) –
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.
Window
GetInnerSizer
(self)¶Returns the inner sizer that contains the book control and button sizer.
Sizer
GetSheetInnerBorder
(self)¶Returns the border around the book control only.
int
GetSheetOuterBorder
(self)¶Returns the border around the whole dialog.
int
GetSheetStyle
(self)¶Returns the sheet style.
See SetSheetStyle
for allowed values.
long
LayoutDialog
(self, centreFlags=BOTH)¶Call this to lay out the dialog.
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.
bookCtrl (wx.BookCtrlBase) –
SetInnerSizer
(self, sizer)¶Set the inner sizer that contains the book control and button sizer.
sizer (wx.Sizer) –
SetSheetInnerBorder
(self, border)¶Set the border around the book control only.
border (int) –
SetSheetOuterBorder
(self, border)¶Set the border around the whole dialog.
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.
style (long) –
BookCtrl
¶See GetBookCtrl
and SetBookCtrl
ContentWindow
¶See GetContentWindow
InnerSizer
¶See GetInnerSizer
and SetInnerSizer
SheetInnerBorder
¶SheetOuterBorder
¶SheetStyle
¶See GetSheetStyle
and SetSheetStyle