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 pressed down, or false if it is standing up.

get_surface_up

Returns the surface used when button is in the up-state.

get_surface_down

Returns the surface used when button is in the down-state.

get_surface_highlighted

Returns the surface used when button is highlighted.

get_surface_disabled

Returns the surface used when button is disabled.

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.

set_surface_up

Sets the surface used when button is in the up-state.

set_surface_down

Set the surface used when button is in the down-state.

set_surface_highlighted

Sets the surface used when button is highlighted.

set_surface_disabled

Sets the surface used when button is disabled.

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:

Script attributes:

Note that it inherits the attributes of a CL_Component as well.



Questions or comments, write to the
ClanLib mailing list.