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 //---------------------------------------------------------------------------
21 DECLARE_DEF_STRING(ButtonNameStr);
34 //---------------------------------------------------------------------------
36 // A button is a control that contains a text string, and is one of the most
37 // common elements of a GUI. It may be placed on a dialog box or panel, or
38 // indeed almost any other window.
41 // wxBU_LEFT: Left-justifies the label. WIN32 only.
42 // wxBU_TOP: Aligns the label to the top of the button. WIN32 only.
43 // wxBU_RIGHT: Right-justifies the bitmap label. WIN32 only.
44 // wxBU_BOTTOM: Aligns the label to the bottom of the button. WIN32 only.
45 // wxBU_EXACTFIT: Creates the button as small as possible instead of making
46 // it of the standard size (which is the default behaviour.)
49 // EVT_BUTTON(win,id,func):
50 // Sent when the button is clicked.
52 class wxButton : public wxControl
55 %addtofunc wxButton "self._setOORInfo(self)"
56 %addtofunc wxButton() ""
59 // Constructor, creating and showing a button.
61 // parent: Parent window. Must not be None.
62 // id: Button identifier. A value of -1 indicates a default value.
63 // label: The text to be displayed on the button.
64 // pos: The button position on it's parent.
65 // size: Button size. If the default size (-1, -1) is specified then the
66 // button is sized appropriately for the text.
67 // style: Window style. See wxButton.
68 // validator: Window validator.
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);
77 // Default constructor
78 %name(PreButton)wxButton();
80 // Button creation function for two-step creation.
81 bool Create(wxWindow* parent, wxWindowID id, const wxString& label,
82 const wxPoint& pos = wxDefaultPosition,
83 const wxSize& size = wxDefaultSize,
85 const wxValidator& validator = wxDefaultValidator,
86 const wxString& name = wxPyButtonNameStr);
89 // This sets the button to be the default item for the panel or dialog box.
91 // Under Windows, only dialog box buttons respond to this function. As
92 // normal under Windows and Motif, pressing return causes the default
93 // button to be depressed when the return key is pressed. See also
94 // wxWindow.SetFocus which sets the keyboard focus for windows and text
95 // panel items, and wxPanel.SetDefaultItem.
100 // show the image in the button in addition to the label
101 void SetImageLabel(const wxBitmap& bitmap);
103 // set the margins around the image
104 void SetImageMargins(wxCoord x, wxCoord y);
107 // returns the default button size for this platform
108 static wxSize GetDefaultSize();
113 //---------------------------------------------------------------------------
115 class wxBitmapButton : public wxButton
118 %addtofunc wxBitmapButton "self._setOORInfo(self)"
119 %addtofunc wxBitmapButton() ""
121 wxBitmapButton(wxWindow* parent, wxWindowID id, const wxBitmap& bitmap,
122 const wxPoint& pos = wxDefaultPosition,
123 const wxSize& size = wxDefaultSize,
124 long style = wxBU_AUTODRAW,
125 const wxValidator& validator = wxDefaultValidator,
126 const wxString& name = wxPyButtonNameStr);
127 %name(PreBitmapButton)wxBitmapButton();
129 bool Create(wxWindow* parent, wxWindowID id, const wxBitmap& bitmap,
130 const wxPoint& pos = wxDefaultPosition,
131 const wxSize& size = wxDefaultSize,
132 long style = wxBU_AUTODRAW,
133 const wxValidator& validator = wxDefaultValidator,
134 const wxString& name = wxPyButtonNameStr);
136 wxBitmap GetBitmapLabel();
137 wxBitmap GetBitmapDisabled();
138 wxBitmap GetBitmapFocus();
139 wxBitmap GetBitmapSelected();
140 void SetBitmapDisabled(const wxBitmap& bitmap);
141 void SetBitmapFocus(const wxBitmap& bitmap);
142 void SetBitmapSelected(const wxBitmap& bitmap);
143 void SetBitmapLabel(const wxBitmap& bitmap);
145 void SetMargins(int x, int y);
146 int GetMarginX() const;
147 int GetMarginY() const;
151 //---------------------------------------------------------------------------