.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2020 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

Inheritance diagram for class
DynamicSashWindow:
|
|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` AddChild(child : WindowBase) -> None
:meth:`~wx.lib.gizmos.dynamicsash.DynamicSashWindow.Create` Create(parent : Window, id: int=ID_ANY, pos: Point=DefaultPosition, size: Size=DefaultSize, style: int=0, name: str=PanelNameStr) -> bool
: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)
AddChild(child : WindowBase) -> None
Adds a child window.
.. method:: Create(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=DS_DEFAULT, name='dynamicSashWindow')
Create(parent : Window, id: int=ID_ANY, pos: Point=DefaultPosition, size: Size=DefaultSize, style: int=0, name: str=PanelNameStr) -> bool
Construct the actual window object after creating the C++ object.
.. method:: GetHScrollBar(self, child)
.. method:: GetVScrollBar(self, child)