]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxSplitterWindow.py
2 from wxPython
. wx
import *
5 #---------------------------------------------------------------------------
7 class MySplitter ( wxSplitterWindow
):
8 def __init__ ( self
, parent
, ID
, log
):
9 wxSplitterWindow
.__ init
__ ( self
, parent
, ID
)
11 EVT_SPLITTER_SASH_POS_CHANGED ( self
, self
. GetId (), self
. OnSashChanged
)
13 def OnSashChanged ( self
, evt
):
14 self
. log
. WriteText ( "sash changed to " + str ( evt
. GetSashPosition ()))
16 #---------------------------------------------------------------------------
18 def runTest ( frame
, nb
, log
):
19 splitter
= MySplitter ( nb
, - 1 , log
)
21 p1
= wxWindow ( splitter
, - 1 )
22 p1
. SetBackgroundColour ( wxRED
)
23 wxStaticText ( p1
, - 1 , "Panel One" , wxPoint ( 5 , 5 )). SetBackgroundColour ( wxRED
)
25 p2
= wxWindow ( splitter
, - 1 )
26 p2
. SetBackgroundColour ( wxBLUE
)
27 wxStaticText ( p2
, - 1 , "Panel Two" , wxPoint ( 5 , 5 )). SetBackgroundColour ( wxBLUE
)
29 splitter
. SetMinimumPaneSize ( 20 )
30 splitter
. SplitVertically ( p1
, p2
)
31 splitter
. SetSashPosition ( 100 )
36 #---------------------------------------------------------------------------
53 This class manages up to two subwindows. The current view can be split into two programmatically (perhaps from a menu command), and unsplit either programmatically or via the wxSplitterWindow user interface.
56 -----------------------------------
60 wxSplitterWindow(wxWindow* parent, wxWindowID id, int x, const wxPoint& point = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style=wxSP_3D, const wxString& name = "splitterWindow")
62 Constructor for creating the window.
67 parent = The parent of the splitter window.
69 id = The window identifier.
71 pos = The window position.
73 size = The window size.
75 style = The window style. See wxSplitterWindow.
77 name = The window name.