mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-04 11:00:07 +01:00
Add SizedStaticBox to SizedControls.
This commit is contained in:
@@ -16,12 +16,13 @@
|
||||
The sized controls default HIG compliant sizers under the hood and provides
|
||||
a simple interface for customizing those sizers.
|
||||
|
||||
The following sized controls exists:
|
||||
The following sized controls exist:
|
||||
|
||||
:class:`wx.SizedFrame`
|
||||
:class:`wx.SizedDialog`
|
||||
:class:`wx.SizedPanel`
|
||||
:class:`wx.SizedScrolledPanel`
|
||||
:class:`SizedFrame`
|
||||
:class:`SizedDialog`
|
||||
:class:`SizedPanel`
|
||||
:class:`SizedScrolledPanel`
|
||||
:class `SizedStaticBox`
|
||||
|
||||
Description
|
||||
===========
|
||||
@@ -914,3 +915,27 @@ class SizedFrame(wx.Frame):
|
||||
Return the pane to add controls too
|
||||
"""
|
||||
return self.mainPanel
|
||||
|
||||
|
||||
class SizedStaticBox(wx.StaticBox, sc.SizedParent):
|
||||
def __init__(self, *args, **kwargs):
|
||||
wx.StaticBox.__init__(self, *args, **kwargs)
|
||||
sizer = wx.BoxSizer(wx.VERTICAL) #TableSizer(1, 0)
|
||||
self.SetSizer(sizer)
|
||||
self.sizerType = "vertical"
|
||||
|
||||
def AddChild(self, child):
|
||||
"""
|
||||
Called automatically by wx, do not call it from user code.
|
||||
"""
|
||||
wx.StaticBox.AddChild(self, child)
|
||||
sc.SizedParent.AddChild(self, child)
|
||||
|
||||
def _SetNewSizer(self, sizer):
|
||||
"""
|
||||
Set a new sizer, detach old sizer, add new one and add items
|
||||
to new sizer.
|
||||
"""
|
||||
props = self._DetachFromSizer(sizer)
|
||||
wx.StaticBox.SetSizer(self, sizer)
|
||||
self._AddToNewSizer(sizer, props)
|
||||
|
||||
Reference in New Issue
Block a user