]>
Commit | Line | Data |
---|---|---|
cf694132 RD |
1 | |
2 | from wxPython.wx import * | |
3 | ||
4 | ||
6999b0d8 RD |
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 | ||
cf694132 RD |
16 | #--------------------------------------------------------------------------- |
17 | ||
18 | def runTest(frame, nb, log): | |
6999b0d8 | 19 | splitter = MySplitter(nb, -1, log) |
cf694132 RD |
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 | ||
2f90df85 | 29 | splitter.SetMinimumPaneSize(20) |
cf694132 RD |
30 | splitter.SplitVertically(p1, p2) |
31 | splitter.SetSashPosition(100) | |
cf694132 RD |
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 | """ |