phoenix_title wx.adv.SashLayoutWindow

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


class_hierarchy Class Hierarchy

Inheritance diagram for class SashLayoutWindow:

method_summary Methods Summary

__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.

GetClassDefaultAttributes

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).


property_summary Properties Summary

Alignment

See GetAlignment and SetAlignment

Orientation

See GetOrientation and SetOrientation


api Class API

class 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.


Methods

__init__(self, *args, **kw)

overload Overloaded Implementations:



__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:
  • 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.

Parameters:
  • 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.

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



static GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)
Parameters:

variant (WindowVariant) –

Return type:

VisualAttributes



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) –


Properties

Alignment

See GetAlignment and SetAlignment



Orientation

See GetOrientation and SetOrientation