2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: sashwin.h
|
2008-03-10 11:24:38 -04:00
|
|
|
// Purpose: interface of wxSashWindow
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2008-10-04 10:30:56 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
See wxSashWindow.
|
|
|
|
*/
|
|
|
|
enum wxSashEdgePosition
|
|
|
|
{
|
|
|
|
wxSASH_TOP = 0,
|
|
|
|
wxSASH_RIGHT,
|
|
|
|
wxSASH_BOTTOM,
|
|
|
|
wxSASH_LEFT,
|
|
|
|
wxSASH_NONE = 100
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
See wxSashEvent.
|
|
|
|
*/
|
|
|
|
enum wxSashDragStatus
|
|
|
|
{
|
|
|
|
wxSASH_STATUS_OK,
|
|
|
|
wxSASH_STATUS_OUT_OF_RANGE
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxSashWindow
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
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
|
2008-10-04 10:30:56 -04:00
|
|
|
application as a child of wxSashWindow.
|
|
|
|
|
|
|
|
The window (or an ancestor) will be notified of a drag via a
|
|
|
|
wxSashEvent notification.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@beginStyleTable
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxSW_3D}
|
2008-03-08 08:52:38 -05:00
|
|
|
Draws a 3D effect sash and border.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxSW_3DSASH}
|
2008-03-08 08:52:38 -05:00
|
|
|
Draws a 3D effect sash.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxSW_3DBORDER}
|
2008-03-08 08:52:38 -05:00
|
|
|
Draws a 3D effect border.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxSW_BORDER}
|
2008-03-08 08:52:38 -05:00
|
|
|
Draws a thin black border.
|
|
|
|
@endStyleTable
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-28 12:19:12 -04:00
|
|
|
@beginEventTable{wxSashEvent}
|
2008-04-06 10:43:04 -04:00
|
|
|
@event{EVT_SASH_DRAGGED(id, func)}
|
2008-03-08 08:52:38 -05:00
|
|
|
Process a wxEVT_SASH_DRAGGED event, when the user has finished
|
|
|
|
dragging a sash.
|
2008-04-06 10:43:04 -04:00
|
|
|
@event{EVT_SASH_DRAGGED_RANGE(id1, id2, func)}
|
2008-03-08 08:52:38 -05:00
|
|
|
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.
|
|
|
|
@endEventTable
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxadv}
|
|
|
|
@category{miscwnd}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-28 12:19:12 -04:00
|
|
|
@see wxSashEvent, wxSashLayoutWindow, @ref overview_eventhandling
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxSashWindow : public wxWindow
|
|
|
|
{
|
|
|
|
public:
|
2008-10-04 10:30:56 -04:00
|
|
|
/**
|
|
|
|
Default ctor.
|
|
|
|
*/
|
|
|
|
wxSashWindow();
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
Constructs a sash window, which can be a child of a frame, dialog or any other
|
|
|
|
non-control window.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param parent
|
2008-03-09 08:33:59 -04:00
|
|
|
Pointer to a parent window.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param id
|
2008-03-09 08:33:59 -04:00
|
|
|
Window identifier. If -1, will automatically create an identifier.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param pos
|
2008-03-09 08:33:59 -04:00
|
|
|
Window position. wxDefaultPosition is (-1, -1) which indicates that
|
2008-10-04 10:30:56 -04:00
|
|
|
wxSashWindows should generate a default position for the window.
|
|
|
|
If using the wxSashWindow class directly, supply an actual position.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param size
|
2008-03-09 08:33:59 -04:00
|
|
|
Window size. wxDefaultSize is (-1, -1) which indicates that wxSashWindows
|
|
|
|
should generate a default size for the window.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param style
|
2008-03-09 08:33:59 -04:00
|
|
|
Window style. For window styles, please see wxSashWindow.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param name
|
2008-03-09 08:33:59 -04:00
|
|
|
Window name.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
wxSashWindow(wxWindow* parent, wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
2008-03-09 08:33:59 -04:00
|
|
|
long style = wxCLIP_CHILDREN | wxSW_3D,
|
2008-03-08 09:43:31 -05:00
|
|
|
const wxString& name = "sashWindow");
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual ~wxSashWindow();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the maximum window size in the x direction.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual int GetMaximumSizeX() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the maximum window size in the y direction.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual int GetMaximumSizeY() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the minimum window size in the x direction.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual int GetMinimumSizeX() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the minimum window size in the y direction.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual int GetMinimumSizeY() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if a sash is visible on the given edge, @false otherwise.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param edge
|
2008-03-09 08:33:59 -04:00
|
|
|
Edge. One of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetSashVisible()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
bool GetSashVisible(wxSashEdgePosition edge) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if the sash has a border, @false otherwise.
|
|
|
|
This function is obsolete since the sash border property is unused.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param edge
|
2008-03-09 08:33:59 -04:00
|
|
|
Edge. One of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetSashBorder()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
bool HasBorder(wxSashEdgePosition edge) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the maximum window size in the x direction.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual void SetMaximumSizeX(int min);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the maximum window size in the y direction.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual void SetMaximumSizeY(int min);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the minimum window size in the x direction.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual void SetMinimumSizeX(int min);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the minimum window size in the y direction.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual void SetMinimumSizeY(int min);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Call this function to give the sash a border, or remove the border.
|
|
|
|
This function is obsolete since the sash border property is unused.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param edge
|
2008-03-09 08:33:59 -04:00
|
|
|
Edge to change. One of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param hasBorder
|
2008-03-09 08:33:59 -04:00
|
|
|
@true to give the sash a border visible, @false to remove it.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetSashBorder(wxSashEdgePosition edge, bool hasBorder);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Call this function to make a sash visible or invisible on a particular edge.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param edge
|
2008-03-09 08:33:59 -04:00
|
|
|
Edge to change. One of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param visible
|
2008-03-09 08:33:59 -04:00
|
|
|
@true to make the sash visible, @false to make it invisible.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetSashVisible()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetSashVisible(wxSashEdgePosition edge, bool visible);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxSashEvent
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
A sash event is sent when the sash of a wxSashWindow has been
|
|
|
|
dragged by the user.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-10-04 10:30:56 -04:00
|
|
|
@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.
|
|
|
|
|
|
|
|
@beginEventTable{wxSashEvent}
|
|
|
|
@event{EVT_SASH_DRAGGED(id, func)}
|
|
|
|
Process a wxEVT_SASH_DRAGGED event, when the user has finished dragging a sash.
|
|
|
|
@event{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.
|
|
|
|
@endEventTable
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxadv}
|
2008-10-04 10:30:56 -04:00
|
|
|
@category{events}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-10-04 10:30:56 -04:00
|
|
|
@see wxSashWindow, @ref overview_eventhandling
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxSashEvent : public wxCommandEvent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Constructor.
|
|
|
|
*/
|
|
|
|
wxSashEvent(int id = 0, wxSashEdgePosition edge = wxSASH_NONE);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the rectangle representing the new size the window would be if the
|
2008-10-04 10:30:56 -04:00
|
|
|
resize was applied. It is up to the application to set the window size if required.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxRect GetDragRect() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-10-04 10:30:56 -04:00
|
|
|
Returns the status of the sash: one of wxSASH_STATUS_OK, wxSASH_STATUS_OUT_OF_RANGE.
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
If the drag caused the notional bounding box of the window to flip over, for
|
|
|
|
example, the drag will be out of rage.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxSashDragStatus GetDragStatus() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-10-04 10:30:56 -04:00
|
|
|
Returns the dragged edge.
|
|
|
|
|
|
|
|
The return value is one of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxSashEdgePosition GetEdge() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|