.. wxPython Phoenix documentation

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

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

.. include:: headings.inc

.. currentmodule:: wx.lib.gizmos.dynamicsash

.. highlight:: python



.. _wx.lib.gizmos.dynamicsash.DynamicSashWindow:

==========================================================================================================================================
|phoenix_title|  **wx.lib.gizmos.dynamicsash.DynamicSashWindow**
==========================================================================================================================================

A DynamicSashWindow widget manages the way other widgets are viewed. When
a DynamicSashWindow is first shown, it will contain one child view, a
viewport for that child, and a pair of scrollbars to allow the user to
navigate the child view area.  Next to each scrollbar is a small tab.  By
clicking on either tab and dragging to the appropriate spot, a user can
split the view area into two smaller views separated by a draggable sash.
Later, when the user wishes to reunify the two subviews, the user simply
drags the sash to the side of the window. DynamicSashWindow will
automatically reparent the appropriate child view back up the window
hierarchy, and the DynamicSashWindow will have only one child view once
again.

As an application developer, you will simply create a DynamicSashWindow
using either the Create() function or the more complex constructor
provided below, and then create a view window whose parent is the
DynamicSashWindow.  The child should respond to DynamicSashSplitEvents --
perhaps with an OnSplit() event handler -- by constructing a new view
window whose parent is also the DynamicSashWindow.  That's it!  Now your
users can dynamically split and reunify the view you provided.

If you wish to handle the scrollbar events for your view, rather than
allowing DynamicSashWindow to do it for you, things are a bit more
complex.  (You might want to handle scrollbar events yourself, if, for
instance, you wish to scroll a subwindow of the view you add to your
DynamicSashWindow object, rather than scrolling the whole view.) In this
case, you will need to construct your DynamicSashWindow without the
wxDS_MANAGE_SCROLLBARS style and  you will need to use the GetHScrollBar()
and GetVScrollBar() methods to retrieve the scrollbar controls and call
SetEventHandler() on them to redirect the scrolling events whenever your
window is reparented by wxDyanmicSashWindow. You will need to set the
scrollbars' event handler at three times:

    *  When your view is created When your view receives a
    *  DynamicSashSplitEvent When your view receives a
    *  DynamicSashUnifyEvent

See the dynsash_switch sample application for an example which does this.



|

|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>DynamicSashWindow</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.gizmos.dynamicsash.DynamicSashWindow_inheritance.png" alt="Inheritance diagram of DynamicSashWindow" 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.Trackable.html" title="wx.Trackable" alt="" coords="63,5,164,35"/> <area shape="rect" id="node2" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="115,83,225,112"/> <area shape="rect" id="node6" href="wx.WindowBase.html" title="wx.WindowBase" alt="" coords="110,160,231,189"/> <area shape="rect" id="node3" href="wx.Object.html" title="wx.Object" alt="" coords="188,5,269,35"/> <area shape="rect" id="node4" href="wx.lib.gizmos.dynamicsash.DynamicSashWindow.html" title="wx.lib.gizmos.dynamicsash.DynamicSashWindow" alt="" coords="4,315,336,344"/> <area shape="rect" id="node5" href="wx.Window.html" title="wx.Window" alt="" coords="126,237,215,267"/> </map> 
   </p>

|


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

:class:`wx.Window`

|


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

================================================================================ ================================================================================
:meth:`~wx.lib.gizmos.dynamicsash.DynamicSashWindow.__init__`                    Create a new DynamicSashWindow.
:meth:`~wx.lib.gizmos.dynamicsash.DynamicSashWindow.AddChild`                    
:meth:`~wx.lib.gizmos.dynamicsash.DynamicSashWindow.Create`                      
:meth:`~wx.lib.gizmos.dynamicsash.DynamicSashWindow.GetHScrollBar`               
:meth:`~wx.lib.gizmos.dynamicsash.DynamicSashWindow.GetVScrollBar`               
================================================================================ ================================================================================


|


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


.. class:: DynamicSashWindow(wx.Window)

   A DynamicSashWindow widget manages the way other widgets are viewed. When
   a DynamicSashWindow is first shown, it will contain one child view, a
   viewport for that child, and a pair of scrollbars to allow the user to
   navigate the child view area.  Next to each scrollbar is a small tab.  By
   clicking on either tab and dragging to the appropriate spot, a user can
   split the view area into two smaller views separated by a draggable sash.
   Later, when the user wishes to reunify the two subviews, the user simply
   drags the sash to the side of the window. DynamicSashWindow will
   automatically reparent the appropriate child view back up the window
   hierarchy, and the DynamicSashWindow will have only one child view once
   again.
   
   As an application developer, you will simply create a DynamicSashWindow
   using either the Create() function or the more complex constructor
   provided below, and then create a view window whose parent is the
   DynamicSashWindow.  The child should respond to DynamicSashSplitEvents --
   perhaps with an OnSplit() event handler -- by constructing a new view
   window whose parent is also the DynamicSashWindow.  That's it!  Now your
   users can dynamically split and reunify the view you provided.
   
   If you wish to handle the scrollbar events for your view, rather than
   allowing DynamicSashWindow to do it for you, things are a bit more
   complex.  (You might want to handle scrollbar events yourself, if, for
   instance, you wish to scroll a subwindow of the view you add to your
   DynamicSashWindow object, rather than scrolling the whole view.) In this
   case, you will need to construct your DynamicSashWindow without the
   wxDS_MANAGE_SCROLLBARS style and  you will need to use the GetHScrollBar()
   and GetVScrollBar() methods to retrieve the scrollbar controls and call
   SetEventHandler() on them to redirect the scrolling events whenever your
   window is reparented by wxDyanmicSashWindow. You will need to set the
   scrollbars' event handler at three times:
   
       *  When your view is created When your view receives a
       *  DynamicSashSplitEvent When your view receives a
       *  DynamicSashUnifyEvent
   
   See the dynsash_switch sample application for an example which does this.

   .. method:: __init__(self, \*args, \*\*kw)

      Create a new DynamicSashWindow.
      
      Both the normal constructor style with all parameters, or wxWidgets
      2-phase style default constructor is supported. If the default
      constructor is used then the Create method will need to be called
      later before the widget can actually be used.


   .. method:: AddChild(self, child)


   .. method:: Create(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=DS_DEFAULT, name='dynamicSashWindow')


   .. method:: GetHScrollBar(self, child)


   .. method:: GetVScrollBar(self, child)


