2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: splitter.h
|
2008-03-10 11:24:38 -04:00
|
|
|
// Purpose: interface of wxSplitterWindow
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
2010-07-13 09:29:13 -04:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2011-09-02 21:39:02 -04:00
|
|
|
|
2011-11-02 16:22:29 -04:00
|
|
|
#define wxSP_NOBORDER 0x0000
|
|
|
|
#define wxSP_THIN_SASH 0x0000 // NB: the default is 3D sash
|
|
|
|
#define wxSP_NOSASH 0x0010
|
|
|
|
#define wxSP_PERMIT_UNSPLIT 0x0040
|
|
|
|
#define wxSP_LIVE_UPDATE 0x0080
|
|
|
|
#define wxSP_3DSASH 0x0100
|
|
|
|
#define wxSP_3DBORDER 0x0200
|
|
|
|
#define wxSP_NO_XP_THEME 0x0400
|
|
|
|
#define wxSP_BORDER wxSP_3DBORDER
|
|
|
|
#define wxSP_3D (wxSP_3DBORDER | wxSP_3DSASH)
|
|
|
|
|
|
|
|
|
2011-09-02 21:39:02 -04:00
|
|
|
enum wxSplitMode
|
|
|
|
{
|
|
|
|
wxSPLIT_HORIZONTAL = 1,
|
|
|
|
wxSPLIT_VERTICAL
|
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
wxSPLIT_DRAG_NONE,
|
|
|
|
wxSPLIT_DRAG_DRAGGING,
|
|
|
|
wxSPLIT_DRAG_LEFT_DOWN
|
|
|
|
};
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxSplitterWindow
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-10-05 07:24:00 -04:00
|
|
|
This class manages up to two subwindows. The current view can be split
|
|
|
|
into two programmatically (perhaps from a menu command), and unsplit
|
2008-03-08 08:52:38 -05:00
|
|
|
either programmatically or via the wxSplitterWindow user interface.
|
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{wxSP_3D}
|
2008-03-08 08:52:38 -05:00
|
|
|
Draws a 3D effect border and sash.
|
2008-09-03 16:26:47 -04:00
|
|
|
@style{wxSP_THIN_SASH}
|
|
|
|
Draws a thin sash.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxSP_3DSASH}
|
2008-09-03 16:26:47 -04:00
|
|
|
Draws a 3D effect sash (part of default style).
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxSP_3DBORDER}
|
2008-03-08 08:52:38 -05:00
|
|
|
Synonym for wxSP_BORDER.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxSP_BORDER}
|
2008-03-08 08:52:38 -05:00
|
|
|
Draws a standard border.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxSP_NOBORDER}
|
2008-03-08 08:52:38 -05:00
|
|
|
No border (default).
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxSP_NO_XP_THEME}
|
2008-03-08 08:52:38 -05:00
|
|
|
Under Windows XP, switches off the attempt to draw the splitter
|
|
|
|
using Windows XP theming, so the borders and sash will take on the
|
|
|
|
pre-XP look.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxSP_PERMIT_UNSPLIT}
|
2008-10-05 07:24:00 -04:00
|
|
|
Always allow to unsplit, even with the minimum pane size other than zero.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxSP_LIVE_UPDATE}
|
2008-03-08 08:52:38 -05:00
|
|
|
Don't draw XOR line but resize the child windows immediately.
|
|
|
|
@endStyleTable
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-10-05 07:24:00 -04:00
|
|
|
|
2009-02-18 12:58:51 -05:00
|
|
|
@beginEventEmissionTable{wxSplitterEvent}
|
2008-10-05 07:24:00 -04:00
|
|
|
@event{EVT_SPLITTER_SASH_POS_CHANGING(id, func)}
|
|
|
|
The sash position is in the process of being changed.
|
|
|
|
May be used to modify the position of the tracking bar to properly
|
|
|
|
reflect the position that would be set if the drag were to be completed
|
2011-01-06 14:52:14 -05:00
|
|
|
at this point. Processes a @c wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING event.
|
2008-10-05 07:24:00 -04:00
|
|
|
@event{EVT_SPLITTER_SASH_POS_CHANGED(id, func)}
|
|
|
|
The sash position was changed. May be used to modify the sash position
|
|
|
|
before it is set, or to prevent the change from taking place.
|
2011-01-06 14:52:14 -05:00
|
|
|
Processes a @c wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED event.
|
2008-10-05 07:24:00 -04:00
|
|
|
@event{EVT_SPLITTER_UNSPLIT(id, func)}
|
2011-01-06 14:52:14 -05:00
|
|
|
The splitter has been just unsplit. Processes a @c wxEVT_COMMAND_SPLITTER_UNSPLIT event.
|
2008-10-05 07:24:00 -04:00
|
|
|
@event{EVT_SPLITTER_DCLICK(id, func)}
|
|
|
|
The sash was double clicked. The default behaviour is to unsplit the
|
|
|
|
window when this happens (unless the minimum pane size has been set
|
2011-01-06 14:52:14 -05:00
|
|
|
to a value greater than zero). Processes a @c wxEVT_COMMAND_SPLITTER_DOUBLECLICKED event.
|
2008-10-05 07:24:00 -04:00
|
|
|
@endEventTable
|
|
|
|
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
|
|
|
@category{miscwnd}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-10-05 07:24:00 -04:00
|
|
|
@see wxSplitterEvent, @ref overview_splitterwindow
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxSplitterWindow : public wxWindow
|
|
|
|
{
|
|
|
|
public:
|
2008-05-29 10:10:52 -04:00
|
|
|
/**
|
|
|
|
Default constructor
|
|
|
|
*/
|
|
|
|
wxSplitterWindow();
|
2008-10-05 07:24:00 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
Constructor for creating the 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
|
|
|
The parent of the splitter window.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param id
|
2008-03-09 08:33:59 -04:00
|
|
|
The window identifier.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param pos
|
2008-03-09 08:33:59 -04:00
|
|
|
The window position.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param size
|
2008-03-09 08:33:59 -04:00
|
|
|
The window size.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param style
|
2008-03-09 08:33:59 -04:00
|
|
|
The window style. See wxSplitterWindow.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param name
|
2008-03-09 08:33:59 -04:00
|
|
|
The window name.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-10-05 07:24:00 -04:00
|
|
|
@remarks
|
|
|
|
After using this constructor, you must create either one or two
|
|
|
|
subwindows with the splitter window as parent, and then call one
|
|
|
|
of Initialize(), SplitVertically() and SplitHorizontally() in order
|
|
|
|
to set the pane(s).
|
|
|
|
You can create two windows, with one hidden when not being shown;
|
|
|
|
or you can create and delete the second pane on demand.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-10-05 07:24:00 -04:00
|
|
|
@see Initialize(), SplitVertically(), SplitHorizontally(), Create()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-11-13 16:32:53 -05:00
|
|
|
wxSplitterWindow(wxWindow* parent, wxWindowID id = wxID_ANY,
|
2008-10-05 07:24:00 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
2008-03-08 09:43:31 -05:00
|
|
|
const wxSize& size = wxDefaultSize,
|
2008-03-09 08:33:59 -04:00
|
|
|
long style = wxSP_3D,
|
2008-03-08 09:43:31 -05:00
|
|
|
const wxString& name = "splitterWindow");
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Destroys the wxSplitterWindow and its children.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual ~wxSplitterWindow();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-10-05 07:24:00 -04:00
|
|
|
Creation function, for two-step construction.
|
|
|
|
See wxSplitterWindow() for details.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-29 11:34:31 -04:00
|
|
|
bool Create(wxWindow* parent, wxWindowID id = wxID_ANY,
|
2008-03-08 08:52:38 -05:00
|
|
|
const wxPoint& point = wxDefaultPosition,
|
2008-10-29 11:34:31 -04:00
|
|
|
const wxSize& size = wxDefaultSize, long style = wxSP_3D,
|
|
|
|
const wxString& name = "splitter");
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the current minimum pane size (defaults to zero).
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetMinimumPaneSize()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetMinimumPaneSize() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the current sash gravity.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetSashGravity()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
double GetSashGravity() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the current sash position.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetSashPosition()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
int GetSashPosition() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2010-11-21 20:23:16 -05:00
|
|
|
/**
|
2012-03-08 08:23:39 -05:00
|
|
|
Returns the default sash size in pixels or 0 if it is invisible.
|
|
|
|
|
|
|
|
@see GetDefaultSashSize(), IsSashInvisible()
|
|
|
|
*/
|
|
|
|
int GetSashSize() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the default sash size in pixels.
|
2010-11-21 20:23:16 -05:00
|
|
|
|
|
|
|
The size of the sash is its width for a vertically split window and its
|
|
|
|
height for a horizontally split one. Its other direction is the same as
|
|
|
|
the client size of the window in the corresponding direction.
|
|
|
|
|
2012-03-08 08:23:39 -05:00
|
|
|
The default sash size is platform-dependent because it conforms to the
|
|
|
|
current platform look-and-feel and cannot be changed.
|
|
|
|
|
|
|
|
@since 2.9.4
|
2010-11-21 20:23:16 -05:00
|
|
|
*/
|
2012-03-08 08:23:39 -05:00
|
|
|
int GetDefaultSashSize() const;
|
2010-11-21 20:23:16 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
Gets the split mode.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-10-05 07:24:00 -04:00
|
|
|
@see SetSplitMode(), SplitVertically(), SplitHorizontally().
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-29 11:34:31 -04:00
|
|
|
wxSplitMode GetSplitMode() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the left/top or only pane.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxWindow* GetWindow1() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the right/bottom pane.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxWindow* GetWindow2() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-10-05 07:24:00 -04:00
|
|
|
Initializes the splitter window to have one pane.
|
|
|
|
The child window is shown if it is currently hidden.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param window
|
2008-03-09 08:33:59 -04:00
|
|
|
The pane for the unsplit window.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks This should be called if you wish to initially view only a
|
2008-03-09 08:33:59 -04:00
|
|
|
single pane in the splitter window.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SplitVertically(), SplitHorizontally()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void Initialize(wxWindow* window);
|
|
|
|
|
2012-03-08 08:23:39 -05:00
|
|
|
/**
|
|
|
|
Returns @true if the sash is invisible even when the window is split, @false otherwise.
|
|
|
|
|
|
|
|
@remark This is a shortcut for HasFlag(wxSP_NOSASH)
|
|
|
|
|
|
|
|
@see SetSashInvisible()
|
|
|
|
|
|
|
|
@since 2.9.4
|
|
|
|
*/
|
|
|
|
bool IsSashInvisible() const;
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
Returns @true if the window is split, @false otherwise.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
bool IsSplit() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Application-overridable function called when the sash is double-clicked with
|
|
|
|
the left mouse button.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param x
|
2008-03-09 08:33:59 -04:00
|
|
|
The x position of the mouse cursor.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param y
|
2008-03-09 08:33:59 -04:00
|
|
|
The y position of the mouse cursor.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks The default implementation of this function calls Unsplit if the
|
2008-03-09 08:33:59 -04:00
|
|
|
minimum pane size is zero.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see Unsplit()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
virtual void OnDoubleClickSash(int x, int y);
|
|
|
|
|
|
|
|
/**
|
2008-03-08 09:43:31 -05:00
|
|
|
Application-overridable function called when the sash position is changed by
|
2008-03-08 08:52:38 -05:00
|
|
|
user. It may return @false to prevent the change or @true to allow it.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param newSashPosition
|
2008-03-09 08:33:59 -04:00
|
|
|
The new sash position (always positive or zero)
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks The default implementation of this function verifies that the
|
2008-03-09 08:33:59 -04:00
|
|
|
sizes of both panes of the splitter are greater than
|
|
|
|
minimum pane size.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
virtual bool OnSashPositionChange(int newSashPosition);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Application-overridable function called when the window is unsplit, either
|
|
|
|
programmatically or using the wxSplitterWindow user interface.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param removed
|
2008-03-09 08:33:59 -04:00
|
|
|
The window being removed.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks The default implementation of this function simply hides
|
2008-03-09 08:33:59 -04:00
|
|
|
removed. You may wish to delete the window.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
virtual void OnUnsplit(wxWindow* removed);
|
|
|
|
|
|
|
|
/**
|
|
|
|
This function replaces one of the windows managed by the wxSplitterWindow with
|
|
|
|
another one. It is in general better to use it instead of calling Unsplit()
|
|
|
|
and then resplitting the window back because it will provoke much less flicker
|
|
|
|
(if any). It is valid to call this function whether the splitter has two
|
|
|
|
windows or only one.
|
2008-10-05 07:24:00 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
Both parameters should be non-@NULL and @a winOld must specify one of the
|
2008-03-08 08:52:38 -05:00
|
|
|
windows managed by the splitter. If the parameters are incorrect or the window
|
|
|
|
couldn't be replaced, @false is returned. Otherwise the function will return
|
|
|
|
@true, but please notice that it will not delete the replaced window and you
|
|
|
|
may wish to do it yourself.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetMinimumPaneSize()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
bool ReplaceWindow(wxWindow* winOld, wxWindow* winNew);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the minimum pane size.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param paneSize
|
2008-03-09 08:33:59 -04:00
|
|
|
Minimum pane size in pixels.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks The default minimum pane size is zero, which means that either
|
2008-03-09 08:33:59 -04:00
|
|
|
pane can be reduced to zero by dragging the sash, thus
|
|
|
|
removing one of the panes. To prevent this behaviour
|
|
|
|
(and veto out-of-range sash dragging), set a minimum
|
|
|
|
size, for example 20 pixels. If the wxSP_PERMIT_UNSPLIT
|
|
|
|
style is used when a splitter window is created, the
|
|
|
|
window may be unsplit even if minimum size is non-zero.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetMinimumPaneSize()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetMinimumPaneSize(int paneSize);
|
|
|
|
|
|
|
|
/**
|
2008-03-08 09:43:31 -05:00
|
|
|
Sets the sash gravity.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param gravity
|
2008-03-09 08:33:59 -04:00
|
|
|
The sash gravity. Value between 0.0 and 1.0.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-10-05 07:24:00 -04:00
|
|
|
@remarks
|
|
|
|
Gravity is real factor which controls position of sash while resizing
|
|
|
|
wxSplitterWindow. Gravity tells wxSplitterWindow how much will left/top
|
|
|
|
window grow while resizing.
|
|
|
|
Example values:
|
|
|
|
- 0.0: only the bottom/right window is automatically resized
|
|
|
|
- 0.5: both windows grow by equal size
|
|
|
|
- 1.0: only left/top window grows
|
|
|
|
Gravity should be a real value between 0.0 and 1.0.
|
|
|
|
Default value of sash gravity is 0.0.
|
|
|
|
That value is compatible with previous (before gravity was introduced)
|
|
|
|
behaviour of wxSplitterWindow.
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetSashGravity()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetSashGravity(double gravity);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the sash position.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param position
|
2008-03-09 08:33:59 -04:00
|
|
|
The sash position in pixels.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param redraw
|
2008-03-09 08:33:59 -04:00
|
|
|
If @true, resizes the panes and redraws the sash and border.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks Does not currently check for an out-of-range value.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetSashPosition()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-29 11:34:31 -04:00
|
|
|
void SetSashPosition(int position, bool redraw = true);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the split mode.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param mode
|
2008-03-09 08:33:59 -04:00
|
|
|
Can be wxSPLIT_VERTICAL or wxSPLIT_HORIZONTAL.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks Only sets the internal variable; does not update the display.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-10-05 07:24:00 -04:00
|
|
|
@see GetSplitMode(), SplitVertically(), SplitHorizontally().
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetSplitMode(int mode);
|
|
|
|
|
2012-03-08 08:23:39 -05:00
|
|
|
/**
|
|
|
|
Sets whether the sash should be invisible, even when the window is
|
|
|
|
split.
|
|
|
|
|
|
|
|
When the sash is invisible, it doesn't appear on the screen at all and,
|
|
|
|
in particular, doesn't allow the user to resize the windows.
|
|
|
|
|
|
|
|
@remarks Only sets the internal variable; does not update the display.
|
|
|
|
|
|
|
|
@param invisible
|
|
|
|
If @true, the sash is always invisible, else it is shown when the
|
|
|
|
window is split.
|
|
|
|
|
|
|
|
@see IsSashInvisible()
|
|
|
|
|
|
|
|
@since 2.9.4
|
|
|
|
*/
|
|
|
|
void SetSashInvisible(bool invisible=true);
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
2008-10-05 07:24:00 -04:00
|
|
|
Initializes the top and bottom panes of the splitter window.
|
|
|
|
The child windows are shown if they are currently hidden.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param window1
|
2008-03-09 08:33:59 -04:00
|
|
|
The top pane.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param window2
|
2008-03-09 08:33:59 -04:00
|
|
|
The bottom pane.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param sashPosition
|
2008-10-05 07:24:00 -04:00
|
|
|
The initial position of the sash. If this value is positive,
|
|
|
|
it specifies the size of the upper pane. If it is negative, its
|
|
|
|
absolute value gives the size of the lower pane.
|
|
|
|
Finally, specify 0 (default) to choose the default position
|
|
|
|
(half of the total window height).
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-10-05 07:24:00 -04:00
|
|
|
@return @true if successful, @false otherwise (the window was already split).
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks This should be called if you wish to initially view two panes.
|
2008-10-05 07:24:00 -04:00
|
|
|
It can also be called at any subsequent time, but the application
|
|
|
|
should check that the window is not currently split using IsSplit().
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-10-05 07:24:00 -04:00
|
|
|
@see SplitVertically(), IsSplit(), Unsplit()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-27 17:26:54 -04:00
|
|
|
virtual bool SplitHorizontally(wxWindow* window1, wxWindow* window2,
|
|
|
|
int sashPosition = 0);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-10-05 07:24:00 -04:00
|
|
|
Initializes the left and right panes of the splitter window.
|
|
|
|
The child windows are shown if they are currently hidden.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param window1
|
2008-03-09 08:33:59 -04:00
|
|
|
The left pane.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param window2
|
2008-03-09 08:33:59 -04:00
|
|
|
The right pane.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param sashPosition
|
2008-10-05 07:24:00 -04:00
|
|
|
The initial position of the sash. If this value is positive, it
|
|
|
|
specifies the size of the left pane. If it is negative, it is
|
|
|
|
absolute value gives the size of the right pane.
|
|
|
|
Finally, specify 0 (default) to choose the default position
|
|
|
|
(half of the total window width).
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-10-05 07:24:00 -04:00
|
|
|
@return @true if successful, @false otherwise (the window was already split).
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks This should be called if you wish to initially view two panes.
|
2008-03-09 08:33:59 -04:00
|
|
|
It can also be called at any subsequent time, but the
|
2008-10-05 07:24:00 -04:00
|
|
|
application should check that the window is not currently
|
|
|
|
split using IsSplit().
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-10-05 07:24:00 -04:00
|
|
|
@see SplitHorizontally(), IsSplit(), Unsplit().
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-27 17:26:54 -04:00
|
|
|
virtual bool SplitVertically(wxWindow* window1, wxWindow* window2,
|
|
|
|
int sashPosition = 0);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Unsplits the window.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param toRemove
|
2008-03-09 08:33:59 -04:00
|
|
|
The pane to remove, or @NULL to remove the right or bottom pane.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-05-10 21:38:53 -04:00
|
|
|
@return @true if successful, @false otherwise (the window was not split).
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks This call will not actually delete the pane being removed; it
|
2008-10-05 07:24:00 -04:00
|
|
|
calls OnUnsplit() which can be overridden for the desired
|
2008-03-09 08:33:59 -04:00
|
|
|
behaviour. By default, the pane being removed is hidden.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-10-05 07:24:00 -04:00
|
|
|
@see SplitHorizontally(), SplitVertically(), IsSplit(), OnUnsplit()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
bool Unsplit(wxWindow* toRemove = NULL);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Causes any pending sizing of the sash and child panes to take place
|
|
|
|
immediately.
|
2008-10-05 07:24:00 -04:00
|
|
|
|
|
|
|
Such resizing normally takes place in idle time, in order to wait for
|
|
|
|
layout to be completed. However, this can cause unacceptable flicker as
|
|
|
|
the panes are resized after the window has been shown.
|
|
|
|
To work around this, you can perform window layout (for example by
|
|
|
|
sending a size event to the parent window), and then call this function,
|
|
|
|
before showing the top-level window.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void UpdateSize();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxSplitterEvent
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-10-05 07:24:00 -04:00
|
|
|
This class represents the events generated by a splitter control.
|
|
|
|
|
|
|
|
Also there is only one event class, the data associated to the different events
|
|
|
|
is not the same and so not all accessor functions may be called for each event.
|
|
|
|
The documentation mentions the kind of event(s) for which the given accessor
|
2008-03-08 08:52:38 -05:00
|
|
|
function makes sense: calling it for other types of events will result
|
|
|
|
in assert failure (in debug mode) and will return meaningless results.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-10-05 07:24:00 -04:00
|
|
|
@beginEventTable{wxSplitterEvent}
|
|
|
|
@event{EVT_SPLITTER_SASH_POS_CHANGING(id, func)}
|
|
|
|
The sash position is in the process of being changed.
|
|
|
|
May be used to modify the position of the tracking bar to properly
|
|
|
|
reflect the position that would be set if the drag were to be completed
|
2011-01-06 14:52:14 -05:00
|
|
|
at this point. Processes a @c wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING event.
|
2008-10-05 07:24:00 -04:00
|
|
|
@event{EVT_SPLITTER_SASH_POS_CHANGED(id, func)}
|
|
|
|
The sash position was changed. May be used to modify the sash position
|
|
|
|
before it is set, or to prevent the change from taking place.
|
2011-01-06 14:52:14 -05:00
|
|
|
Processes a @c wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED event.
|
2008-10-05 07:24:00 -04:00
|
|
|
@event{EVT_SPLITTER_UNSPLIT(id, func)}
|
2011-01-06 14:52:14 -05:00
|
|
|
The splitter has been just unsplit. Processes a @c wxEVT_COMMAND_SPLITTER_UNSPLIT event.
|
2008-10-05 07:24:00 -04:00
|
|
|
@event{EVT_SPLITTER_DCLICK(id, func)}
|
|
|
|
The sash was double clicked. The default behaviour is to unsplit the
|
|
|
|
window when this happens (unless the minimum pane size has been set
|
2011-01-06 14:52:14 -05:00
|
|
|
to a value greater than zero). Processes a @c wxEVT_COMMAND_SPLITTER_DOUBLECLICKED event.
|
2008-10-05 07:24:00 -04:00
|
|
|
@endEventTable
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
|
|
|
@category{events}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2009-02-17 19:19:22 -05:00
|
|
|
@see wxSplitterWindow, @ref overview_events
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxSplitterEvent : public wxNotifyEvent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Constructor. Used internally by wxWidgets only.
|
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
wxSplitterEvent(wxEventType eventType = wxEVT_NULL,
|
|
|
|
wxSplitterWindow* splitter = NULL);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the new sash position.
|
2008-10-05 07:24:00 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
May only be called while processing
|
2008-10-05 07:24:00 -04:00
|
|
|
@c wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING and
|
|
|
|
@c wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED events.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetSashPosition() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns a pointer to the window being removed when a splitter window
|
|
|
|
is unsplit.
|
2008-10-05 07:24:00 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
May only be called while processing
|
2008-10-05 07:24:00 -04:00
|
|
|
@c wxEVT_COMMAND_SPLITTER_UNSPLIT events.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxWindow* GetWindowBeingRemoved() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the x coordinate of the double-click point.
|
2008-10-05 07:24:00 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
May only be called while processing
|
2008-10-05 07:24:00 -04:00
|
|
|
@c wxEVT_COMMAND_SPLITTER_DOUBLECLICKED events.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetX() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the y coordinate of the double-click point.
|
2008-10-05 07:24:00 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
May only be called while processing
|
2008-10-05 07:24:00 -04:00
|
|
|
@c wxEVT_COMMAND_SPLITTER_DOUBLECLICKED events.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetY() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-10-05 07:24:00 -04:00
|
|
|
In the case of @c wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED events,
|
|
|
|
sets the new sash position.
|
|
|
|
In the case of @c wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING events,
|
|
|
|
sets the new tracking bar position so visual feedback during dragging will
|
2008-03-08 08:52:38 -05:00
|
|
|
represent that change that will actually take place. Set to -1 from
|
|
|
|
the event handler code to prevent repositioning.
|
2008-10-05 07:24:00 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
May only be called while processing
|
2008-10-05 07:24:00 -04:00
|
|
|
@c wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING and
|
|
|
|
@c wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED events.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param pos
|
2008-03-09 08:33:59 -04:00
|
|
|
New sash position.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetSashPosition(int pos);
|
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2011-11-02 16:22:29 -04:00
|
|
|
|
|
|
|
wxEventType wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED;
|
|
|
|
wxEventType wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING;
|
|
|
|
wxEventType wxEVT_COMMAND_SPLITTER_DOUBLECLICKED;
|
|
|
|
wxEventType wxEVT_COMMAND_SPLITTER_UNSPLIT;
|