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

Inheritance diagram for class DynamicSashWindow:

super_classes Known Superclasses

wx.Window


method_summary Methods Summary

__init__

Create a new DynamicSashWindow.

AddChild

AddChild(child)

Create

Create(parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=0, name=PanelNameStr) -> bool

GetHScrollBar

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.


Methods

__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.



AddChild(self, child)

AddChild(child)

Adds a child window.



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.



GetHScrollBar(self, child)


GetVScrollBar(self, child)