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.
See also
wx.adv.LayoutAlgorithm, wx.adv.SashWindow, Events and Event Handling
Default constructor. |
|
Initializes a sash layout window, which can be a child of a frame, dialog or any other non-control window. |
|
Returns the alignment of the window: one of |
|
Returns the orientation of the window: one of |
|
The default handler for the event that is generated by wx.adv.LayoutAlgorithm. |
|
The default handler for the event that is generated by OnCalculateLayout to get size, alignment and orientation information for the window. |
|
Sets the alignment of the window (which edge of the available parent client area the window is attached to). |
|
Sets the default dimensions of the window. |
|
Sets the orientation of the window (the direction the window will stretch in, to fill the available parent client area). |
See |
|
See |
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.
parent (wx.Window) – Pointer to a parent window.
id (wx.WindowID) – Window identifier. If -1, will automatically create an identifier.
pos (wx.Point) – Window position. DefaultPosition is (-1, -1) which indicates that SashLayoutWindows should generate a default position for the window. If using the wx.adv.SashLayoutWindow class directly, supply an actual position.
size (wx.Size) – Window size. DefaultSize is (-1, -1) which indicates that SashLayoutWindows should generate a default size for the window.
style (long) – Window style. For window styles, please see wx.adv.SashLayoutWindow.
name (string) – Window name.
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.
parent (wx.Window) – Pointer to a parent window.
id (wx.WindowID) – Window identifier. If -1, will automatically create an identifier.
pos (wx.Point) – Window position. DefaultPosition is (-1, -1) which indicates that SashLayoutWindows should generate a default position for the window. If using the wx.adv.SashLayoutWindow class directly, supply an actual position.
size (wx.Size) – Window size. DefaultSize is (-1, -1) which indicates that SashLayoutWindows should generate a default size for the window.
style (long) – Window style. For window styles, please see wx.adv.SashLayoutWindow.
name (string) – Window name.
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
.
GetClassDefaultAttributes
(variant=WINDOW_VARIANT_NORMAL)¶variant (WindowVariant) –
VisualAttributes
GetOrientation
(self)¶Returns the orientation of the window: one of wx.adv.LAYOUT_HORIZONTAL
, wx.adv.LAYOUT_VERTICAL
.
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.
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.
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
.
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.
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
.
orientation (LayoutOrientation) –
Alignment
¶See GetAlignment
and SetAlignment
Orientation
¶See GetOrientation
and SetOrientation