1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface defs for wxButton, wxBitmapButton
7 // Created: 10-June-1998
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
19 MAKE_CONST_WXSTRING(ButtonNameStr);
31 //---------------------------------------------------------------------------
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.", "
40 ============== ==========================================
41 wx.BU_LEFT Left-justifies the label. WIN32 only.
42 wx.BU_TOP Aligns the label to the top of the button.
44 wx.BU_RIGHT Right-justifies the bitmap label. WIN32 only.
45 wx.BU_BOTTOM Aligns the label to the bottom of the button.
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 ============== ==========================================
54 ============ ==========================================
55 EVT_BUTTON Sent when the button is clicked.
56 ============ ==========================================
58 :see: `wx.BitmapButton`
61 MustHaveApp(wxButton);
63 class wxButton : public wxControl
66 %pythonAppend wxButton "self._setOORInfo(self)"
67 %pythonAppend wxButton() ""
68 %typemap(out) wxButton*; // turn off this typemap
72 wxButton(wxWindow* parent, wxWindowID id=-1,
73 const wxString& label=wxPyEmptyString,
74 const wxPoint& pos = wxDefaultPosition,
75 const wxSize& size = wxDefaultSize,
77 const wxValidator& validator = wxDefaultValidator,
78 const wxString& name = wxPyButtonNameStr),
79 "Create and show a button.", "");
83 "Precreate a Button for 2-phase creation.", "",
86 // Turn it back on again
87 %typemap(out) wxButton* { $result = wxPyMake_wxObject($1, $owner); }
91 bool , Create(wxWindow* parent, wxWindowID id=-1,
92 const wxString& label=wxPyEmptyString,
93 const wxPoint& pos = wxDefaultPosition,
94 const wxSize& size = wxDefaultSize,
96 const wxValidator& validator = wxDefaultValidator,
97 const wxString& name = wxPyButtonNameStr),
98 "Acutally create the GUI Button for 2-phase creation.", "");
104 "This sets the button to be the default item for the panel or dialog box.", "");
108 static wxSize , GetDefaultSize(),
109 "Returns the default button size for this platform.", "");
111 static wxVisualAttributes
112 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
117 //---------------------------------------------------------------------------
120 DocStr(wxBitmapButton,
121 "A Button that contains a bitmap. A bitmap button can be supplied with a
122 single bitmap, and wxWidgets will draw all button states using this bitmap. If
123 the application needs more control, additional bitmaps for the selected state,
124 unpressed focused state, and greyed-out state may be supplied.", "
128 ============== =============================================
129 wx.BU_AUTODRAW If this is specified, the button will be drawn
130 automatically using the label bitmap only,
131 providing a 3D-look border. If this style is
132 not specified, the button will be drawn
133 without borders and using all provided
135 wx.BU_LEFT Left-justifies the label. WIN32 only.
136 wx.BU_TOP Aligns the label to the top of the button. WIN32
138 wx.BU_RIGHT Right-justifies the bitmap label. WIN32 only.
139 wx.BU_BOTTOM Aligns the label to the bottom of the
141 wx.BU_EXACTFIT Creates the button as small as possible
142 instead of making it of the standard size
143 (which is the default behaviour.)
144 ============== =============================================
148 =========== ==================================
149 EVT_BUTTON Sent when the button is clicked.
150 =========== ==================================
152 :see: `wx.Button`, `wx.Bitmap`
155 MustHaveApp(wxBitmapButton);
157 class wxBitmapButton : public wxButton
160 %pythonAppend wxBitmapButton "self._setOORInfo(self)"
161 %pythonAppend wxBitmapButton() ""
162 %typemap(out) wxBitmapButton*; // turn off this typemap
165 wxBitmapButton(wxWindow* parent, wxWindowID id=-1,
166 const wxBitmap& bitmap = wxNullBitmap,
167 const wxPoint& pos = wxDefaultPosition,
168 const wxSize& size = wxDefaultSize,
169 long style = wxBU_AUTODRAW,
170 const wxValidator& validator = wxDefaultValidator,
171 const wxString& name = wxPyButtonNameStr),
172 "Create and show a button with a bitmap for the label.", "");
176 "Precreate a BitmapButton for 2-phase creation.", "",
179 // Turn it back on again
180 %typemap(out) wxBitmapButton* { $result = wxPyMake_wxObject($1, $owner); }
184 bool , Create(wxWindow* parent, wxWindowID id=-1,
185 const wxBitmap& bitmap = wxNullBitmap,
186 const wxPoint& pos = wxDefaultPosition,
187 const wxSize& size = wxDefaultSize,
188 long style = wxBU_AUTODRAW,
189 const wxValidator& validator = wxDefaultValidator,
190 const wxString& name = wxPyButtonNameStr),
191 "Acutally create the GUI BitmapButton for 2-phase creation.", "");
195 wxBitmap , GetBitmapLabel(),
196 "Returns the label bitmap (the one passed to the constructor).", "");
199 wxBitmap , GetBitmapDisabled(),
200 "Returns the bitmap for the disabled state.", "");
203 wxBitmap , GetBitmapFocus(),
204 "Returns the bitmap for the focused state.", "");
208 wxBitmap , GetBitmapSelected(),
209 "Returns the bitmap for the selected state.", "");
213 void , SetBitmapDisabled(const wxBitmap& bitmap),
214 "Sets the bitmap for the disabled button appearance.", "");
218 void , SetBitmapFocus(const wxBitmap& bitmap),
219 "Sets the bitmap for the button appearance when it has the keyboard focus.", "");
223 void , SetBitmapSelected(const wxBitmap& bitmap),
224 "Sets the bitmap for the selected (depressed) button appearance.", "");
228 void , SetBitmapLabel(const wxBitmap& bitmap),
229 "Sets the bitmap label for the button. This is the bitmap used for the
230 unselected state, and for all other states if no other bitmaps are provided.", "");
233 void SetMargins(int x, int y);
234 int GetMarginX() const;
235 int GetMarginY() const;
239 //---------------------------------------------------------------------------