The sized controls default HIG compliant sizers under the hood and provides a simple interface for customizing those sizers.
The following sized controls exist:
SizedFrame
SizedDialog
SizedPanel
SizedScrolledPanel
:class SizedStaticBox
The sized controls allow you to create sizer based layouts without having to code the sizers by hand, but still provide you the manual detailed control of the sizer and sizer items if necessary.
Sample usage:
import wx
import wx.lib.sized_controls as sc
app = wx.App(0)
frame = sc.SizedFrame(None, -1, "A sized frame")
pane = frame.GetContentsPane()
pane.SetSizerType("horizontal")
b1 = wx.Button(pane, wx.ID_ANY)
t1 = wx.TextCtrl(pane, -1)
t1.SetSizerProps(expand=True)
frame.Show()
app.MainLoop()
GetDefaultBorder |
Return the platform specific default border. |
GetDefaultPanelBorder |
Default panel border is set to 0 by default as the child control |
GetDialogBorder |
Get the platform specific dialog border. |
GetHGrow |
Get the horizontal grow value. |
GetSizerProps |
Returns a dictionary of prop name + value. |
GetVGrow |
Get the vertical grow value. |
SetDefaultSizerProps |
Set default sizer properties. |
SetHGrow |
Set horizontal grow proportion. |
SetSizerProp |
Sets a sizer property |
SetSizerProps |
Allows to set multiple sizer properties |
SetVGrow |
Set vertical grow proportion. |
SizedDialog |
A sized dialog |
SizedFrame |
A sized frame. |
SizedPanel |
A sized panel. |
SizedParent |
Mixin class for some methods used by the Sized* classes. |
SizedScrolledPanel |
A sized scrolled panel. |
SizedStaticBox |
GetDefaultBorder
(self)¶Return the platform specific default border.
Return type: | int |
---|
GetDefaultPanelBorder
(self)¶Default panel border is set to 0 by default as the child control will set their borders.
GetDialogBorder
(self)¶Get the platform specific dialog border.
Return type: | int |
---|
GetHGrow
(self)¶Get the horizontal grow value.
Return type: | int |
---|
GetSizerProps
(self)¶Returns a dictionary of prop name + value.
GetVGrow
(self)¶Get the vertical grow value.
Return type: | int |
---|
SetDefaultSizerProps
(self)¶Set default sizer properties.
SetHGrow
(self, proportion)¶Set horizontal grow proportion.
Parameters: | proportion (int) – proportion to use |
---|
SetSizerProp
(self, prop, value)¶Sets a sizer property
Sample usages:
control.SetSizerProp('expand', True)
Parameters: |
|
---|
SetSizerProps
(self, props={}, **kwargs)¶Allows to set multiple sizer properties
Sample usages:
control.SetSizerProps(expand=True, proportion=1)
control.SetSizerProps(expand=True, valign='center', border=(['top',
'bottom'], 5))
control.SetSizerProps({'growable_row': (1, 1),
'growable_col': (0, 1),})
Parameters: |
|
---|
SetVGrow
(self, proportion)¶Set vertical grow proportion.
Parameters: | proportion (int) – proportion to use |
---|