A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://wxpython.org/Phoenix/docs/html/wx.SplitterWindow.html below:

wx.SplitterWindow — wxPython Phoenix 4.2.4a1 documentation

wx.SplitterWindow¶

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 wx.SplitterWindow user interface.

Window Styles¶

This class supports the following styles:

Events Emitted by this Class¶

Handlers bound for the following event types will receive a wx.SplitterEvent parameter.

Class Hierarchy¶

Inheritance diagram for class

SplitterWindow

:

Methods Summary¶ Properties Summary¶ Class API¶
class wx.SplitterWindow(Window)¶

Possible constructors:

SplitterWindow() -> None

SplitterWindow(parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize,
               style=SP_3D, name="splitterWindow") -> None

This class manages up to two subwindows.


Methods¶
__init__(self, *args, **kw)¶

Overloaded Implementations:

__init__ (self)

Default constructor.

Return type:

None

__init__ (self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=SP_3D, name=”splitterWindow”)

Constructor for creating the window.

Parameters:
  • parent (wx.Window) – The parent of the splitter window.

  • id (wx.WindowID) – The window identifier.

  • pos (wx.Point) – The window position.

  • size (wx.Size) – The window size.

  • style (long) – The window style. See wx.SplitterWindow.

  • name (string) – The window name.

Return type:

None

Note

After using this constructor, you must create either one or two subwindows with the splitter window as parent, and then call one of wx.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.



Create(self, parent, id=ID_ANY, point=DefaultPosition, size=DefaultSize, style=SP_3D, name='splitter')¶

Creation function, for two-step construction.

See wx.SplitterWindow for details.

Parameters:
Return type:

bool


static GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)¶
Parameters:

variant (WindowVariant)

Return type:

wx.VisualAttributes


GetDefaultSashSize(self)¶

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

Added in version 2.9.4.


GetMinimumPaneSize(self)¶

Returns the current minimum pane size (defaults to zero).

Return type:

int


GetSashGravity(self)¶

Returns the current sash gravity.

Return type:

float


GetSashPosition(self)¶

Returns the current sash position.

Return type:

int


GetSashSize(self)¶

Returns the default sash size in pixels or 0 if it is invisible.

Return type:

int


GetSplitMode(self)¶

Gets the split mode.

Return type:

wx.SplitMode


GetWindow1(self)¶

Returns the left/top or only pane.

Return type:

wx.Window


GetWindow2(self)¶

Returns the right/bottom pane.

Return type:

wx.Window


Initialize(self, window)¶

Initializes the splitter window to have one pane.

The child window is shown if it is currently hidden.

Parameters:

window (wx.Window) – The pane for the unsplit window.

Return type:

None

Note

This should be called if you wish to initially view only a single pane in the splitter window.


IsSashInvisible(self)¶

Returns True if the sash is invisible even when the window is split, False otherwise.

Return type:

bool

Added in version 2.9.4.

Note

This is a shortcut for HasFlag(wxSP_NOSASH)


IsSplit(self)¶

Returns True if the window is split, False otherwise.

Return type:

bool


ReplaceWindow(self, winOld, winNew)¶

This function replaces one of the windows managed by the wx.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


SetMinimumPaneSize(self, paneSize)¶

Sets the minimum pane size.

Parameters:

paneSize (int) – Minimum pane size in pixels.

Return type:

None

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 wx.SP_PERMIT_UNSPLIT style is used when a splitter window is created, the window may be unsplit even if minimum size is non-zero.


SetSashGravity(self, gravity)¶

Sets the sash gravity.

Parameters:

gravity (float) – The sash gravity. Value between 0.0 and 1.0.

Return type:

None

Notice that when sash gravity for a newly created splitter window, it is often necessary to explicitly set the splitter size using SetSize to ensure that is big enough for its initial sash position. Otherwise, i.e. if the window is created with the default tiny size and only resized to its correct size later, the initial sash position will be affected by the gravity and typically result in sash being at the rightmost position for the gravity of 1. See the example code creating wx.SplitterWindow in the splitter sample for more details.

Note

Gravity is real factor which controls position of sash while resizing wx.SplitterWindow. Gravity tells wx.SplitterWindow 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 wx.SplitterWindow.


SetSashInvisible(self, invisible=True)¶

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.

Return type:

None

Added in version 2.9.4.

Note

Only sets the internal variable; does not update the display.


SetSashPosition(self, position, redraw=True)¶

Sets the sash position.

Parameters:
  • position (int) – The sash position in pixels.

    Note that a position of 0 will set the sash to the middle of the window.

    A negative value will “wrap around” the sash’s position. For example, -10 will place the sash at 10 units from right of the splitter window.

  • redraw (bool) – If True, resizes the panes and redraws the sash and border.

Return type:

None

Note

Does not currently check for an out-of-range value.


SetSplitMode(self, mode)¶

Sets the split mode.

Parameters:

mode (int) – Can be wx.SPLIT_VERTICAL or wx.SPLIT_HORIZONTAL.

Return type:

None

Note

Only sets the internal variable; does not update the display.


SplitHorizontally(self, window1, window2, sashPosition=0)¶

Initializes the top and bottom panes of the splitter window.

The child windows are shown if they are currently hidden.

Parameters:
  • window1 (wx.Window) – The top pane.

  • window2 (wx.Window) – The bottom pane.

  • sashPosition (int) – 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).

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 .


SplitVertically(self, window1, window2, sashPosition=0)¶

Initializes the left and right panes of the splitter window.

The child windows are shown if they are currently hidden.

Parameters:
  • window1 (wx.Window) – The left pane.

  • window2 (wx.Window) – The right pane.

  • sashPosition (int) – 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).

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 .


Unsplit(self, toRemove=None)¶

Unsplits the window.

Parameters:

toRemove (wx.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.


UpdateSize(self)¶

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.

Return type:

None


Properties¶
DefaultSashSize¶

See GetDefaultSashSize


MinimumPaneSize¶

See GetMinimumPaneSize and SetMinimumPaneSize


SashGravity¶

See GetSashGravity and SetSashGravity


SashInvisible¶

See IsSashInvisible and SetSashInvisible


SashPosition¶

See GetSashPosition and SetSashPosition


SashSize¶

See GetSashSize


SplitMode¶

See GetSplitMode and SetSplitMode


Window1¶

See GetWindow1


Window2¶

See GetWindow2


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4