Icon button widget implementation.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
Data Structures | |
struct | wtk_icon_button |
This is the icon button control struct. More... | |
struct | wtk_icon_group |
This is the icon button group control struct. More... | |
enum | wtk_icon_button_state { WTK_ICONBUTTON_NORMAL, WTK_ICONBUTTON_PRESSED } |
Valid states for icon button, relevant to pointer and keyboard operations. More... | |
struct win_window * | wtk_icon_button_as_child (struct wtk_icon_button *icon_button) |
This function returns a reference to the window that should be used when managing the widget, such as move, resize, destroy and reparenting. More... | |
win_command_t | wtk_icon_button_get_command (struct wtk_icon_button *icon_button) |
This function returns the window command of the specified icon button, as set when the widget was created. More... | |
void | wtk_icon_button_select (struct wtk_icon_button *icon_button) |
This function sets this icon button to be the single icon button selected within its group. More... | |
bool | wtk_icon_button_is_selected (struct wtk_icon_button const *icon_button) |
This function returns true if the icon button is the one currently selected within its icon button group. More... | |
static bool | wtk_icon_button_handler (struct win_window *win, enum win_event_type type, void const *data) |
This function is the window event handler for icon button widgets. More... | |
void | wtk_icon_button_size_hint (struct win_point *size, const struct gfx_bitmap *icon_image) |
Get minimum widget size. More... | |
struct wtk_icon_button * | wtk_icon_button_create (struct win_window *parent, struct win_area const *area, struct gfx_bitmap *icon, bool selected, struct wtk_icon_group *group, win_command_t command) |
This function creates a new icon button widget. More... | |
struct wtk_icon_button * | wtk_icon_group_get_selected (struct wtk_icon_group *group) |
This function retrieves a pointer to the currently selected icon in an icon group. More... | |
struct wtk_icon_group * | wtk_icon_group_create (void) |
This function creates a new icon button group, allocating required memory and properly initializing the object. More... | |
|
static |
This function is the window event handler for icon button widgets.
It handles all events sent to the windows composing the widget.
win | Window receiving the event. |
type | The event type. |
data | Custom data, depending on event type. |
References Assert, wtk_icon_button::command, wtk_icon_button::container, win_command_event::data, gfx_draw_rect, wtk_icon_button::group, membag_free(), NULL, wtk_icon_group::num_references, win_clip_region::origin, win_command_event::recipient, wtk_icon_group::selected, win_command_event::sender, win_area::size, wtk_icon_button::state, WIN_EVENT_DESTROY, WIN_EVENT_DRAW, WIN_EVENT_POINTER, win_get_area(), win_get_custom_data(), win_grab_pointer(), win_is_inside_window(), WIN_POINTER_PRESS, WIN_POINTER_RELEASE, win_queue_command_event(), win_redraw(), wtk_icon_button_select(), WTK_ICONBUTTON_NORMAL, WTK_ICONBUTTON_PRESSED, win_point::x, and win_point::y.
Referenced by wtk_icon_button_create().