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 class wxButton : public wxControl
64 %pythonAppend wxButton "self._setOORInfo(self)"
65 %pythonAppend wxButton() ""
70 wxButton(wxWindow* parent, wxWindowID id, const wxString& label,
71 const wxPoint& pos = wxDefaultPosition,
72 const wxSize& size = wxDefaultSize,
74 const wxValidator& validator = wxDefaultValidator,
75 const wxString& name = wxPyButtonNameStr),
76 "Create and show a button.");
80 "Precreate a Button for 2-phase creation.",
84 bool , Create(wxWindow* parent, wxWindowID id, const wxString& label,
85 const wxPoint& pos = wxDefaultPosition,
86 const wxSize& size = wxDefaultSize,
88 const wxValidator& validator = wxDefaultValidator,
89 const wxString& name = wxPyButtonNameStr),
90 "Acutally create the GUI Button for 2-phase creation.");
96 "This sets the button to be the default item for the panel or dialog box.");
100 static wxSize , GetDefaultSize(),
101 "Returns the default button size for this platform.");
103 static wxVisualAttributes
104 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
109 //---------------------------------------------------------------------------
112 DocStr(wxBitmapButton,
113 "A Button that contains a bitmap. A bitmap button can be supplied with a
114 single bitmap, and wxWidgets will draw all button states using this bitmap. If
115 the application needs more control, additional bitmaps for the selected state,
116 unpressed focused state, and greyed-out state may be supplied.
120 ============== =============================================
121 wx.BU_AUTODRAW If this is specified, the button will be drawn
122 automatically using the label bitmap only,
123 providing a 3D-look border. If this style is
124 not specified, the button will be drawn
125 without borders and using all provided
127 wx.BU_LEFT Left-justifies the label. WIN32 only.
128 wx.BU_TOP Aligns the label to the top of the button. WIN32
130 wx.BU_RIGHT Right-justifies the bitmap label. WIN32 only.
131 wx.BU_BOTTOM Aligns the label to the bottom of the
133 wx.BU_EXACTFIT Creates the button as small as possible
134 instead of making it of the standard size
135 (which is the default behaviour.)
136 ============== =============================================
140 =========== ==================================
141 EVT_BUTTON Sent when the button is clicked.
142 =========== ==================================
144 :see: `wx.Button`, `wx.Bitmap`
147 class wxBitmapButton : public wxButton
150 %pythonAppend wxBitmapButton "self._setOORInfo(self)"
151 %pythonAppend wxBitmapButton() ""
153 RefDoc(wxBitmapButton, ""); // turn it off for the ctors
156 wxBitmapButton(wxWindow* parent, wxWindowID id, const wxBitmap& bitmap,
157 const wxPoint& pos = wxDefaultPosition,
158 const wxSize& size = wxDefaultSize,
159 long style = wxBU_AUTODRAW,
160 const wxValidator& validator = wxDefaultValidator,
161 const wxString& name = wxPyButtonNameStr),
162 "Create and show a button with a bitmap for the label.");
166 "Precreate a BitmapButton for 2-phase creation.",
170 bool , Create(wxWindow* parent, wxWindowID id, const wxBitmap& bitmap,
171 const wxPoint& pos = wxDefaultPosition,
172 const wxSize& size = wxDefaultSize,
173 long style = wxBU_AUTODRAW,
174 const wxValidator& validator = wxDefaultValidator,
175 const wxString& name = wxPyButtonNameStr),
176 "Acutally create the GUI BitmapButton for 2-phase creation.");
180 wxBitmap , GetBitmapLabel(),
181 "Returns the label bitmap (the one passed to the constructor).");
184 wxBitmap , GetBitmapDisabled(),
185 "Returns the bitmap for the disabled state.");
188 wxBitmap , GetBitmapFocus(),
189 "Returns the bitmap for the focused state.");
193 wxBitmap , GetBitmapSelected(),
194 "Returns the bitmap for the selected state.");
198 void , SetBitmapDisabled(const wxBitmap& bitmap),
199 "Sets the bitmap for the disabled button appearance.");
203 void , SetBitmapFocus(const wxBitmap& bitmap),
204 "Sets the bitmap for the button appearance when it has the keyboard focus.");
208 void , SetBitmapSelected(const wxBitmap& bitmap),
209 "Sets the bitmap for the selected (depressed) button appearance.");
213 void , SetBitmapLabel(const wxBitmap& bitmap),
214 "Sets the bitmap label for the button. This is the bitmap used for the
215 unselected state, and for all other states if no other bitmaps are provided.");
218 void SetMargins(int x, int y);
219 int GetMarginX() const;
220 int GetMarginY() const;
224 //---------------------------------------------------------------------------