Functions | |
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... | |
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_data) |
This function creates a new icon button widget. 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... | |
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... | |
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... | |
void | wtk_icon_button_size_hint (struct win_point *size, const struct gfx_bitmap *icon_image) |
Get minimum widget size. 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... | |
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 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.
icon_button | Icon button widget to manage. |
References Assert, and wtk_icon_button::container.
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.
It allocates required memory and initializes necessary windows to create the widget. If there is not enough memory, the function returns NULL. To destroy the widget and all its contents, and free its memory, call win_destroy() on the icon button's child reference, given by wtk_icon_button_as_child(), like this: "win_destroy(wtk_icon_button_as_child(myButtonPtr));". Usually it will be destroyed automatically when it's parent is destroyed.
parent | Parent window, possibly wtk_frame_as_parent(myFramePtr). |
area | Area of the internal contents. |
icon | Bitmap to draw as the icon. |
selected | Initial state of icon button, true if checked/selected. |
group | Icon button group to be a member of. |
command | Command to send to parent window. Must be non-zero to be enabled. |
References win_attributes::area, Assert, win_attributes::background, win_attributes::behavior, wtk_icon_button::command, wtk_icon_button::container, win_attributes::custom, win_attributes::event_handler, wtk_icon_button::group, membag_alloc(), membag_free(), NULL, num_references, selected, wtk_icon_button::state, win_create(), wtk_icon_button_handler(), wtk_icon_button_select(), and WTK_ICONBUTTON_NORMAL.
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.
icon_button | Icon button widget to manage. |
References Assert, and wtk_icon_button::command.
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.
References Assert, wtk_icon_button::group, and selected.
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.
If another icon button was selected, it will be deselected. Both widgets will be redrawn if visible.
icon_button | Icon button widget to select. |
References Assert, wtk_icon_button::container, wtk_icon_button::group, selected, and win_redraw().
Referenced by wtk_icon_button_create(), and wtk_icon_button_handler().
void wtk_icon_button_size_hint | ( | struct win_point * | size, |
const struct gfx_bitmap * | icon_image | ||
) |
Get minimum widget size.
This function returns the minimum size that is required for showing the full widget icon image.
size | Suggested size for the widget |
icon_image | Pointer to icon image to use for widget. |
References Assert, gfx_bitmap::height, gfx_bitmap::width, win_point::x, and win_point::y.
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.
If there is not enough memory, the function returns NULL. The icon button group will keep a reference count for its members, and will be automatically destroyed when the last member is destroyed.
References membag_alloc(), NULL, num_references, and selected.
struct wtk_icon_button* wtk_icon_group_get_selected | ( | struct wtk_icon_group * | group | ) |