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
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@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
|
|
|
|
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:
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
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-03-08 08:52:38 -05:00
|
|
|
wxSashWindows
|
2008-03-09 08:33:59 -04:00
|
|
|
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
|
|
|
*/
|
|
|
|
wxSashWindow();
|
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.
|
|
|
|
*/
|
|
|
|
~wxSashWindow();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the maximum window size in the x direction.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetMaximumSizeX() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the maximum window size in the y direction.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetMaximumSizeY() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the minimum window size in the x direction.
|
|
|
|
*/
|
|
|
|
int GetMinimumSizeX();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the minimum window size in the y direction.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
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.
|
|
|
|
*/
|
|
|
|
void SetMaximumSizeX(int min);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the maximum window size in the y direction.
|
|
|
|
*/
|
|
|
|
void SetMaximumSizeY(int min);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the minimum window size in the x direction.
|
|
|
|
*/
|
|
|
|
void SetMinimumSizeX(int min);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the minimum window size in the y direction.
|
|
|
|
*/
|
|
|
|
void SetMinimumSizeY(int min);
|
|
|
|
|
|
|
|
/**
|
|
|
|
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-03-08 08:52:38 -05:00
|
|
|
@library{wxadv}
|
|
|
|
@category{FIXME}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
@see wxSashWindow, @ref overview_eventhandlingoverview
|
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
|
|
|
|
resize was applied. It is
|
|
|
|
up to the application to set the window size if required.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxRect GetDragRect() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
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.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxSashDragStatus GetDragStatus() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the dragged edge. The return value is one of wxSASH_TOP, wxSASH_RIGHT,
|
|
|
|
wxSASH_BOTTOM, wxSASH_LEFT.
|
|
|
|
*/
|
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
|
|
|
|