wxbuttona button is a control that contains a text string, and is one of the most common elements of a gui. it may be placed on a dialog box or panel, or indeed almost any other window. derived from
wxcontrol include files <wx/button.h> window styles
see also window styles overview. event handling
see also members
wxbutton::wxbutton
wxbutton::wxbuttonwxbutton() default constructor. wxbutton(wxwindow* parent, wxwindowid id, const wxstring& label = wxemptystring, const wxpoint& pos = wxdefaultposition, const wxsize& size = wxdefaultsize, long style = 0, const wxvalidator& validator = wxdefaultvalidator, const wxstring& name = "button") constructor, creating and showing a button. the preferred way to create standard buttons is to use default value of label. if no label is supplied and id is one of standard ids from this list, standard label will be used. in addition to that, the button will be decorated with stock icons under gtk+ 2. parameters parent
id
label
pos
size
style
validator
name
see also
wxbutton::~wxbutton~wxbutton() destructor, destroying the button.
wxbutton::createbool create(wxwindow* parent, wxwindowid id, const wxstring& label = wxemptystring, const wxpoint& pos = wxdefaultposition, const wxsize& size = wxdefaultsize, long style = 0, const wxvalidator& validator, const wxstring& name = "button") button creation function for two-step creation. for more details, see wxbutton::wxbutton.
wxbutton::getlabelwxstring getlabel() const returns the string label for the button. return value the button's label. see also
wxbutton::getdefaultsizewxsize getdefaultsize() returns the default size for the buttons. it is advised to make all the dialog buttons of the same size and this function allows to retrieve the (platform and current font dependent size) which should be the best suited for this.
wxbutton::setdefaultvoid setdefault() this sets the button to be the default item for the panel or dialog box. remarks under windows, only dialog box buttons respond to this function. as normal under windows and motif, pressing return causes the default button to be depressed when the return key is pressed. see also wxwindow::setfocus which sets the keyboard focus for windows and text panel items, and wxtoplevelwindow::setdefaultitem. note that under motif, calling this function immediately after creation of a button and before the creation of other buttons will cause misalignment of the row of buttons, since default buttons are larger. to get around this, call setdefault after you have created a row of buttons: wxwidgets will then set the size of all buttons currently on the panel to the same size.
wxbutton::setlabelvoid setlabel(const wxstring& label) sets the string label for the button. parameters label
see also
|