// Name: splitter.h
// Purpose: interface of wxSplitterWindow
// Author: wxWidgets team
-// RCS-ID: $Id$
-// Licence: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
+
+#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)
+
+
+enum wxSplitMode
+{
+ wxSPLIT_HORIZONTAL = 1,
+ wxSPLIT_VERTICAL
+};
+
+enum
+{
+ wxSPLIT_DRAG_NONE,
+ wxSPLIT_DRAG_DRAGGING,
+ wxSPLIT_DRAG_LEFT_DOWN
+};
+
/**
@class wxSplitterWindow
@endStyleTable
- @beginEventTable{wxSplitterEvent}
+ @beginEventEmissionTable{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
- at this point. Processes a wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING event.
+ at this point. Processes a @c wxEVT_SPLITTER_SASH_POS_CHANGING event.
@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.
- Processes a wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED event.
+ Processes a @c wxEVT_SPLITTER_SASH_POS_CHANGED event.
@event{EVT_SPLITTER_UNSPLIT(id, func)}
- The splitter has been just unsplit. Processes a wxEVT_COMMAND_SPLITTER_UNSPLIT event.
+ The splitter has been just unsplit. Processes a @c wxEVT_SPLITTER_UNSPLIT event.
@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
- to a value greater than zero). Processes a wxEVT_COMMAND_SPLITTER_DOUBLECLICKED event.
+ to a value greater than zero). Processes a @c wxEVT_SPLITTER_DOUBLECLICKED event.
@endEventTable
*/
int GetSashPosition() const;
+ /**
+ 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.
+
+ 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.
+
+ 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
+ */
+ int GetDefaultSashSize() const;
+
/**
Gets the split mode.
*/
void Initialize(wxWindow* window);
+ /**
+ 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;
+
/**
Returns @true if the window is split, @false otherwise.
*/
*/
void SetSashPosition(int position, bool redraw = true);
- /**
- Sets the sash size. Normally, the sash size is determined according to the
- metrics
- of each platform, but the application can override this, for example to show
- a thin sash that the user is not expected to drag. If @a size is more -1,
- the custom sash size will be used.
- */
- void SetSashSize(int size);
-
/**
Sets the split mode.
*/
void SetSplitMode(int mode);
+ /**
+ 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);
+
/**
Initializes the top and bottom panes of the splitter window.
The child windows are shown if they are currently hidden.
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
- at this point. Processes a wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING event.
+ at this point. Processes a @c wxEVT_SPLITTER_SASH_POS_CHANGING event.
@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.
- Processes a wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED event.
+ Processes a @c wxEVT_SPLITTER_SASH_POS_CHANGED event.
@event{EVT_SPLITTER_UNSPLIT(id, func)}
- The splitter has been just unsplit. Processes a wxEVT_COMMAND_SPLITTER_UNSPLIT event.
+ The splitter has been just unsplit. Processes a @c wxEVT_SPLITTER_UNSPLIT event.
@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
- to a value greater than zero). Processes a wxEVT_COMMAND_SPLITTER_DOUBLECLICKED event.
+ to a value greater than zero). Processes a @c wxEVT_SPLITTER_DOUBLECLICKED event.
@endEventTable
@library{wxcore}
@category{events}
- @see wxSplitterWindow, @ref overview_eventhandling
+ @see wxSplitterWindow, @ref overview_events
*/
class wxSplitterEvent : public wxNotifyEvent
{
Returns the new sash position.
May only be called while processing
- @c wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING and
- @c wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED events.
+ @c wxEVT_SPLITTER_SASH_POS_CHANGING and
+ @c wxEVT_SPLITTER_SASH_POS_CHANGED events.
*/
int GetSashPosition() const;
is unsplit.
May only be called while processing
- @c wxEVT_COMMAND_SPLITTER_UNSPLIT events.
+ @c wxEVT_SPLITTER_UNSPLIT events.
*/
wxWindow* GetWindowBeingRemoved() const;
Returns the x coordinate of the double-click point.
May only be called while processing
- @c wxEVT_COMMAND_SPLITTER_DOUBLECLICKED events.
+ @c wxEVT_SPLITTER_DOUBLECLICKED events.
*/
int GetX() const;
Returns the y coordinate of the double-click point.
May only be called while processing
- @c wxEVT_COMMAND_SPLITTER_DOUBLECLICKED events.
+ @c wxEVT_SPLITTER_DOUBLECLICKED events.
*/
int GetY() const;
/**
- In the case of @c wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED events,
+ In the case of @c wxEVT_SPLITTER_SASH_POS_CHANGED events,
sets the new sash position.
- In the case of @c wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING events,
+ In the case of @c wxEVT_SPLITTER_SASH_POS_CHANGING events,
sets the new tracking bar position so visual feedback during dragging will
represent that change that will actually take place. Set to -1 from
the event handler code to prevent repositioning.
May only be called while processing
- @c wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING and
- @c wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED events.
+ @c wxEVT_SPLITTER_SASH_POS_CHANGING and
+ @c wxEVT_SPLITTER_SASH_POS_CHANGED events.
@param pos
New sash position.
void SetSashPosition(int pos);
};
+
+wxEventType wxEVT_SPLITTER_SASH_POS_CHANGED;
+wxEventType wxEVT_SPLITTER_SASH_POS_CHANGING;
+wxEventType wxEVT_SPLITTER_DOUBLECLICKED;
+wxEventType wxEVT_SPLITTER_UNSPLIT;