FDOSTUI
FreeDOS Text User Interface
|
base class for all derived widgets More...
#include <widget.hpp>
Public Types | |
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... | |
Public Member Functions | |
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 void | draw () const =0 |
draws the widget More... | |
virtual enum event_response | event_key_default (enum scancodes const i_scan) |
default key event handler 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 () |
called when the widget receives focus More... | |
virtual void | focus_leave () |
called when the widget looses focus 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... | |
Protected Types | |
enum | flags { VISIBLE = (1 << 0), ENABLED = (1 << 1), CAN_FOCUS = (1 << 2), HAS_FOCUS = (1 << 3), CAN_CLOSE = (1 << 4) } |
Protected Attributes | |
unsigned int | m_damage |
unsigned int | m_flags |
struct box | m_box |
group * | m_parent |
void * | m_user_data |
Private Member Functions | |
widget (const widget &) | |
widget & | operator= (widget const &) |
base class for all derived widgets
enum widget::damage |
bit mask indicating what needs to be redrawn
|
protected |
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
[in] | i_pos_x | x position to place widget |
[in] | i_pos_y | y position to place widget |
[in] | i_len_x | x length of widget |
[in] | i_len_y | y length of widget |
|
virtual |
destructor
|
virtual |
called when widget is about to be destroyed
[in] | i_shutting_down | indicator if application is exiting |
|
inline |
test if point is contained within the widget
[in] | i_pos_x | x coordinate of point |
[in] | i_pos_y | y coordinate of point |
|
inline |
test if rectangular region is contained within the widget
[in] | i_box | rectangle to test |
|
pure virtual |
draws the widget
This method should not be called directly. The position of the widget is relative to it's parent. Using this method directly will cause the widget to be drawn relative to the display screen. It will also ignore state flags such as visibility.
wm_draw_widget to draw a widget wm_draw to draw a window
Implemented in slider, button, window, listbox, entry, group, menu, label, tree, combobox, scroller, edit, spinner, menubar, and scrollbar.
|
inlinevirtual |
|
inlinevirtual |
default key event handler
[in] | i_event | key event to handle |
This routine is called by the window manager when there was no response (RESPONSE_NONE) to event_key.
The menubar widget overrides this routine to intercept accelerators that could active the menu.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
called when the widget looses focus
Unsets the widget::HAS_FOCUS flags bit mask
|
inline |
gets the rectangular region this widget occupies
[out] | o_box | rectangle to fill |
|
inline |
gets whether or not the widget can receive focus
|
inline |
gets whether or not the widget is enabled
|
inline |
gets whether or not the widget has focus
|
inline |
gets the horizontal length of the widget
|
inline |
gets the vertical length of the widget
|
inline |
gets the parent widget
|
inline |
gets the relative x position of the widget
|
inline |
gets the relative y position of the widget
|
inline |
gets user defined data pointer
|
inline |
gets whether or not the widget is visible
|
inlinevirtual |
|
inlinevirtual |
|
inline |
set internal indicator if widget can be closed
[in] | i_can_close | indicator if widget can be closed |
This is usefull to hide instead of close window widgets.
|
inlinevirtual |
|
inline |
disable the widget
|
inline |
hide the widget
|
inlinevirtual |
|
inline |
sets the user defined data pointer
[in] | io_user_data | pointer to user data or NULL to unset |
|
inline |
sets the widget as visible
void widget::translate_screen | ( | int *const | o_pos_x, |
int *const | o_pos_y | ||
) | const |
translate a widgets relative coordinates to screen coordinates
[out] | o_pos_x | translated x position |
[out] | o_pos_y | translated y position |
|
protected |
rectangular region the widget occupies
|
protected |
bit mask of widget::damage flags
|
protected |
bit mask of widget::damage flags
|
protected |
parent group this widget belongs too
|
protected |
user defined data pointer