libt3widget
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
List of all members | Public Member Functions
t3_widget::checkbox_t Class Reference

Class implementing a checkbox. More...

Inheritance diagram for t3_widget::checkbox_t:
t3_widget::widget_t t3_widget::focus_widget_t t3_widget::window_component_t t3_widget::mouse_target_t t3_widget::window_component_t

Public Member Functions

 checkbox_t (bool _state=false)
 Create a new checkbox_t.
bool get_state (void)
 Retrieve the current state of the checkbox_t.
virtual bool is_hotkey (key_t key)
 Query whether key is a hotkey for this widget.
virtual bool process_key (key_t key)
virtual bool process_mouse_event (mouse_event_t event)
 Process a mouse event.
virtual void set_enabled (bool enable)
 Set the enabled status of this widget.
virtual void set_focus (focus_t focus)
void set_label (smart_label_t *_label)
 Associate this checkbox_t with a smart_label_t.
virtual bool set_size (optint height, optint width)
 Set the size of this checkbox_t (ignored).
void set_state (bool _state)
 Set the current state of the checkbox_t.
 T3_WIDGET_SIGNAL (activate, void)
 Signal emitted when the button is pressed.
 T3_WIDGET_SIGNAL (toggled, void)
 Signal emitted when the state of the checkbox_t is toggled.
virtual void update_contents (void)
- Public Member Functions inherited from t3_widget::widget_t
virtual bool accepts_focus (void)
 Query whether this widget accepts focus.
virtual void force_redraw (void)
virtual void hide (void)
virtual bool is_enabled (void)
 Query the enabled status of this widget.
virtual bool is_shown (void)
 Query the visibility status of this widget.
virtual void set_anchor (window_component_t *anchor, int relation)
 Set this widget's anchor.
virtual void set_position (optint top, optint left)
virtual void show (void)
- Public Member Functions inherited from t3_widget::window_component_t
virtual void force_redraw (void)=0
 Request that this window_component_t be completely redrawn.
virtual t3_window_t * get_base_window (void)
 Retrieve the t3_window_t for this window_component_t.
virtual void hide (void)=0
 Hide the window_component_t.
virtual bool process_key (key_t key)=0
 Handle a key press by the user.
virtual void set_focus (focus_t focus)=0
 Set whether this window_component_t has the input focus.
virtual void set_position (optint top, optint left)=0
 Move the window_component_t to a specified position.
virtual bool set_size (optint height, optint width)=0
 Set the size of this window_component_t.
virtual void show (void)=0
 Display the window_component_t.
virtual void update_contents (void)=0
 Update the contents of the window.
 window_component_t (void)
 Base constructor.
virtual ~window_component_t (void)
 Base destructor.
- Public Member Functions inherited from t3_widget::mouse_target_t
void grab_mouse (void)
 Grab all future mouse events.
void register_mouse_target (t3_window_t *target)
 Register a window to receive mouse events.
void release_mouse_grab (void)
 Release a previous mouse grab.
void unregister_mouse_target (t3_window_t *target)
 Unregister a window to receive mouse events.

Additional Inherited Members

- Public Types inherited from t3_widget::window_component_t
enum  focus_t {
  FOCUS_OUT, FOCUS_SET, FOCUS_IN_FWD, FOCUS_IN_BCK,
  FOCUS_REVERT
}
- Static Public Member Functions inherited from t3_widget::mouse_target_t
static bool handle_mouse_event (mouse_event_t event)
- Protected Member Functions inherited from t3_widget::widget_t
void init_unbacked_window (int height, int width, bool register_as_mouse_target=false)
 Initialize the window with an unbacked t3_window_t with height and width.
void init_window (int height, int width, bool register_as_mouse_target=true)
 Initialize the window with a t3_window_t with height and width.
 widget_t (int height, int width, bool register_as_mouse_target=true)
 Constructor which creates a default t3_window_t with height and width.
 widget_t (void)
 Constructor which does not create a default t3_window_t.
- Protected Attributes inherited from t3_widget::widget_t
bool enabled
 Widget is enabled.
bool redraw
 Widget requires redrawing on next update_contents call.
bool shown
 Widget is shown.

Detailed Description

Class implementing a checkbox.

Constructor & Destructor Documentation

t3_widget::checkbox_t::checkbox_t ( bool  _state = false)

Create a new checkbox_t.

Parameters
_stateThe initial state of the checkbox_t.

Member Function Documentation

bool t3_widget::checkbox_t::get_state ( void  )

Retrieve the current state of the checkbox_t.

bool t3_widget::checkbox_t::is_hotkey ( key_t  key)
virtual

Query whether key is a hotkey for this widget.

Reimplemented from t3_widget::widget_t.

bool t3_widget::checkbox_t::process_mouse_event ( mouse_event_t  event)
virtual

Process a mouse event.

Returns
A boolean indicating whether this mouse_target_t handled the mouse event.

Reimplemented from t3_widget::widget_t.

void t3_widget::checkbox_t::set_enabled ( bool  enable)
virtual

Set the enabled status of this widget.

When the checkbox_t is not enabled, it does not accept focus and the contents will be shown as a dash (-).

Reimplemented from t3_widget::widget_t.

void t3_widget::checkbox_t::set_label ( smart_label_t _label)

Associate this checkbox_t with a smart_label_t.

bool t3_widget::checkbox_t::set_size ( optint  height,
optint  width 
)
virtual

Set the size of this checkbox_t (ignored).

A checkbox_t has a fixed size, so both height and width are ignored.

void t3_widget::checkbox_t::set_state ( bool  _state)

Set the current state of the checkbox_t.

t3_widget::checkbox_t::T3_WIDGET_SIGNAL ( activate  ,
void   
)

Signal emitted when the button is pressed.

t3_widget::checkbox_t::T3_WIDGET_SIGNAL ( toggled  ,
void   
)

Signal emitted when the state of the checkbox_t is toggled.