CL_Button - ClanLib Game SDK

Home | All Classes | Grouped Classes | Index | Search

# Class CL_Button

Button component More...

Derived from: CL_Component
Derived by: CL_CheckBox CL_RadioButton
Group: GUI (Controls)

#include <ClanLib/gui.h>

Construction:

CL_Button | Button Constructor

Attributes:

get_text | Returns the button text.
is_toggle_button | Returns true if the button is a toggle button.
is_down | Returns true if the button state is down, or false if it is raised.
is_drawn_down | Returns true if the button is visually pressed down, or false if it is raised. This can be used by theme, to get immediate state of the button.

Operations:

set_text | Sets the button text.
set_toggle_mode | If toggle is true, pressing the button toggles it between an On and and Off state. If toggle is false, pressing the button causes an action, then the button returns to the unpressed state.
set_down | Sets the state of the button to pressed down if enable is true or to standing up if enable is false. No signals are not emitted by this function.
toggle | Toggle the button. The toggled() signal are emitted by this function.

Signals:

sig_toggled | This signal is emitted whenever a toggle button changes status.
sig_clicked | This signal is emitted when the button is activated (i.e. first pressed down and then released when the mouse cursor is inside the button).
sig_pressed | This signal is emitted when the button is pressed down. In most cases, you want to use sig_clicked() instead.
sig_released | This signal is emitted when the button is released. In most cases, you want to use sig_clicked() instead.

Detailed description:

!group=GUI/Controls! !header=gui.h!
Questions or comments, write to the ClanLib mailing list.