FDOSTUI
FreeDOS Text User Interface
Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | List of all members
radiobutton Class Reference

radio button widget More...

#include <radiobtn.hpp>

Inheritance diagram for radiobutton:
Inheritance graph
[legend]

Public Member Functions

 radiobutton (int const i_pos_x, int const i_pos_y, unsigned int const i_len_x, unsigned int const i_len_y)
 constructor More...
 
virtual ~radiobutton ()
 destructor More...
 
bool join (radiobutton *const i_radiobutton)
 adds a radio button to this buttons group More...
 
- Public Member Functions inherited from checkbutton
 checkbutton (int const i_pos_x, int const i_pos_y, unsigned int const i_len_x, unsigned int const i_len_y)
 constructor More...
 
virtual ~checkbutton ()
 destructor More...
 
void clear_state ()
 sets the state to unchecked More...
 
bool get_state () const
 get current state More...
 
void set_state ()
 sets the state to checked More...
 
- Public Member Functions inherited from button
 button (int const i_pos_x, int const i_pos_y, unsigned int const i_len_x, unsigned int const i_len_y)
 constructor More...
 
virtual ~button ()
 destructor More...
 
virtual void draw () const
 draws the widget More...
 
virtual enum event_response event_key (struct event_key const &i_event)
 handle key event More...
 
virtual enum event_response event_mouse (struct event_mouse const &i_event)
 handle mouse event More...
 
virtual void focus_enter ()
 handle entering focus More...
 
virtual void focus_leave ()
 handle leaving focus More...
 
void set_response (int const i_response)
 sets response generated when button is clicked More...
 
