;ò +_’Ac@sÉdkZdkiZdkiZdeifd„ƒYZdZdeifd„ƒYZ d„Z dZ e djoPdk Z dkZdkZeid eiie id ƒge id ƒndS( NsTestViewcBsGtZd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(NcCs©tii|||dtiƒ||_||_ |i ƒ|i ddƒ|i ti tidtititiƒƒ|iti|iƒ|iti|iƒdS(Nsstyleiii (sstcsStyledTextCtrls__init__sselfsparentsIDswxs NO_BORDERsdyn_sashslogsSetupScrollBarssSetMarginWidths StyleSetFontsSTC_STYLE_DEFAULTsFontsMODERNsNORMALsBindsgizmossEVT_DYNAMIC_SASH_SPLITsOnSplitsEVT_DYNAMIC_SASH_UNIFYsOnUnify(sselfsparentsIDslog((sq/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/DynamicSashWindow.pys__init__ s    "cCsš|ii|ƒ}|ii|ƒ}|iti|i ƒ|iti|i ƒ|iti |i ƒ|iti |i ƒ|i |ƒ|i |ƒdS(N(sselfsdyn_sashs GetVScrollBarsv_bars GetHScrollBarsh_barsBindswxs EVT_SCROLLs OnSBScrolls EVT_SET_FOCUSs OnSBFocuss SetVScrollBars SetHScrollBar(sselfsh_barsv_bar((sq/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/DynamicSashWindow.pysSetupScrollBarss cCs|iidƒdS(NsTestView.__del__ (sselfslogswrite(sself((sq/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/DynamicSashWindow.pys__del__)scCsI|iidƒt|id|iƒ}|i|iƒƒ|iƒdS(NsTestView.OnSplit iÿÿÿÿ( sselfslogswritesTestViewsdyn_sashsnewviews SetDocPointers GetDocPointersSetupScrollBars(sselfsevtsnewview((sq/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/DynamicSashWindow.pysOnSplit,scCs|iidƒ|iƒdS(NsTestView.OnUnify (sselfslogswritesSetupScrollBars(sselfsevt((sq/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/DynamicSashWindow.pysOnUnify3scCs|iƒi|ƒdS(N(sselfsGetEventHandlers ProcessEventsevt(sselfsevt((sq/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/DynamicSashWindow.pys OnSBScroll8scCs|iƒdS(N(sselfsSetFocus(sselfsevt((sq/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/DynamicSashWindow.pys OnSBFocus<s( s__name__s __module__s__init__sSetupScrollBarss__del__sOnSplitsOnUnifys OnSBScrolls OnSBFocus(((sq/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/DynamicSashWindow.pysTestView s      sYou can drag the little tabs above the vertical scrollbar, or to the left of the horizontal scrollbar to split this view, and you can continue splitting the new views as much as you like. Try it and see. In this case the views also share the same document so changes in one are instantly seen in the others. This is a feature of the StyledTextCtrl that is used for the view class in this sample. s SimpleViewcBstZd„Zd„ZRS(NcCsOtii|||ƒ||_||_|idƒ|i t i |i ƒdS(Ns LIGHT BLUE( swxsPanels__init__sselfsparentsIDsdyn_sashslogsSetBackgroundColoursBindsgizmossEVT_DYNAMIC_SASH_SPLITsOnSplit(sselfsparentsIDslog((sq/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/DynamicSashWindow.pys__init__Ps    cCst|id|iƒ}dS(Niÿÿÿÿ(s SimpleViewsselfsdyn_sashslogsv(sselfsevtsv((sq/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/DynamicSashWindow.pysOnSplitWs(s__name__s __module__s__init__sOnSplit(((sq/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/DynamicSashWindow.pys SimpleViewOs cCsÖtidjo-dkl}||ddtiƒ}|Snnofti|ddti ƒ}|i ti dti ti ti ƒƒt|d|ƒ}|itƒn%ti|dƒ}t|d|ƒ}|SdS( Ns __WXMAC__(s MessagePanelsIThis demo currently fails on the Mac. The problem is being looked into...sSorryiiÿÿÿÿsstylei (swxsPlatformsMains MessagePanelsnbs ICON_WARNINGswinsgizmossDynamicSashWindows CLIP_CHILDRENsSetFontsFontsMODERNsNORMALsTestViewslogsviewsSetTexts sampleTexts SimpleView(sframesnbslogswinsviews MessagePanel((sq/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/DynamicSashWindow.pysrunTest]s  (s›

DynamicSashWindow

wxDynamicSashWindow widgets manages the way other widgets are viewed. When a wxDynamicSashWindow 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. wxDynamicSashWindow will automatically reparent the appropriate child view back up the window hierarchy, and the wxDynamicSashWindow will have only one child view once again.

As an application developer, you will simply create a wxDynamicSashWindow using either the Create() function or the more complex constructor provided below, and then create a view window whose parent is the wxDynamicSashWindow. The child should respond to wxDynamicSashSplitEvents -- perhaps with an OnSplit() event handler -- by constructing a new view window whose parent is also the wxDynamicSashWindow. 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 wxDynamicSashWindow 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 wxDynamicSashWindow object, rather than scrolling the whole view.) In this case, you will need to construct your wxDynamicSashWindow without the wxDS_MANAGE_SCROLLBARS style and you will need to use the GetHScrollBar() and GetVScrollBar() methods to retrieve the scrollbar controls and call SetEventHanler() 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:

s__main__sii(swxs wx.gizmossgizmosswx.stcsstcsStyledTextCtrlsTestViews sampleTextsPanels SimpleViewsrunTestsoverviews__name__ssyssossrunsmainspathsbasenamesargv( ssyssrunsTestViewsstcsoverviews SimpleViewsrunTests sampleTextsgizmossosswx((sq/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/DynamicSashWindow.pys?s   7 .