]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/_collpane.i
Modified form of Patch #1611222, adds wxSearchCtrl (generic & native carbon HISearchF...
[wxWidgets.git] / wxPython / src / _collpane.i
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: _collpane.i
3 // Purpose: SWIG interface for wxCollapsiblePane
4 //
5 // Author: Robin Dunn
6 //
7 // Created: 10-Nov-2006
8 // RCS-ID: $Id$
9 // Copyright: (c) 2006 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
12
13 // Not a %module
14
15
16 //---------------------------------------------------------------------------
17 %newgroup
18
19 MAKE_CONST_WXSTRING(CollapsiblePaneNameStr);
20
21 enum {
22 wxCP_DEFAULT_STYLE,
23 wxCP_NO_TLW_RESIZE
24 };
25
26
27
28 MustHaveApp(wxCollapsiblePane);
29 DocStr(wxCollapsiblePane,
30 "A collapsable pane is a container with an embedded button-like
31 control which can be used by the user to collapse or expand the pane's
32 contents.
33
34 Once constructed you should use the `GetPane` function to access the
35 pane and add your controls inside it (i.e. use the window returned
36 from `GetPane` as the parent for the controls which must go in the
37 pane, NOT the wx.CollapsiblePane itself!).
38
39 Note that because of its nature of control which can dynamically (and
40 drastically) change its size at run-time under user-input, when
41 putting a wx.CollapsiblePane inside a `wx.Sizer` you should be careful
42 to add it with a proportion value of zero; this is because otherwise
43 all other windows with non-zero proportion values would automatically
44 get resized each time the user expands or collapses the pane window,
45 usually resulting a weird, flickering effect.", "");
46
47 class wxCollapsiblePane : public wxControl
48 {
49 public:
50 %pythonAppend wxCollapsiblePane "self._setOORInfo(self)";
51 %pythonAppend wxCollapsiblePane() "";
52
53 DocCtorStr(
54 wxCollapsiblePane(wxWindow *parent,
55 wxWindowID winid = -1,
56 const wxString& label = wxPyEmptyString,
57 const wxPoint& pos = wxDefaultPosition,
58 const wxSize& size = wxDefaultSize,
59 long style = wxCP_DEFAULT_STYLE,
60 const wxValidator& val = wxDefaultValidator,
61 const wxString& name = wxPyCollapsiblePaneNameStr),
62 "Create and show a wx.CollapsiblePane", "");
63
64 DocCtorStrName(
65 wxCollapsiblePane(),
66 "Precreate a wx.CollapsiblePane for 2-phase creation.", "",
67 PreCollapsiblePane);
68
69
70 DocDeclStr(
71 bool , Create(wxWindow *parent,
72 wxWindowID winid =-1,
73 const wxString& label = wxPyEmptyString,
74 const wxPoint& pos = wxDefaultPosition,
75 const wxSize& size = wxDefaultSize,
76 long style = wxCP_DEFAULT_STYLE,
77 const wxValidator& val = wxDefaultValidator,
78 const wxString& name = wxPyCollapsiblePaneNameStr),
79 "", "");
80
81
82
83
84 DocDeclStr(
85 virtual void , Collapse(bool collapse = true),
86 "Collapses or expands the pane window.", "");
87
88 DocDeclStr(
89 void , Expand(),
90 "Same as Collapse(False).", "");
91
92
93 DocDeclStr(
94 virtual bool , IsCollapsed() const,
95 "Returns ``True`` if the pane window is currently hidden.", "");
96
97 DocDeclStr(
98 bool , IsExpanded() const,
99 "Returns ``True`` if the pane window is currently shown.", "");
100
101
102 DocDeclStr(
103 virtual wxWindow *, GetPane() const,
104 "Returns a reference to the pane window. Use the returned `wx.Window`
105 as the parent of widgets to make them part of the collapsible area.", "");
106
107 %property(Expanded, IsExpanded);
108 %property(Collapsed, IsCollapsed);
109 };
110
111
112
113 //---------------------------------------------------------------------------
114
115
116 %constant wxEventType wxEVT_COMMAND_COLLPANE_CHANGED;
117 %pythoncode {
118 EVT_COLLAPSIBLEPANE_CHANGED = wx.PyEventBinder( wxEVT_COMMAND_COLLPANE_CHANGED, 1 )
119 }
120
121 class wxCollapsiblePaneEvent : public wxCommandEvent
122 {
123 public:
124 //wxCollapsiblePaneEvent() {}
125 wxCollapsiblePaneEvent(wxObject *generator, int id, bool collapsed);
126
127 bool GetCollapsed() const;
128 void SetCollapsed(bool c);
129
130 %property(Collapsed, GetCollapsed, SetCollapsed);
131 };
132
133 //---------------------------------------------------------------------------