void set_style (unsigned int const i_style)
 set button style (no box, flat or box or box and shadow More...
 
void set_text (unsigned char const *i_str)
 
void set_signal_clicked (signal_clicked_t i_signal)
 set callback More...
 
- Public Member Functions inherited from widget
 widget (int const i_pos_x, int const i_pos_y, unsigned int const i_len_x, unsigned int const i_len_y)
 constructor More...
 
virtual ~widget ()
 destructor More...
 
virtual void set_damage (unsigned int const i_damage=DAMAGE_NONE)
 set the damage bits More...
 
virtual bool close (bool const i_shutting_down)
 called when widget is about to be destroyed More...
 
bool contains (int const i_pos_x, int const i_pos_y) const
 test if point is contained within the widget More...
 
bool contains (struct box const &i_box) const
 test if rectangular region is contained within the widget More...
 
virtual enum event_response event_key_default (enum scancodes const i_scan)
 default key event handler More...
 
void get_box (struct box &o_box) const
 gets the rectangular region this widget occupies More...
 
bool get_can_focus () const
 gets whether or not the widget can receive focus More...
 
bool get_enabled () const
 gets whether or not the widget is enabled More...
 
bool get_has_focus () const
 gets whether or not the widget has focus More...
 
group *const get_parent () const
 gets the parent widget More...
 
void * get_user_data () const
 gets user defined data pointer More...
 
bool get_visible () const
 gets whether or not the widget is visible More...
 
int get_pos_x () const
 gets the relative x position of the widget More...
 
int get_pos_y () const
 gets the relative y position of the widget More...
 
unsigned int get_len_x () const
 gets the horizontal length of the widget More...
 
unsigned int get_len_y () const
 gets the vertical length of the widget More...
 
virtual void move (int const i_pos_x, int const i_pos_y)
 move the widget to a new position More...
 
virtual void resize (unsigned int const i_len_x, unsigned int const i_len_y)
 resize the widget More...
 
void set_can_close (bool const i_can_close)
 set internal indicator if widget can be closed More...
 
void set_disabled ()
 disable the widget More...
 
void set_enabled ()
 enable the widget
 
void set_hidden ()
 hide the widget More...
 
virtual void set_parent (group *const i_parent)
 sets the parent group of the widget More...
 
void set_user_data (void *io_user_data)
 sets the user defined data pointer More...
 
void set_visible ()
 sets the widget as visible More...
 
void translate_screen (int *const o_pos_x, int *const o_pos_y) const
 translate a widgets relative coordinates to screen coordinates More...
 

Public Attributes

radiobuttonm_next
 
radiobuttonm_prev
 

Protected Member Functions

virtual void toggled ()
 handler when the button has been toggled More...
 

Private Member Functions

 radiobutton (const radiobutton &)
 
radiobuttonoperator= (radiobutton const &)
 

Additional Inherited Members

- Public Types inherited from button
enum  style { STYLE_FLAT = (1 << 0), STYLE_SHADOW = (1 << 1), STYLE_BOX = (1 << 2) }
 indicator of the type of box that should be drawn around the button More...
 
typedef void(* signal_clicked_t) (button const *i_button, void *io_user_data)
 function prototype to receive signal More...
 
- Public Types inherited from widget
enum  damage {
  DAMAGE_NONE = 0, DAMAGE_ALL = (1<<0), DAMAGE_LABEL = (1<<1), DAMAGE_VALUE = (1<<2),
  DAMAGE_SCROLL = (1<<3), DAMAGE_MOVED = (1<<4), DAMAGE_RESERVED1 = (1<<5), DAMAGE_RESERVED2 = (1<<6),
  DAMAGE_RESERVED3 = (1<<7)
}
 bit mask indicating what needs to be redrawn More...
 
- Protected Types inherited from button
enum  type { TYPE_BUTTON, TYPE_CHECK, TYPE_RADIO }
 
- Protected Types inherited from widget
enum  flags {
  VISIBLE = (1 << 0), ENABLED = (1 << 1), CAN_FOCUS = (1 << 2), HAS_FOCUS = (1 << 3),
  CAN_CLOSE = (1 << 4)
}
 
- Protected Attributes inherited from button
bool m_state
 on/off state (for normal button ignored)
 
enum type m_type
 button type
 
unsigned int m_style
 button style (button::style bit flags)
 
unsigned char * m_label
 dynamically allocated buffer to hold label
 
enum event_response m_response
 response generated when user clicks on the button
 
signal_clicked_t m_signal_clicked
 pointer to signal emit function
 
- Protected Attributes inherited from widget
unsigned int m_damage
 
unsigned int m_flags
 
struct box m_box
 
groupm_parent
 
void * m_user_data
 

Detailed Description

radio button widget

Check button widget, which contains the state of on or off. A radio button can belong to a group of other radio buttons. Only one button at a time may contain the on state.

The radio group is implemented as a doubly linked list. Each radiobutton contains a pointer to the next and previous radiobutton in the grouop. Data members are made public, however, the should only be used internally.

Constructor & Destructor Documentation

◆ radiobutton()

radiobutton::radiobutton ( int const  i_pos_x,
int const  i_pos_y,
unsigned int const  i_len_x,
unsigned int const  i_len_y 
)

constructor

Parameters
[in]i_pos_xx position to place widget
[in]i_pos_yy position to place widget
[in]i_len_xx length of widget
[in]i_len_yy length of widget
Returns
none

◆ ~radiobutton()

radiobutton::~radiobutton ( )
virtual

destructor

Returns
none

Member Function Documentation

◆ join()

bool radiobutton::join ( radiobutton *const  i_radiobutton)

adds a radio button to this buttons group

Parameters
[in]i_radiobuttonbutton to add
Returns
false radiobutton could not be added to group
true radiobutton added to group

A radiobutton can only belong to one group. In addition, the radiobutton must have been added to this parent widget.

◆ toggled()

void radiobutton::toggled ( )
protectedvirtual

handler when the button has been toggled

This method will synchronize radiobutton widgets so only one is selected.

Reimplemented from button.

Member Data Documentation

◆ m_next

radiobutton::m_next

next radiobutton in group

◆ m_prev

radiobutton::m_prev

previous radiobutton in group


The documentation for this class was generated from the following files: