.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2017 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc

.. currentmodule:: wx.lib.agw.fourwaysplitter

.. highlight:: python



.. _wx.lib.agw.fourwaysplitter.FourWaySplitter:

==========================================================================================================================================
|phoenix_title|  **wx.lib.agw.fourwaysplitter.FourWaySplitter**
==========================================================================================================================================

This class is very similar to :class:`SplitterWindow` except that it
allows for four windows and two sashes.  Many of the same styles,
constants, and methods behave the same as in :class:`SplitterWindow`.
However, in addition of the ability to drag the vertical and the
horizontal sash, by dragging at the intersection between the two
sashes, it is possible to resize the four windows at the same time.

:note: These things are not yet supported:

 * Minimum pane size (minimum of what? Width? Height?);
 * Using negative sash positions to indicate a position offset from the end;
 * User controlled unsplitting with double clicks on the sash (but supported via the
   :meth:`FourWaySplitter.SetExpanded() <FourWaySplitter.SetExpanded>` method);
 * Sash gravity.



|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>FourWaySplitter</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.lib.agw.fourwaysplitter.FourWaySplitter_inheritance.png" alt="Inheritance diagram of FourWaySplitter" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.agw.fourwaysplitter.FourWaySplitter.html" title="wx.lib.agw.fourwaysplitter.FourWaySplitter" alt="" coords="4,392,285,421"/> <area shape="rect" id="node2" href="wx.Panel.html" title="wx.Panel" alt="" coords="107,315,183,344"/> <area shape="rect" id="node3" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="37,5,139,35"/> <area shape="rect" id="node4" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="89,83,200,112"/> <area shape="rect" id="node6" href="wx.WindowBase.html" title="wx.WindowBase" alt="" coords="85,160,205,189"/> <area shape="rect" id="node5" href="wx.Object.html" title="wx.Object" alt="" coords="163,5,244,35"/> <area shape="rect" id="node7" href="wx.Window.html" title="wx.Window" alt="" coords="101,237,189,267"/> </map> 
   </p>

|


|appearance| Control Appearance
===============================

|

.. figure:: _static/images/widgets/fullsize/wxmsw/wx.lib.agw.fourwaysplitter.fourwaysplitter.png
   :alt: wxMSW
   :figclass: floatleft

   **wxMSW**


.. figure:: _static/images/widgets/fullsize/wxmac/../no_appearance.png
   :alt: wxMAC
   :figclass: floatright

   **wxMAC**


.. figure:: _static/images/widgets/fullsize/wxgtk/../no_appearance.png
   :alt: wxGTK
   :figclass: floatcenter

   **wxGTK**


|




|super_classes| Known Superclasses
==================================

:class:`wx.Panel`

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.__init__`                     Default class constructor.
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.AdjustLayout`                 Adjust layout of :class:`FourWaySplitter`. Mainly used to recalculate the
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.AppendWindow`                 Add a new window to the splitter at the right side or bottom
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.DetachWindow`                 Removes the window from the stack of windows managed by the splitter. The
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.DoGetBestSize`                Gets the size which best suits the window: for a control, it would be the
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.DoSendChangingEvent`          Sends a ``EVT_SPLITTER_SASH_POS_CHANGING`` event.
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.DrawSplitter`                 Actually draws the sashes.
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.DrawTrackSplitter`            Draws a fake sash in case we don't have ``wx.SP_LIVE_UPDATE`` style.
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.ExchangeWindows`              Trade the positions in the splitter of the two windows.
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.GetAGWWindowStyleFlag`        Returns the :class:`FourWaySplitter` window style.
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.GetBottomLeft`                Returns the bottom left window (window index: 2).
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.GetBottomRight`               Returns the bottom right window (window index: 3).
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.GetMode`                      Determines the split mode for :class:`FourWaySplitter`.
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.GetTopLeft`                   Returns the top left window (window index: 0).
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.GetTopRight`                  Returns the top right window (window index: 1).
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.GetWindow`                    Returns the window at the index `idx`.
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.InsertWindow`                 Insert a new window into the splitter at the position given in `idx`.
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.MoveSplit`                    Moves the split accordingly to user action.
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.OnEnterWindow`                Handles the ``wx.EVT_ENTER_WINDOW`` event for :class:`FourWaySplitter`.
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.OnLeaveWindow`                Handles the ``wx.EVT_LEAVE_WINDOW`` event for :class:`FourWaySplitter`.
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.OnLeftDown`                   Handles the ``wx.EVT_LEFT_DOWN`` event for :class:`FourWaySplitter`.
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.OnLeftUp`                     Handles the ``wx.EVT_LEFT_UP`` event for :class:`FourWaySplitter`.
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.OnMotion`                     Handles the ``wx.EVT_MOTION`` event for :class:`FourWaySplitter`.
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.OnPaint`                      Handles the ``wx.EVT_PAINT`` event for :class:`FourWaySplitter`.
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.OnSize`                       Handles the ``wx.EVT_SIZE`` event for :class:`FourWaySplitter`.
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.ReplaceWindow`                Replaces `oldWindow` (which is currently being managed by the
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.SetAGWWindowStyleFlag`        Sets the :class:`FourWaySplitter` window style flags.
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.SetExpanded`                  This method is used to expand one of the four window to fill the
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.SetHSplit`                    Change horizontal split fraction.
:meth:`~wx.lib.agw.fourwaysplitter.FourWaySplitter.SetVSplit`                    Change vertical split fraction.
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: FourWaySplitter(wx.Panel)

   This class is very similar to :class:`SplitterWindow` except that it
   allows for four windows and two sashes.  Many of the same styles,
   constants, and methods behave the same as in :class:`SplitterWindow`.
   However, in addition of the ability to drag the vertical and the
   horizontal sash, by dragging at the intersection between the two
   sashes, it is possible to resize the four windows at the same time.
   
   :note: These things are not yet supported:
   
    * Minimum pane size (minimum of what? Width? Height?);
    * Using negative sash positions to indicate a position offset from the end;
    * User controlled unsplitting with double clicks on the sash (but supported via the
      :meth:`FourWaySplitter.SetExpanded() <FourWaySplitter.SetExpanded>` method);
    * Sash gravity.

   .. method:: __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, agwStyle=0, name="FourWaySplitter")

      Default class constructor.
      
      :param `parent`: parent window. Must not be ``None``;
      :param `id`: window identifier. A value of -1 indicates a default value;
      :param `pos`: the control position. A value of (-1, -1) indicates a default position,
       chosen by either the windowing system or wxPython, depending on platform;
      :param `size`: the control size. A value of (-1, -1) indicates a default size,
       chosen by either the windowing system or wxPython, depending on platform;
      :param `style`: the underlying :class:`Panel` window style;
      :param `agwStyle`: the AGW-specific window style. It can be a combination of the
       following bits:
      
       ================== =========== ==================================================
       Window Styles      Hex Value   Description
       ================== =========== ==================================================
       ``SP_NOSASH``             0x10 No sash will be drawn on :class:`FourWaySplitter`.
       ``SP_LIVE_UPDATE``        0x80 Don't draw XOR line but resize the child windows immediately.
       ``SP_3DBORDER``          0x200 Draws a 3D effect border.
       ================== =========== ==================================================
      
      :param `name`: the window name.


   .. method:: AdjustLayout(self)

      Adjust layout of :class:`FourWaySplitter`. Mainly used to recalculate the
      correct values for split fractions.


   .. method:: AppendWindow(self, window)

      Add a new window to the splitter at the right side or bottom
      of the window stack.
      
      :param `window`: an instance of :class:`wx.Window`.


   .. method:: 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.
      
      :param `window`: an instance of :class:`wx.Window`.


   .. method:: DoGetBestSize(self)

      Gets the size which best suits the window: for a control, it would be the
      minimal size which doesn't truncate the control, for a panel - the same size
      as it would have after a call to `Fit()`.
      
      :note: Overridden from :class:`Panel`.


   .. method:: DoSendChangingEvent(self, pt)

      Sends a ``EVT_SPLITTER_SASH_POS_CHANGING`` event.
      
      :param `pt`: the point at which the splitter is being positioned.


   .. method:: DrawSplitter(self, dc)

      Actually draws the sashes.
      
      :param `dc`: an instance of :class:`wx.DC`.


   .. method:: DrawTrackSplitter(self, x, y)

      Draws a fake sash in case we don't have ``wx.SP_LIVE_UPDATE`` style.
      
      :param `x`: the `x` position of the sash;
      :param `y`: the `y` position of the sash.
      
      :note: This method relies on :class:`ScreenDC` which is currently unavailable on wxMac.


   .. method:: ExchangeWindows(self, window1, window2)

      Trade the positions in the splitter of the two windows.
      
      :param `window1`: an instance of :class:`wx.Window`;
      :param `window2`: another instance of :class:`wx.Window`.


   .. method:: GetAGWWindowStyleFlag(self)

      Returns the :class:`FourWaySplitter` window style.
      
      :see: :meth:`~FourWaySplitter.SetAGWWindowStyleFlag` for a list of possible window styles.


   .. method:: GetBottomLeft(self)

      Returns the bottom left window (window index: 2). 


   .. method:: GetBottomRight(self)

      Returns the bottom right window (window index: 3). 


   .. method:: GetMode(self, pt)

      Determines the split mode for :class:`FourWaySplitter`.
      
      :param `pt`: the point at which the mouse has been clicked, an instance of
       :class:`wx.Point`.
      
      :return: One of the following 3 split modes:
      
       ================= ==============================
       Split Mode        Description
       ================= ==============================
       ``wx.HORIZONTAL`` the user has clicked on the horizontal sash
       ``wx.VERTICAL``   The user has clicked on the vertical sash
       ``wx.BOTH``       The user has clicked at the intersection between the 2 sashes
       ================= ==============================


   .. method:: GetTopLeft(self)

      Returns the top left window (window index: 0). 


   .. method:: GetTopRight(self)

      Returns the top right window (window index: 1). 


   .. method:: GetWindow(self, idx)

      Returns the window at the index `idx`.
      
      :param `idx`: the index at which the window is located.


   .. method:: InsertWindow(self, idx, window, sashPos=-1)

      Insert a new window into the splitter at the position given in `idx`.
      
      :param `idx`: the index at which the window will be inserted;
      :param `window`: an instance of :class:`wx.Window`;
      :param `sashPos`: the sash position after the window insertion.


   .. method:: MoveSplit(self, x, y)

      Moves the split accordingly to user action.
      
      :param `x`: the new splitter `x` coordinate;
      :param `y`: the new splitter `y` coordinate.


   .. method:: OnEnterWindow(self, event)

      Handles the ``wx.EVT_ENTER_WINDOW`` event for :class:`FourWaySplitter`.
      
      :param `event`: a :class:`MouseEvent` event to be processed.


   .. method:: OnLeaveWindow(self, event)

      Handles the ``wx.EVT_LEAVE_WINDOW`` event for :class:`FourWaySplitter`.
      
      :param `event`: a :class:`MouseEvent` event to be processed.


   .. method:: OnLeftDown(self, event)

      Handles the ``wx.EVT_LEFT_DOWN`` event for :class:`FourWaySplitter`.
      
      :param `event`: a :class:`MouseEvent` event to be processed.


   .. method:: OnLeftUp(self, event)

      Handles the ``wx.EVT_LEFT_UP`` event for :class:`FourWaySplitter`.
      
      :param `event`: a :class:`MouseEvent` event to be processed.


   .. method:: OnMotion(self, event)

      Handles the ``wx.EVT_MOTION`` event for :class:`FourWaySplitter`.
      
      :param `event`: a :class:`MouseEvent` event to be processed.


   .. method:: OnPaint(self, event)

      Handles the ``wx.EVT_PAINT`` event for :class:`FourWaySplitter`.
      
      :param `event`: a :class:`PaintEvent` event to be processed.


   .. method:: OnSize(self, event)

      Handles the ``wx.EVT_SIZE`` event for :class:`FourWaySplitter`.
      
      :param `event`: a :class:`wx.SizeEvent` event to be processed.


   .. method:: 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.
      
      :param `oldWindow`: an instance of :class:`wx.Window`;
      :param `newWindow`: another instance of :class:`wx.Window`.


   .. method:: SetAGWWindowStyleFlag(self, agwStyle)

      Sets the :class:`FourWaySplitter` window style flags.
      
      :param `agwStyle`: the AGW-specific window style. This can be a combination of the
       following bits:
      
       ================== =========== ==================================================
       Window Styles      Hex Value   Description
       ================== =========== ==================================================
       ``SP_NOSASH``             0x10 No sash will be drawn on :class:`FourWaySplitter`.
       ``SP_LIVE_UPDATE``        0x80 Don't draw XOR line but resize the child windows immediately.
       ``SP_3DBORDER``          0x200 Draws a 3D effect border.
       ================== =========== ==================================================


   .. method:: SetExpanded(self, expanded)

      This method is used to expand one of the four window to fill the
      whole client size (when `expanded` >= 0) or to return to the four-window
      view (when `expanded` < 0).
      
      :param `expanded`: an integer >= 0 to expand a window to fill the whole
       client size, or an integer < 0 to return to the four-window view.


   .. method:: SetHSplit(self, s)

      Change horizontal split fraction.
      
      :param `s`: the split fraction, which is an integer value between 0 and
       10000 (inclusive), indicating how much space to allocate to the leftmost
       panes. For example, to split the panes at 35 percent, use::
      
          fourSplitter.SetHSplit(3500)


   .. method:: SetVSplit(self, s)

      Change vertical split fraction.
      
      :param `s`: the split fraction, which is an integer value between 0 and
       10000 (inclusive), indicating how much space to allocate to the topmost
       panes. For example, to split the panes at 35 percent, use::
      
          fourSplitter.SetVSplit(3500)


