X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1e4a197e4c60e461b8068b0619692ea083e30b8b..ca6c45b23dd2a583dabbf8567f23657d310eb0b0:/wxPython/demo/wxMultiSash.py diff --git a/wxPython/demo/wxMultiSash.py b/wxPython/demo/wxMultiSash.py index 6308121201..ce95868047 100644 --- a/wxPython/demo/wxMultiSash.py +++ b/wxPython/demo/wxMultiSash.py @@ -1,6 +1,25 @@ -from wxPython.wx import * -from wxPython.lib.multisash import wxMultiSash -from wxPython.stc import * +# 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o Updated for wx namespace +# +# 11/30/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wx renamer needs to be applied to multisash lib. +# o There appears to be a problem with the image that +# the library is trying to use for the alternate cursor +# +# 12/09/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o renamer issue shelved. +# +# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wxMultiSash -> MultiSash +# + +import wx +import wx.lib.multisash as sash +import wx.stc as stc #--------------------------------------------------------------------------- @@ -26,36 +45,42 @@ returned by GetSaveData, as it is just another object in the dictionary. #--------------------------------------------------------------------------- -class TestWindow(wxStyledTextCtrl): +class TestWindow(stc.StyledTextCtrl): + + # shared document reference + doc = None + def __init__(self, parent): - wxStyledTextCtrl.__init__(self, parent, -1, style=wxNO_BORDER) + stc.StyledTextCtrl.__init__(self, parent, -1, style=wx.NO_BORDER) self.SetMarginWidth(1,0) - if wxPlatform == '__WXMSW__': + + if wx.Platform == '__WXMSW__': fSize = 10 else: fSize = 12 - self.StyleSetFont(wxSTC_STYLE_DEFAULT, - wxFont(fSize, wxMODERN, wxNORMAL, wxNORMAL)) - self.SetText(sampleText) -class TestFrame(wxFrame): - def __init__(self, parent, log): - wxFrame.__init__(self, parent, -1, "Multi Sash Demo", - size=(640,480)) - self.multi = wxMultiSash(self,-1,pos = wxPoint(0,0), - size = (640,480)) + self.StyleSetFont( + stc.STC_STYLE_DEFAULT, + wx.Font(fSize, wx.MODERN, wx.NORMAL, wx.NORMAL) + ) - # Use this method to set the default class that will be created when - # a new sash is created. The class's constructor needs 1 parameter - # which is the parent of the window - self.multi.SetDefaultChildClass(TestWindow) + if self.doc: + self.SetDocPointer(self.doc) + else: + self.SetText(sampleText) + TestWindow.doc = self.GetDocPointer() + + def SutdownDemo(self): + # Reset doc reference in case this demo is run again + TestWindow.doc = None + #--------------------------------------------------------------------------- def runTest(frame, nb, log): - multi = wxMultiSash(nb, -1, pos = (0,0), size = (640,480)) + multi = sash.MultiSash(nb, -1, pos = (0,0), size = (640,480)) # Use this method to set the default class that will be created when # a new sash is created. The class's constructor needs 1 parameter @@ -64,17 +89,14 @@ def runTest(frame, nb, log): return multi -# win = TestPanel(nb, log) -# return win - #---------------------------------------------------------------------- overview = """ -

wxMultiSash

+

MultiSash

-wxMultiSash allows the user to split a window any number of times +MultiSash allows the user to split a window any number of times either horizontally or vertically, and to close the split off windows when desired.