]> git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/demo/wxSplitterWindow.py
A bugfix in the wxTreeCtrl.GetItem wrapper
[wxWidgets.git] / utils / wxPython / demo / wxSplitterWindow.py
1
2 from wxPython.wx import *
3
4
5 #---------------------------------------------------------------------------
6
7 class MySplitter(wxSplitterWindow):
8 def __init__(self, parent, ID, log):
9 wxSplitterWindow.__init__(self, parent, ID)
10 self.log = log
11 EVT_SPLITTER_SASH_POS_CHANGED(self, self.GetId(), self.OnSashChanged)
12
13 def OnSashChanged(self, evt):
14 self.log.WriteText("sash changed to " + str(evt.GetSashPosition()))
15
16 #---------------------------------------------------------------------------
17
18 def runTest(frame, nb, log):
19 splitter = MySplitter(nb, -1, log)
20
21 p1 = wxWindow(splitter, -1)
22 p1.SetBackgroundColour(wxRED)
23 wxStaticText(p1, -1, "Panel One", wxPoint(5,5)).SetBackgroundColour(wxRED)
24
25 p2 = wxWindow(splitter, -1)
26 p2.SetBackgroundColour(wxBLUE)
27 wxStaticText(p2, -1, "Panel Two", wxPoint(5,5)).SetBackgroundColour(wxBLUE)
28
29 splitter.SetMinimumPaneSize(20)
30 splitter.SplitVertically(p1, p2)
31 splitter.SetSashPosition(100)
32
33 return splitter
34
35
36 #---------------------------------------------------------------------------
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 overview = """\
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.
54
55 wxSplitterWindow()
56 -----------------------------------
57
58 Default constructor.
59
60 wxSplitterWindow(wxWindow* parent, wxWindowID id, int x, const wxPoint& point = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style=wxSP_3D, const wxString& name = "splitterWindow")
61
62 Constructor for creating the window.
63
64 Parameters
65 -------------------
66
67 parent = The parent of the splitter window.
68
69 id = The window identifier.
70
71 pos = The window position.
72
73 size = The window size.
74
75 style = The window style. See wxSplitterWindow.
76
77 name = The window name.
78 """