2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: tglbtn.h
|
|
|
|
// Purpose: documentation for wxBitmapToggleButton class
|
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxBitmapToggleButton
|
|
|
|
@wxheader{tglbtn.h}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
wxBitmapToggleButton is a wxToggleButton
|
|
|
|
that contains a bitmap instead of text.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
This control emits an update UI event.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@beginEventTable
|
|
|
|
@event{EVT_TOGGLEBUTTON(id\, func)}:
|
|
|
|
Handles a toggle button click event.
|
|
|
|
@endEventTable
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxcore}
|
|
|
|
@category{ctrl}
|
|
|
|
@appearance{bitmaptogglebutton.png}
|
|
|
|
*/
|
|
|
|
class wxBitmapToggleButton : public wxControl
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Constructor, creating and showing a toggle button with the bitmap @e label.
|
|
|
|
Internally calls Create().
|
|
|
|
*/
|
|
|
|
wxBitmapToggleButton();
|
2008-03-08 14:43:31 +00:00
|
|
|
wxBitmapToggleButton(wxWindow* parent, wxWindowID id,
|
|
|
|
const wxBitmap& label,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& val,
|
|
|
|
const wxString& name = "checkBox");
|
2008-03-08 13:52:38 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Create method for two-step construction.
|
|
|
|
*/
|
|
|
|
bool Create(wxWindow* parent, wxWindowID id,
|
|
|
|
const wxBitmap& label,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& val,
|
|
|
|
const wxString& name = "checkBox");
|
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the state of the toggle button.
|
|
|
|
|
|
|
|
@returns Returns @true if it is pressed, @false otherwise.
|
|
|
|
*/
|
|
|
|
bool GetValue();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the toggle button to the given state. This does not cause a
|
|
|
|
@c EVT_TOGGLEBUTTON event to be emitted.
|
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param state
|
2008-03-08 13:52:38 +00:00
|
|
|
If @true, the button is pressed.
|
|
|
|
*/
|
|
|
|
void SetValue(bool state);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxToggleButton
|
|
|
|
@wxheader{tglbtn.h}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
wxToggleButton is a button that stays pressed when clicked by the user. In
|
|
|
|
other words, it is similar to wxCheckBox in
|
|
|
|
functionality but looks like a wxButton.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
Since wxWidgets version 2.9.0 this control emits an update UI event.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
You can see wxToggleButton in action in the sixth page of the
|
|
|
|
controls sample.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@beginEventTable
|
|
|
|
@event{EVT_TOGGLEBUTTON(id\, func)}:
|
|
|
|
Handles a toggle button click event.
|
|
|
|
@endEventTable
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxcore}
|
|
|
|
@category{ctrl}
|
|
|
|
@appearance{togglebutton.png}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@seealso
|
|
|
|
wxCheckBox, wxButton, wxBitmapToggleButton
|
|
|
|
*/
|
|
|
|
class wxToggleButton : public wxControl
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Constructor, creating and showing a toggle button.
|
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param parent
|
2008-03-08 13:52:38 +00:00
|
|
|
Parent window. Must not be @NULL.
|
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param id
|
2008-03-08 13:52:38 +00:00
|
|
|
Toggle button identifier. The value wxID_ANY indicates a default value.
|
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param label
|
2008-03-08 13:52:38 +00:00
|
|
|
Text to be displayed next to the toggle button.
|
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param pos
|
2008-03-08 13:52:38 +00:00
|
|
|
Toggle button position. If wxDefaultPosition is specified then a default
|
|
|
|
position is chosen.
|
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param size
|
2008-03-08 13:52:38 +00:00
|
|
|
Toggle button size. If wxDefaultSize is specified then a default
|
|
|
|
size is chosen.
|
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param style
|
2008-03-08 13:52:38 +00:00
|
|
|
Window style. See wxToggleButton.
|
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param validator
|
2008-03-08 13:52:38 +00:00
|
|
|
Window validator.
|
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param name
|
2008-03-08 13:52:38 +00:00
|
|
|
Window name.
|
|
|
|
|
|
|
|
@sa Create(), wxValidator
|
|
|
|
*/
|
|
|
|
wxToggleButton();
|
2008-03-08 14:43:31 +00:00
|
|
|
wxToggleButton(wxWindow* parent, wxWindowID id,
|
|
|
|
const wxString& label,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& val,
|
|
|
|
const wxString& name = "checkBox");
|
2008-03-08 13:52:38 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor, destroying the toggle button.
|
|
|
|
*/
|
|
|
|
~wxToggleButton();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Creates the toggle button for two-step construction. See wxToggleButton()
|
|
|
|
for details.
|
|
|
|
*/
|
|
|
|
bool Create(wxWindow* parent, wxWindowID id,
|
|
|
|
const wxString& label,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& val,
|
|
|
|
const wxString& name = "checkBox");
|
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the state of the toggle button.
|
|
|
|
|
|
|
|
@returns Returns @true if it is pressed, @false otherwise.
|
|
|
|
*/
|
|
|
|
bool GetValue();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the toggle button to the given state. This does not cause a
|
|
|
|
@c EVT_TOGGLEBUTTON event to be emitted.
|
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param state
|
2008-03-08 13:52:38 +00:00
|
|
|
If @true, the button is pressed.
|
|
|
|
*/
|
|
|
|
void SetValue(bool state);
|
|
|
|
};
|