wxRuby Documentation Home

# Wx::SashLayoutWindow

SashLayoutWindow responds to OnCalculateLayout events generated
by 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 SashWindow allows sashes to be used if required,
to allow the windows to be user-resizable.

The documentation for LayoutAlgorithm explains
the purpose of this class in more detail.

## Derived from

SashWindow

Window

EvtHandler

Object

## Window styles

See SashWindow.

## Event handling

This class handles the EVT_QUERY_LAYOUT_INFO and EVT_CALCULATE_LAYOUT events
for you. However, if you use sashes, see SashWindow for
relevant event information.

See also LayoutAlgorithm for information
about the layout events.

## See also

LayoutAlgorithm, SashWindow, Event handling overview

## Methods

- SashLayoutWindow.new
- SashLayoutWindow#create
- SashLayoutWindow#get_alignment
- SashLayoutWindow#get_orientation
- SashLayoutWindow#on_calculate_layout
- SashLayoutWindow#on_query_layout_info
- SashLayoutWindow#set_alignment
- SashLayoutWindow#set_default_size
- SashLayoutWindow#set_orientation

### SashLayoutWindow.new

SashLayoutWindow.new(%(arg-type)SashLayoutWindow% parent, Integer id, Point pos = DEFAULT_POSITION, Size size = DEFAULT_SIZE, Integer style = CLIP_CHILDREN SW_3D, String name = “layoutWindow”)

Constructs a sash layout window, which can be a child of a frame, dialog or any other non-control window.

#### Parameters

- parent Pointer to a parent window.
- id Window identifier. If -1, will automatically create an identifier.
- pos Window position. DefaultPosition is (-1, -1) which indicates that SashLayoutWindows
  should generate a default position for the window. If using the SashLayoutWindow class directly, supply
  an actual position.
- size Window size. DefaultSize is (-1, -1) which indicates that SashLayoutWindows
  should generate a default size for the window.
- style Window style. For window styles, please see SashLayoutWindow.
- name Window name.

### SashLayoutWindow#create

Boolean create(%(arg-type)SashLayoutWindow% parent, Integer id, Point pos = DEFAULT_POSITION, Size size = DEFAULT_SIZE, Integer style = CLIP_CHILDREN SW_3D, String name = “layoutWindow”)

Initializes a sash layout window, which can be a child of a frame, dialog or any other non-control window.

#### Parameters

- parent Pointer to a parent window.
- id Window identifier. If -1, will automatically create an identifier.
- pos Window position. DefaultPosition is (-1, -1) which indicates that SashLayoutWindows
  should generate a default position for the window. If using the SashLayoutWindow class directly, supply
  an actual position.
- size Window size. DefaultSize is (-1, -1) which indicates that SashLayoutWindows
  should generate a default size for the window.
- style Window style. For window styles, please see SashLayoutWindow.
- name Window name.

### SashLayoutWindow#get_alignment

LayoutAlignment get_alignment()

Returns the alignment of the window: one of LAYOUT_TOP, LAYOUT_LEFT, LAYOUT_RIGHT, LAYOUT_BOTTOM.

### SashLayoutWindow#get_orientation

LayoutOrientation get_orientation()

Returns the orientation of the window: one of LAYOUT_HORIZONTAL, LAYOUT_VERTICAL.

### SashLayoutWindow#on_calculate_layout

on_calculate_layout(%(arg-type)CalculateLayoutEvent% event)

The default handler for the event that is generated by LayoutAlgorithm. The implementation
of this function calls CalculateLayoutEvent::SetRect to shrink the provided size according to
how much space this window takes up. For further details,
see LayoutAlgorithm and CalculateLayoutEvent.

### SashLayoutWindow#on_query_layout_info

on_query_layout_info(%(arg-type)QueryLayoutInfoEvent% 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 LayoutAlgorithm and QueryLayoutInfoEvent.

### SashLayoutWindow#set_alignment

set_alignment(%(arg-type)LayoutAlignment% alignment)

Sets the alignment of the window (which edge of the available parent client area the window
is attached to). alignment is one of LAYOUT_TOP, LAYOUT_LEFT, LAYOUT_RIGHT, LAYOUT_BOTTOM.

### SashLayoutWindow#set_default_size

set_default_size(%(arg-type)Size% 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.

### SashLayoutWindow#set_orientation

set_orientation(%(arg-type)LayoutOrientation% 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 LAYOUT_HORIZONTAL, LAYOUT_VERTICAL.

[This page automatically generated from the Textile source at 2023-06-09 00:45:26 +0000]