new()->wxButton()
Default ctor.
new(Parent,Id)->wxButton()
Types:
Parent = wxWindow:wxWindow()
Id = integer()
new(Parent,Id,Options::[Option])->wxButton()
Types:
Parent = wxWindow:wxWindow()
Id = integer()
Option =
{label, unicode:chardata()} |
{pos, {X :: integer(), Y :: integer()}} |
{size, {W :: integer(), H :: integer()}} |
{style, integer()} |
{validator, wx:wx_object()}
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, a standard label will be used. In other
words, if you use a predefined wxID_XXX constant, just omit the label completely rather than
specifying it. In particular, help buttons (the ones with id of wxID_HELP) under macOS can't
display any label at all and while wxButton will detect if the standard "Help" label is used and
ignore it, using any other label will prevent the button from correctly appearing as a help button
and so should be avoided.
In addition to that, the button will be decorated with stock icons under GTK+ 2.
See: create/4, wxValidator (not implemented in wx)
create(This,Parent,Id)->boolean()
Types:
This = wxButton()
Parent = wxWindow:wxWindow()
Id = integer()
create(This,Parent,Id,Options::[Option])->boolean()
Types:
This = wxButton()
Parent = wxWindow:wxWindow()
Id = integer()
Option =
{label, unicode:chardata()} |
{pos, {X :: integer(), Y :: integer()}} |
{size, {W :: integer(), H :: integer()}} |
{style, integer()} |
{validator, wx:wx_object()}
Button creation function for two-step creation.
For more details, see new/3.
getDefaultSize()->{W::integer(),H::integer()}
Returns the default size for the buttons.
It is advised to make all the dialog buttons of the same size and this function allows retrieving
the (platform, and current font dependent) size which should be the best suited for this.
The optional win argument is new since wxWidgets 3.1.3 and allows to get a per-monitor DPI
specific size.
getDefaultSize(Win)->{W::integer(),H::integer()}
Types:
Win = wxWindow:wxWindow()
setDefault(This)->wxWindow:wxWindow()
Types:
This = wxButton()
This sets the button to be the default item in its top-level window (e.g.
the panel or the dialog box containing it).
As normal, pressing return causes the default button to be depressed when the return key is
pressed.
See also wxWindow:setFocus/1 which sets the keyboard focus for windows and text panel items, and
wxTopLevelWindow::SetDefaultItem() (not implemented in wx).
Remark: Under Windows, only dialog box buttons respond to this function.
Return: the old default item (possibly NULL)
setLabel(This,Label)->ok
Types:
This = wxButton()
Label = unicode:chardata()
Sets the string label for the button.
getBitmapDisabled(This)->wxBitmap:wxBitmap()
Types:
This = wxButton()
Returns the bitmap for the disabled state, which may be invalid.
See: setBitmapDisabled/2
Since: 2.9.1 (available in wxBitmapButton only in previous versions)
getBitmapFocus(This)->wxBitmap:wxBitmap()
Types:
This = wxButton()
Returns the bitmap for the focused state, which may be invalid.
See: setBitmapFocus/2
Since: 2.9.1 (available in wxBitmapButton only in previous versions)
getBitmapLabel(This)->wxBitmap:wxBitmap()
Types:
This = wxButton()
Returns the bitmap for the normal state.
This is exactly the same as GetBitmap() (not implemented in wx) but uses a name backwards-
compatible with wxBitmapButton.
See: SetBitmap() (not implemented in wx), setBitmapLabel/2
Since: 2.9.1 (available in wxBitmapButton only in previous versions)
setBitmapDisabled(This,Bitmap)->ok
Types:
This = wxButton()
Bitmap = wxBitmap:wxBitmap()
Sets the bitmap for the disabled button appearance.
If bitmap is invalid, the disabled bitmap is set to the automatically generated greyed out version
of the normal bitmap, i.e. the same bitmap as is used by default if this method is not called at
all. Use SetBitmap() (not implemented in wx) with an invalid bitmap to remove the bitmap
completely (for all states).
See: getBitmapDisabled/1, setBitmapLabel/2, SetBitmapPressed() (not implemented in wx),
setBitmapFocus/2
Since: 2.9.1 (available in wxBitmapButton only in previous versions)
setBitmapFocus(This,Bitmap)->ok
Types:
This = wxButton()
Bitmap = wxBitmap:wxBitmap()
Sets the bitmap for the button appearance when it has the keyboard focus.
If bitmap is invalid, the normal bitmap will be used in the focused state.
See: getBitmapFocus/1, setBitmapLabel/2, SetBitmapPressed() (not implemented in wx),
setBitmapDisabled/2
Since: 2.9.1 (available in wxBitmapButton only in previous versions)
setBitmapLabel(This,Bitmap)->ok
Types:
This = wxButton()
Bitmap = wxBitmap:wxBitmap()
Sets the bitmap label for the button.
Remark: This is the bitmap used for the unselected state, and for all other states if no other
bitmaps are provided.
See: SetBitmap() (not implemented in wx), getBitmapLabel/1
Since: 2.9.1 (available in wxBitmapButton only in previous versions)
destroy(This::wxButton())->ok
Destroys the object.
wxWidgets team. wx 2.1.1 wxButton(3erl)