This class manages up to two subwindows.
The current view can be split into two programmatically (perhaps from a menu command), and unsplit either programmatically or via the SplitterWindow user interface.
This class supports the following styles:
Handlers bound for the following event types will receive a SplitterEvent parameter.
See also
__init__ | Default constructor. |
Create | Creation function, for two-step construction. |
GetDefaultSashSize | Returns the default sash size in pixels. |
GetMinimumPaneSize | Returns the current minimum pane size (defaults to zero). |
GetSashGravity | Returns the current sash gravity. |
GetSashPosition | Returns the current sash position. |
GetSashSize | Returns the default sash size in pixels or 0 if it is invisible. |
GetSplitMode | Gets the split mode. |
GetWindow1 | Returns the left/top or only pane. |
GetWindow2 | Returns the right/bottom pane. |
Initialize | Initializes the splitter window to have one pane. |
IsSashInvisible | Returns True if the sash is invisible even when the window is split, False otherwise. |
IsSplit | Returns True if the window is split, False otherwise. |
ReplaceWindow | This function replaces one of the windows managed by the SplitterWindow with another one. |
SetMinimumPaneSize | Sets the minimum pane size. |
SetSashGravity | Sets the sash gravity. |
SetSashInvisible | Sets whether the sash should be invisible, even when the window is split. |
SetSashPosition | Sets the sash position. |
SetSplitMode | Sets the split mode. |
SplitHorizontally | Initializes the top and bottom panes of the splitter window. |
SplitVertically | Initializes the left and right panes of the splitter window. |
Unsplit | Unsplits the window. |
UpdateSize | Causes any pending sizing of the sash and child panes to take place immediately. |
DefaultSashSize | See GetDefaultSashSize |
MinimumPaneSize | See GetMinimumPaneSize and SetMinimumPaneSize |
SashGravity | See GetSashGravity and SetSashGravity |
SashPosition | See GetSashPosition and SetSashPosition |
SashSize | See GetSashSize |
SplitMode | See GetSplitMode and SetSplitMode |
Window1 | See GetWindow1 |
Window2 | See GetWindow2 |
This class manages up to two subwindows.
Possible constructors:
SplitterWindow()
SplitterWindow(parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize,
style=SP_3D, name="splitterWindow")
Overloaded Implementations:
__init__ (self)
Default constructor.
__init__ (self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=SP_3D, name=”splitterWindow”)
Constructor for creating the window.
Parameters: |
|
---|
Note
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.
See also
Creation function, for two-step construction.
See SplitterWindow for details.
Parameters: | |
---|---|
Return type: | bool |
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.
Return type: | int |
---|
New in version 2.9.4.
Returns the current minimum pane size (defaults to zero).
Return type: | int |
---|
See also
Returns the current sash gravity.
Return type: | float |
---|
See also
Returns the current sash position.
Return type: | int |
---|
See also
Returns the default sash size in pixels or 0 if it is invisible.
Return type: | int |
---|
See also
Initializes the splitter window to have one pane.
The child window is shown if it is currently hidden.
Parameters: | window (Window) – The pane for the unsplit window. |
---|
Note
This should be called if you wish to initially view only a single pane in the splitter window.
See also
Returns True if the sash is invisible even when the window is split, False otherwise.
Return type: | bool |
---|
New in version 2.9.4.
Note
This is a shortcut for HasFlag(wxSP_NOSASH)
See also
Returns True if the window is split, False otherwise.
Return type: | bool |
---|
This function replaces one of the windows managed by the SplitterWindow 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.
Both parameters should be not None and winOld must specify one of the 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.
Parameters: | |
---|---|
Return type: | bool |
See also
Sets the minimum pane size.
Parameters: | paneSize (int) – Minimum pane size in pixels. |
---|
Note
The default minimum pane size is zero, which means that either 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 SP_PERMIT_UNSPLIT style is used when a splitter window is created, the window may be unsplit even if minimum size is non-zero.
See also
Sets the sash gravity.
Parameters: | gravity (float) – The sash gravity. Value between 0.0 and 1.0. |
---|
Note
Gravity is real factor which controls position of sash while resizing SplitterWindow. Gravity tells SplitterWindow how much will left/top window grow while resizing. Example values:
See also
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.
Parameters: | invisible (bool) – If True, the sash is always invisible, else it is shown when the window is split. |
---|
New in version 2.9.4.
Note
Only sets the internal variable; does not update the display.
See also
Sets the sash position.
Parameters: |
|
---|
Note
Does not currently check for an out-of-range value.
See also
Sets the split mode.
Parameters: | mode (int) – Can be SPLIT_VERTICAL or SPLIT_HORIZONTAL. |
---|
Note
Only sets the internal variable; does not update the display.
See also
Initializes the top and bottom panes of the splitter window.
The child windows are shown if they are currently hidden.
Parameters: |
|
---|---|
Return type: | bool |
Returns: | True if successful, False otherwise (the window was already split). |
Note
This should be called if you wish to initially view two panes. It can also be called at any subsequent time, but the application should check that the window is not currently split using IsSplit .
See also
Initializes the left and right panes of the splitter window.
The child windows are shown if they are currently hidden.
Parameters: |
|
---|---|
Return type: | bool |
Returns: | True if successful, False otherwise (the window was already split). |
Note
This should be called if you wish to initially view two panes. It can also be called at any subsequent time, but the application should check that the window is not currently split using IsSplit .
See also
SplitHorizontally , IsSplit , Unsplit .
Unsplits the window.
Parameters: | toRemove (Window) – The pane to remove, or None to remove the right or bottom pane. |
---|---|
Return type: | bool |
Returns: | True if successful, False otherwise (the window was not split). |
Note
This call will not actually delete the pane being removed; it calls OnUnsplit which can be overridden for the desired behaviour. By default, the pane being removed is hidden.
See also
SplitHorizontally , SplitVertically , IsSplit , OnUnsplit
Causes any pending sizing of the sash and child panes to take place immediately.
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.
See GetMinimumPaneSize and SetMinimumPaneSize
See GetSashGravity and SetSashGravity
See GetSashPosition and SetSashPosition
See GetSashSize
See GetSplitMode and SetSplitMode
See GetWindow1
See GetWindow2