wx.adv.SashLayoutWindow responds to OnCalculateLayout events generated by wx.adv.LayoutAlgorithm.
It allows the application to use simple accessors to specify how the window should be laid out, rather than having to respond to events.
The fact that the class derives from wx.adv.SashWindow allows sashes to be used if required, to allow the windows to be user-resizable.
The documentation for wx.adv.LayoutAlgorithm explains the purpose of this class in more detail.
For the window styles see wx.adv.SashWindow.
This class handles the EVT_QUERY_LAYOUT_INFO
and EVT_CALCULATE_LAYOUT
events for you. However, if you use sashes, see wx.adv.SashWindow for relevant event information. See also wx.adv.LayoutAlgorithm for information about the layout events.
__init__ |
Default constructor. |
Create |
Initializes a sash layout window, which can be a child of a frame, dialog or any other non-control window. |
GetAlignment |
Returns the alignment of the window: one of wx.adv.LAYOUT_TOP , wx.adv.LAYOUT_LEFT , wx.adv.LAYOUT_RIGHT , wx.adv.LAYOUT_BOTTOM . |
GetOrientation |
Returns the orientation of the window: one of wx.adv.LAYOUT_HORIZONTAL , wx.adv.LAYOUT_VERTICAL . |
OnCalculateLayout |
The default handler for the event that is generated by wx.adv.LayoutAlgorithm. |
OnQueryLayoutInfo |
The default handler for the event that is generated by OnCalculateLayout to get size, alignment and orientation information for the window. |
SetAlignment |
Sets the alignment of the window (which edge of the available parent client area the window is attached to). |
SetDefaultSize |
Sets the default dimensions of the window. |
SetOrientation |
Sets the orientation of the window (the direction the window will stretch in, to fill the available parent client area). |
Alignment |
See GetAlignment and SetAlignment |
Orientation |
See GetOrientation and SetOrientation |
wx.adv.
SashLayoutWindow
(SashWindow)¶Possible constructors:
SashLayoutWindow()
SashLayoutWindow(parent, id=ID_ANY, pos=DefaultPosition,
size=DefaultSize, style=CLIP_CHILDREN|SW_3D, name="layoutWindow")
SashLayoutWindow responds to OnCalculateLayout events generated by LayoutAlgorithm.
__init__
(self, *args, **kw)¶__init__ (self)
Default constructor.
__init__ (self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=CLIP_CHILDREN|SW_3D, name=”layoutWindow”)
Constructs a sash layout window, which can be a child of a frame, dialog or any other non-control window.
Parameters: |
|
---|
Create
(self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=CLIP_CHILDREN|SW_3D, name="layoutWindow")¶Initializes a sash layout window, which can be a child of a frame, dialog or any other non-control window.
Parameters: |
|
---|---|
Return type: | bool |
GetAlignment
(self)¶Returns the alignment of the window: one of wx.adv.LAYOUT_TOP
, wx.adv.LAYOUT_LEFT
, wx.adv.LAYOUT_RIGHT
, wx.adv.LAYOUT_BOTTOM
.
Return type: | wx.adv.LayoutAlignment |
---|
GetOrientation
(self)¶Returns the orientation of the window: one of wx.adv.LAYOUT_HORIZONTAL
, wx.adv.LAYOUT_VERTICAL
.
Return type: | wx.adv.LayoutOrientation |
---|
OnCalculateLayout
(self, event)¶The default handler for the event that is generated by wx.adv.LayoutAlgorithm.
The implementation of this function calls wx.adv.CalculateLayoutEvent.SetRect
to shrink the provided size according to how much space this window takes up. For further details, see wx.adv.LayoutAlgorithm and wx.adv.CalculateLayoutEvent.
Parameters: | event (wx.adv.CalculateLayoutEvent) – |
---|
OnQueryLayoutInfo
(self, event)¶The default handler for the event that is generated by OnCalculateLayout to get size, alignment and orientation information for the window.
The implementation of this function uses member variables as set by accessors called by the application.
For further details, see wx.adv.LayoutAlgorithm and wx.adv.QueryLayoutInfoEvent.
Parameters: | event (wx.adv.QueryLayoutInfoEvent) – |
---|
SetAlignment
(self, alignment)¶Sets the alignment of the window (which edge of the available parent client area the window is attached to).
alignment is one of wx.adv.LAYOUT_TOP
, wx.adv.LAYOUT_LEFT
, wx.adv.LAYOUT_RIGHT
, wx.adv.LAYOUT_BOTTOM
.
Parameters: | alignment (LayoutAlignment) – |
---|
SetDefaultSize
(self, size)¶Sets the default dimensions of the window.
The dimension other than the orientation will be fixed to this value, and the orientation dimension will be ignored and the window stretched to fit the available space.
Parameters: | size (wx.Size) – |
---|
SetOrientation
(self, orientation)¶Sets the orientation of the window (the direction the window will stretch in, to fill the available parent client area).
orientation is one of wx.adv.LAYOUT_HORIZONTAL
, wx.adv.LAYOUT_VERTICAL
.
Parameters: | orientation (LayoutOrientation) – |
---|
Alignment
¶See GetAlignment
and SetAlignment
Orientation
¶See GetOrientation
and SetOrientation