## wxSashWindow

wxSashWindow allows any of its edges to have a sash which can be dragged to resize the window. The actual content window will be created by the application as a child of wxSashWindow. The window (or an ancestor) will be notified of a drag via a wxSashEvent notification.

Derived from

wxWindow
wxEvtHandler
wxObject

Include files

<wx/sashwin.h>

Window styles

The following styles apply in addition to the normal wxWindow styles.

wxSW_3D | Draws a 3D effect sash and border.
wxSW_3DSASH | Draws a 3D effect sash.
wxSW_3DBORDER | Draws a 3D effect border.
wxSW_BORDER | Draws a thin black border.

See also window styles overview.

Event handling

EVT_SASH_DRAGGED(id, func) | Process a wxEVT_SASH_DRAGGED event, when the user has finished dragging a sash.
EVT_SASH_DRAGGED_RANGE(id1, id2, func) | Process a wxEVT_SASH_DRAGGED_RANGE event, when the user has finished dragging a sash. The event handler is called when windows with ids in the given range have their sashes dragged.

Data types

    enum wxSashEdgePosition {
        wxSASH_TOP = 0,
        wxSASH_RIGHT,
        wxSASH_BOTTOM,
        wxSASH_LEFT,
        wxSASH_NONE = 100
    };

See also

wxSashEvent, wxSashLayoutWindow, Event handling overview

Members

wxSashWindow::wxSashWindow
wxSashWindow::~wxSashWindow
wxSashWindow::GetSashVisible
wxSashWindow::GetMaximumSizeX
wxSashWindow::GetMaximumSizeY
wxSashWindow::GetMinimumSizeX
wxSashWindow::GetMinimumSizeY
wxSashWindow::HasBorder
wxSashWindow::SetMaximumSizeX
wxSashWindow::SetMaximumSizeY
wxSashWindow::SetMinimumSizeX
wxSashWindow::SetMinimumSizeY
wxSashWindow::SetSashVisible
wxSashWindow::SetSashBorder

### wxSashWindow::wxSashWindow

wxSashWindow()

Default constructor.

wxSashWindow(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCLIP_CHILDREN | wxSW_3D, const wxString& name = "sashWindow")

Constructs a sash 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. wxDefaultPosition is (-1, -1) which indicates that wxSashWindows should generate a default position for the window. If using the wxSashWindow class directly, supply an actual position.

size

Window size. wxDefaultSize is (-1, -1) which indicates that wxSashWindows should generate a default size for the window.

style

Window style. For window styles, please see wxSashWindow.

name

Window name.

### wxSashWindow::~wxSashWindow

~wxSashWindow()

Destructor.

### wxSashWindow::GetSashVisible

bool GetSashVisible(wxSashEdgePosition edge) const

Returns TRUE if a sash is visible on the given edge, FALSE otherwise.

Parameters

edge

Edge. One of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.

See also

wxSashWindow::SetSashVisible

### wxSashWindow::GetMaximumSizeX

int GetMaximumSizeX() const

Gets the maximum window size in the x direction.

### wxSashWindow::GetMaximumSizeY

int GetMaximumSizeY() const

Gets the maximum window size in the y direction.

### wxSashWindow::GetMinimumSizeX

int GetMinimumSizeX()

Gets the minimum window size in the x direction.

### wxSashWindow::GetMinimumSizeY

int GetMinimumSizeY(int min) const

Gets the minimum window size in the y direction.

### wxSashWindow::HasBorder

bool HasBorder(wxSashEdgePosition edge) const

Returns TRUE if the sash has a border, FALSE otherwise.

Parameters

edge

Edge. One of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.

See also

wxSashWindow::SetSashBorder

### wxSashWindow::SetMaximumSizeX

void SetMaximumSizeX(int min)

Sets the maximum window size in the x direction.

### wxSashWindow::SetMaximumSizeY

void SetMaximumSizeY(int min)

Sets the maximum window size in the y direction.

### wxSashWindow::SetMinimumSizeX

void SetMinimumSizeX(int min)

Sets the minimum window size in the x direction.

### wxSashWindow::SetMinimumSizeY

void SetMinimumSizeY(int min)

Sets the minimum window size in the y direction.

### wxSashWindow::SetSashVisible

void SetSashVisible(wxSashEdgePosition edge, bool visible)

Call this function to make a sash visible or invisible on a particular edge.

Parameters

edge

Edge to change. One of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.

visible

TRUE to make the sash visible, FALSE to make it invisible.

See also

wxSashWindow::GetSashVisible

### wxSashWindow::SetSashBorder

void SetSashBorder(wxSashEdgePosition edge, bool hasBorder)

Call this function to give the sash a border, or remove the border.

Parameters

edge

Edge to change. One of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.

hasBorder

TRUE to give the sash a border visible, FALSE to remove it.

See also

wxSashWindow::HashBorder