Phoenix Logo

phoenix_title wx.lib.splitter.MultiSplitterWindow

This class is very similar to wx.SplitterWindow except that it allows for more than two windows and more than one sash. Many of the same styles, constants, and methods behave the same as in wx.SplitterWindow. The key differences are seen in the methods that deal with the child windows managed by the splitter, and also those that deal with the sash positions. In most cases you will need to pass an index value to tell the class which window or sash you are refering to.

The concept of the sash position is also different than in wx.SplitterWindow. Since the wx.Splitterwindow has only one sash you can think of it’s position as either relative to the whole splitter window, or as relative to the first window pane managed by the splitter. Once there is more than one sash then the distinciton between the two concepts needs to be clairified. I’ve chosen to use the second definition, and sash positions are the distance (either horizontally or vertically) from the origin of the window just before the sash in the splitter stack.

NOTE: These things are not yet supported:

  • Using negative sash positions to indicate a position offset from the end.
  • User controlled unsplitting (with double clicks on the sash or dragging a sash until the pane size is zero.)
  • Sash gravity

class_hierarchy Class Hierarchy

Inheritance diagram for class MultiSplitterWindow:


super_classes Known Superclasses

wx.Panel


method_summary Methods Summary

__init__ Default class constructor.
AppendWindow Add a new window to the splitter at the right side or bottom
DetachWindow Removes the window from the stack of windows managed by the
DoGetBestSize Overridden base class virtual. Determines the best size of
ExchangeWindows Trade the positions in the splitter of the two windows.
GetMinimumPaneSize Returns the smallest allowed size for a window pane.
GetOrientation Returns the current orientation of the splitter, either
GetSashPosition Returns the position of the idx’th sash, measured from the
GetWindow Returns the idx’th window being managed by the splitter.
InsertWindow Insert a new window into the splitter.
ReplaceWindow Replaces oldWindow (which is currently being managed by the
SetBackgroundColour Sets the back ground colour.
SetMinimumPaneSize Set the smallest size that any pane will be allowed to be
SetOrientation Set whether the windows managed by the splitter will be
SetSashPosition Set the position of the idx’th sash, measured from the left/top
SizeWindows Reposition and size the windows managed by the splitter.

api Class API



class MultiSplitterWindow(wx.Panel)

This class is very similar to wx.SplitterWindow except that it allows for more than two windows and more than one sash. Many of the same styles, constants, and methods behave the same as in wx.SplitterWindow. The key differences are seen in the methods that deal with the child windows managed by the splitter, and also those that deal with the sash positions. In most cases you will need to pass an index value to tell the class which window or sash you are refering to.

The concept of the sash position is also different than in wx.SplitterWindow. Since the wx.Splitterwindow has only one sash you can think of it’s position as either relative to the whole splitter window, or as relative to the first window pane managed by the splitter. Once there is more than one sash then the distinciton between the two concepts needs to be clairified. I’ve chosen to use the second definition, and sash positions are the distance (either horizontally or vertically) from the origin of the window just before the sash in the splitter stack.

NOTE: These things are not yet supported:

  • Using negative sash positions to indicate a position offset from the end.
  • User controlled unsplitting (with double clicks on the sash or dragging a sash until the pane size is zero.)
  • Sash gravity

Methods



__init__(self, parent, id=-1, pos = wx.DefaultPosition, size = wx.DefaultSize, style = 0, name="multiSplitter")

Default class constructor.

Parameters:
  • parent (wx.Window) – the parent window
  • id (integer) – an identifier for the control: a value of -1 is taken to mean a default
  • pos (wx.Point) – the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPython, depending on platform
  • size (wx.Size) – the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform
  • style (integer) – the control window style
  • name (string) – the control name


AppendWindow(self, window, sashPos=-1)

Add a new window to the splitter at the right side or bottom of the window stack.

Parameters:
  • window – the window to add to the splitter
  • sashPos – if given it is used to size the new window


DetachWindow(self, window)

Removes the window from the stack of windows managed by the splitter. The window will still exist so you should Hide or Destroy it as needed.

Parameters:window – the window to be removed from the splitter


DoGetBestSize(self)

Overridden base class virtual. Determines the best size of the control based on the best sizes of the child windows.



ExchangeWindows(self, window1, window2)

Trade the positions in the splitter of the two windows.

Parameters:
  • window1 – the first window to switch position
  • window2 – the second window to switch position


GetMinimumPaneSize(self)

Returns the smallest allowed size for a window pane.



GetOrientation(self)

Returns the current orientation of the splitter, either wx.VERTICAL or wx.HORIZONTAL.



GetSashPosition(self, idx)

Returns the position of the idx’th sash, measured from the left/top of the window preceding the sash.

Parameters:idx (int) – get the sash position of the given index


GetWindow(self, idx)

Returns the idx’th window being managed by the splitter.

Parameters:idx (int) – get the window at the given index


InsertWindow(self, idx, window, sashPos=-1)

Insert a new window into the splitter.

Parameters:
  • idx (int) – the position to insert the window at.
  • window – the window to add to the splitter
  • sashPos – if given it is used to size the new window


ReplaceWindow(self, oldWindow, newWindow)

Replaces oldWindow (which is currently being managed by the splitter) with newWindow. The oldWindow window will still exist so you should Hide or Destroy it as needed.

Parameters:
  • oldWindow – the window to be replace
  • newWindow – the window to replace the above window


SetBackgroundColour(self, color)

Sets the back ground colour.

Parameters:color (wx.Colour) – the colour to use.


SetMinimumPaneSize(self, minSize)

Set the smallest size that any pane will be allowed to be resized to.

Parameters:minSize (int) – the minimum size of pane


SetOrientation(self, orient)

Set whether the windows managed by the splitter will be stacked vertically or horizontally. The default is horizontal.

Parameters:orient – either wx.VERTICAL or wx.HORIZONTAL


SetSashPosition(self, idx, pos)

Set the position of the idx’th sash, measured from the left/top of the window preceding the sash.

Parameters:
  • idx (int) – set the sash position of the given index
  • pos (int) – the sash position


SizeWindows(self)

Reposition and size the windows managed by the splitter. Useful when windows have been added/removed or when styles have been changed.