1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182
|
.. 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
<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>
<script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
<map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.gizmos.dynamicsash.DynamicSashWindow.html" title="wx.lib.gizmos.dynamicsash.DynamicSashWindow" alt="" coords="5,315,352,344"/> <area shape="rect" id="node2" href="wx.Window.html" title="wx.Window" alt="" coords="130,237,227,267"/> <area shape="rect" id="node3" href="wx.WindowBase.html" title="wx.WindowBase" alt="" coords="114,160,243,189"/> <area shape="rect" id="node4" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="120,83,237,112"/> <area shape="rect" id="node5" href="wx.Object.html" title="wx.Object" alt="" coords="75,5,162,35"/> <area shape="rect" id="node6" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="187,5,293,35"/> </map>
</p>
</div>
|
|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)
:meth:`~wx.lib.gizmos.dynamicsash.DynamicSashWindow.Create` Create(parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=0, name=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)
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, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=0, name=PanelNameStr) -> bool
Construct the actual window object after creating the C++ object.
.. method:: GetHScrollBar(self, child)
.. method:: GetVScrollBar(self, child)
|