]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/_button.i
reSWIGged
[wxWidgets.git] / wxPython / src / _button.i
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: _button.i
3 // Purpose: SWIG interface defs for wxButton, wxBitmapButton
4 //
5 // Author: Robin Dunn
6 //
7 // Created: 10-June-1998
8 // RCS-ID: $Id$
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
12
13 // Not a %module
14
15
16 //---------------------------------------------------------------------------
17 %newgroup;
18
19 MAKE_CONST_WXSTRING(ButtonNameStr);
20
21 enum {
22 wxBU_LEFT,
23 wxBU_TOP,
24 wxBU_RIGHT,
25 wxBU_BOTTOM,
26
27 wxBU_EXACTFIT,
28 wxBU_AUTODRAW,
29 };
30
31 //---------------------------------------------------------------------------
32
33 DocStr(wxButton,
34 "A button is a control that contains a text string, and is one of the most
35 common elements of a GUI. It may be placed on a dialog box or panel, or
36 indeed almost any other window.", "
37
38 Window Styles
39 -------------
40 ============== ==========================================
41 wx.BU_LEFT Left-justifies the label. WIN32 only.
42 wx.BU_TOP Aligns the label to the top of the button.
43 WIN32 only.
44 wx.BU_RIGHT Right-justifies the bitmap label. WIN32 only.
45 wx.BU_BOTTOM Aligns the label to the bottom of the button.
46 WIN32 only.
47 wx.BU_EXACTFIT Creates the button as small as possible
48 instead of making it of the standard size
49 (which is the default behaviour.)
50 ============== ==========================================
51
52 Events
53 ------
54 ============ ==========================================
55 EVT_BUTTON Sent when the button is clicked.
56 ============ ==========================================
57
58 :see: `wx.BitmapButton`
59 ");
60
61 MustHaveApp(wxButton);
62
63 class wxButton : public wxControl
64 {
65 public:
66 %pythonAppend wxButton "self._setOORInfo(self)"
67 %pythonAppend wxButton() ""
68
69
70 DocCtorStr(
71 wxButton(wxWindow* parent, wxWindowID id, const wxString& label,
72 const wxPoint& pos = wxDefaultPosition,
73 const wxSize& size = wxDefaultSize,
74 long style = 0,
75 const wxValidator& validator = wxDefaultValidator,
76 const wxString& name = wxPyButtonNameStr),
77 "Create and show a button.", "");
78
79 DocCtorStrName(
80 wxButton(),
81 "Precreate a Button for 2-phase creation.", "",
82 PreButton);
83
84 DocDeclStr(
85 bool , Create(wxWindow* parent, wxWindowID id, const wxString& label,
86 const wxPoint& pos = wxDefaultPosition,
87 const wxSize& size = wxDefaultSize,
88 long style = 0,
89 const wxValidator& validator = wxDefaultValidator,
90 const wxString& name = wxPyButtonNameStr),
91 "Acutally create the GUI Button for 2-phase creation.", "");
92
93
94
95 DocDeclStr(
96 void , SetDefault(),
97 "This sets the button to be the default item for the panel or dialog box.", "");
98
99
100 DocDeclStr(
101 static wxSize , GetDefaultSize(),
102 "Returns the default button size for this platform.", "");
103
104 static wxVisualAttributes
105 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
106 };
107
108
109
110 //---------------------------------------------------------------------------
111
112
113 DocStr(wxBitmapButton,
114 "A Button that contains a bitmap. A bitmap button can be supplied with a
115 single bitmap, and wxWidgets will draw all button states using this bitmap. If
116 the application needs more control, additional bitmaps for the selected state,
117 unpressed focused state, and greyed-out state may be supplied.", "
118
119 Window Styles
120 -------------
121 ============== =============================================
122 wx.BU_AUTODRAW If this is specified, the button will be drawn
123 automatically using the label bitmap only,
124 providing a 3D-look border. If this style is
125 not specified, the button will be drawn
126 without borders and using all provided
127 bitmaps. WIN32 only.
128 wx.BU_LEFT Left-justifies the label. WIN32 only.
129 wx.BU_TOP Aligns the label to the top of the button. WIN32
130 only.
131 wx.BU_RIGHT Right-justifies the bitmap label. WIN32 only.
132 wx.BU_BOTTOM Aligns the label to the bottom of the
133 button. WIN32 only.
134 wx.BU_EXACTFIT Creates the button as small as possible
135 instead of making it of the standard size
136 (which is the default behaviour.)
137 ============== =============================================
138
139 Events
140 ------
141 =========== ==================================
142 EVT_BUTTON Sent when the button is clicked.
143 =========== ==================================
144
145 :see: `wx.Button`, `wx.Bitmap`
146 ");
147
148 MustHaveApp(wxBitmapButton);
149
150 class wxBitmapButton : public wxButton
151 {
152 public:
153 %pythonAppend wxBitmapButton "self._setOORInfo(self)"
154 %pythonAppend wxBitmapButton() ""
155
156 DocCtorStr(
157 wxBitmapButton(wxWindow* parent, wxWindowID id, const wxBitmap& bitmap,
158 const wxPoint& pos = wxDefaultPosition,
159 const wxSize& size = wxDefaultSize,
160 long style = wxBU_AUTODRAW,
161 const wxValidator& validator = wxDefaultValidator,
162 const wxString& name = wxPyButtonNameStr),
163 "Create and show a button with a bitmap for the label.", "");
164
165 DocCtorStrName(
166 wxBitmapButton(),
167 "Precreate a BitmapButton for 2-phase creation.", "",
168 PreBitmapButton);
169
170 DocDeclStr(
171 bool , Create(wxWindow* parent, wxWindowID id, const wxBitmap& bitmap,
172 const wxPoint& pos = wxDefaultPosition,
173 const wxSize& size = wxDefaultSize,
174 long style = wxBU_AUTODRAW,
175 const wxValidator& validator = wxDefaultValidator,
176 const wxString& name = wxPyButtonNameStr),
177 "Acutally create the GUI BitmapButton for 2-phase creation.", "");
178
179
180 DocDeclStr(
181 wxBitmap , GetBitmapLabel(),
182 "Returns the label bitmap (the one passed to the constructor).", "");
183
184 DocDeclStr(
185 wxBitmap , GetBitmapDisabled(),
186 "Returns the bitmap for the disabled state.", "");
187
188 DocDeclStr(
189 wxBitmap , GetBitmapFocus(),
190 "Returns the bitmap for the focused state.", "");
191
192
193 DocDeclStr(
194 wxBitmap , GetBitmapSelected(),
195 "Returns the bitmap for the selected state.", "");
196
197
198 DocDeclStr(
199 void , SetBitmapDisabled(const wxBitmap& bitmap),
200 "Sets the bitmap for the disabled button appearance.", "");
201
202
203 DocDeclStr(
204 void , SetBitmapFocus(const wxBitmap& bitmap),
205 "Sets the bitmap for the button appearance when it has the keyboard focus.", "");
206
207
208 DocDeclStr(
209 void , SetBitmapSelected(const wxBitmap& bitmap),
210 "Sets the bitmap for the selected (depressed) button appearance.", "");
211
212
213 DocDeclStr(
214 void , SetBitmapLabel(const wxBitmap& bitmap),
215 "Sets the bitmap label for the button. This is the bitmap used for the
216 unselected state, and for all other states if no other bitmaps are provided.", "");
217
218
219 void SetMargins(int x, int y);
220 int GetMarginX() const;
221 int GetMarginY() const;
222 };
223
224
225 //---------------------------------------------------------------------------