# wxSashEvent Class Reference
[Events]

`#include <wx/sashwin.h>`

Inheritance diagram for wxSashEvent:
[legend]

## Detailed Description

A sash event is sent when the sash of a wxSashWindow has been dragged by the user.

Remarks:
  When a sash belonging to a sash window is dragged by the user, and then released, this event is sent to the window, where it may be processed by an event table entry in a derived class, a plug-in event handler or an ancestor class. Note that the wxSashWindow doesn't change the window's size itself. It relies on the application's event handler to do that. This is because the application may have to handle other consequences of the resize, or it may wish to veto it altogether. The event handler should look at the drag rectangle: see wxSashEvent::GetDragRect to see what the new size of the window would be if the resize were to be applied. It should also call wxSashEvent::GetDragStatus to see whether the drag was OK or out of the current allowed range.

## Events using this class

The following event handler macros redirect the events to member function handlers 'func' with prototypes like:

void handlerFuncName(wxSashEvent& event)
Event macros:

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

##

Library: wxAdvanced

Category: Events

See also:
  wxSashWindow, Events and Event Handling

## Public Member Functions
| wxSashEvent (int id=0, wxSashEdgePosition edge=wxSASH_NONE)
| Constructor.
wxRect | GetDragRect () const
| Returns the rectangle representing the new size the window would be if the resize was applied.
wxSashDragStatus | GetDragStatus () const
| Returns the status of the sash: one of wxSASH_STATUS_OK, wxSASH_STATUS_OUT_OF_RANGE.
wxSashEdgePosition | GetEdge () const
| Returns the dragged edge.

List of all members.

## Constructor & Destructor Documentation

wxSashEvent::wxSashEvent | ( | int | id = `0`,
|  | wxSashEdgePosition | edge = `wxSASH_NONE` |
| ) |  |  |

Constructor.

## Member Function Documentation

wxRect wxSashEvent::GetDragRect | ( |  | ) | const

Returns the rectangle representing the new size the window would be if the resize was applied.

It is up to the application to set the window size if required.

wxSashDragStatus wxSashEvent::GetDragStatus | ( |  | ) | const

Returns the status of the sash: one of wxSASH_STATUS_OK, wxSASH_STATUS_OUT_OF_RANGE.

If the drag caused the notional bounding box of the window to flip over, for example, the drag will be out of rage.

wxSashEdgePosition wxSashEvent::GetEdge | ( |  | ) | const

Returns the dragged edge.

The return value is one of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.

|  | [ top ]