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 //---------------------------------------------------------------------------
37 "A button is a control that contains a text string, and is one of the most\n"
38 "common elements of a GUI. It may be placed on a dialog box or panel, or\n"
39 "indeed almost any other window.");
43 wxBU_LEFT: Left-justifies the label. WIN32 only.
44 wxBU_TOP: Aligns the label to the top of the button. WIN32 only.
45 wxBU_RIGHT: Right-justifies the bitmap label. WIN32 only.
46 wxBU_BOTTOM: Aligns the label to the bottom of the button. WIN32 only.
47 wxBU_EXACTFIT: Creates the button as small as possible instead of making
48 it of the standard size (which is the default behaviour.)
51 EVT_BUTTON(win,id,func):
52 Sent when the button is clicked.
55 class wxButton : public wxControl
58 %addtofunc wxButton "self._setOORInfo(self)"
59 %addtofunc wxButton() ""
62 DocStr(wxButton, "Create and show a button.")
63 wxButton(wxWindow* parent, wxWindowID id, const wxString& label,
64 const wxPoint& pos = wxDefaultPosition,
65 const wxSize& size = wxDefaultSize,
67 const wxValidator& validator = wxDefaultValidator,
68 const wxString& name = wxPyButtonNameStr);
70 DocStr(wxButton(), "Precreate a Button for 2-phase creation.");
71 %name(PreButton)wxButton();
73 DocStr(Create, "Acutally create the GUI Button for 2-phase creation.");
74 bool Create(wxWindow* parent, wxWindowID id, const wxString& label,
75 const wxPoint& pos = wxDefaultPosition,
76 const wxSize& size = wxDefaultSize,
78 const wxValidator& validator = wxDefaultValidator,
79 const wxString& name = wxPyButtonNameStr);
82 DocStr(SetDefault, "This sets the button to be the default item for the panel or dialog box.");
87 // show the image in the button in addition to the label
88 void SetImageLabel(const wxBitmap& bitmap);
90 // set the margins around the image
91 void SetImageMargins(wxCoord x, wxCoord y);
94 DocStr(GetDefaultButtonSize, "Returns the default button size for this platform.");
95 static wxSize GetDefaultSize();
100 //---------------------------------------------------------------------------
103 DocStr(wxBitmapButton, "A Buttont that contains a bitmap.");
105 class wxBitmapButton : public wxButton
108 %addtofunc wxBitmapButton "self._setOORInfo(self)"
109 %addtofunc wxBitmapButton() ""
111 DocStr(wxBitmapButton, "Create and show a button.")
112 wxBitmapButton(wxWindow* parent, wxWindowID id, const wxBitmap& bitmap,
113 const wxPoint& pos = wxDefaultPosition,
114 const wxSize& size = wxDefaultSize,
115 long style = wxBU_AUTODRAW,
116 const wxValidator& validator = wxDefaultValidator,
117 const wxString& name = wxPyButtonNameStr);
119 DocStr(wxBitmapButton(), "Precreate a BitmapButton for 2-phase creation.");
120 %name(PreBitmapButton)wxBitmapButton();
122 DocStr(Create, "Acutally create the GUI BitmapButton for 2-phase creation.");
123 bool Create(wxWindow* parent, wxWindowID id, const wxBitmap& bitmap,
124 const wxPoint& pos = wxDefaultPosition,
125 const wxSize& size = wxDefaultSize,
126 long style = wxBU_AUTODRAW,
127 const wxValidator& validator = wxDefaultValidator,
128 const wxString& name = wxPyButtonNameStr);
130 DocStr(GetBitmapLabel, "Returns the label bitmap (the one passed to the constructor).");
131 wxBitmap GetBitmapLabel();
133 DocStr(GetBitmapDisabled, "Returns the bitmap for the disabled state.");
134 wxBitmap GetBitmapDisabled();
136 DocStr(GetBitmapFocus, "Returns the bitmap for the focused state.");
137 wxBitmap GetBitmapFocus();
139 DocStr(GetBitmapSelected, "Returns the bitmap for the selected state.");
140 wxBitmap GetBitmapSelected();
142 DocStr(SetBitmapDisabled, "Sets the bitmap for the disabled button appearance.");
143 void SetBitmapDisabled(const wxBitmap& bitmap);
145 DocStr(SetBitmapFocus, "Sets the bitmap for the button appearance when it has the keyboard focus.");
146 void SetBitmapFocus(const wxBitmap& bitmap);
148 DocStr(SetBitmapSelected, "Sets the bitmap for the selected (depressed) button appearance.");
149 void SetBitmapSelected(const wxBitmap& bitmap);
151 DocStr(SetBitmapLabel,
152 "Sets the bitmap label for the button. This is the bitmap used for the\n"
153 "unselected state, and for all other states if no other bitmaps are provided.");
154 void SetBitmapLabel(const wxBitmap& bitmap);
156 void SetMargins(int x, int y);
157 int GetMarginX() const;
158 int GetMarginY() const;
162 //---------------------------------------------------------------------------