Microchip® Advanced Software Framework

wtk_icon.c File Reference

Icon button widget implementation.

Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.

#include <stdint.h>
#include <stdlib.h>
#include <membag.h>
#include <string.h>
#include <wtk.h>

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_windowwtk_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_buttonwtk_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_buttonwtk_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_groupwtk_icon_group_create (void)
 This function creates a new icon button group, allocating required memory and properly initializing the object. More...
 

Valid states for icon button, relevant to pointer and keyboard operations.

Enumerator
WTK_ICONBUTTON_NORMAL 

Normal state, no highlight or press.

WTK_ICONBUTTON_PRESSED 

Widget pressed, action occurs when released.

static bool wtk_icon_button_handler ( struct win_window win,
enum win_event_type  type,
void const *  data 
)
static