GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
A stock switch widget. More...
Go to the source code of this file.
Functions | |
gp_widget * | gp_widget_stock_switch_new (gp_widget_stock_type on_stock, gp_widget_stock_type off_stock, gp_widget_size min_size, bool set) |
Allocate and initialize new stock switch widget. | |
static gp_widget * | gp_widget_stock_switch_new_ev (gp_widget_stock_type on_stock, gp_widget_stock_type off_stock, gp_widget_size min_size, bool set, int(*on_event)(gp_widget_event *ev), void *priv) |
Allocate and initialize new stock switch widget. | |
A stock switch widget.
Stock switch is a widget that cycles between two images to represent on and off state and is changed by clicking on the stock images. Consider for example shuffle_on and shuffle_off stock images as a canonical example of such widget.
Stock switch is a bool class widget, after it's created it's acessed by the class functions such as gp_widget_bool_set().
Attribute | Type | Default | Description |
---|---|---|---|
min_size | string | 2*pad + asc | Minimal size parsed by gp_widget_size_units_parse(). |
on_stock | string | GP_WIDGET_STOCK_NONE | Stock image when switch is on. |
off_stock | string | GP_WIDGET_STOCK_NONE | Stock image when switch is off. |
set | bool | false | Initial switch state. |
Definition in file gp_widget_stock_switch.h.
gp_widget * gp_widget_stock_switch_new | ( | gp_widget_stock_type | on_stock, |
gp_widget_stock_type | off_stock, | ||
gp_widget_size | min_size, | ||
bool | set | ||
) |
Allocate and initialize new stock switch widget.
on_stock | A stock image when switch is on, can be GP_WIDGET_STOCK_NONE if there is none. |
off_stock | A stock image when switch is off, can be GP_WIDGET_STOCK_NONE if there is none. |
min_size | A minimal widget size parsed by gp_widget_size_units_parse(). Pass GP_WIDGET_SIZE_DEFAULT for a default size. |
set | An initial state for the switch. |
Referenced by gp_widget_stock_switch_new_ev().
|
inlinestatic |
Allocate and initialize new stock switch widget.
on_stock | A stock image when switch is on, can be GP_WIDGET_STOCK_NONE if there is none. |
off_stock | A stock image when switch is off, can be GP_WIDGET_STOCK_NONE if there is none. |
set | An initial state for the switch. |
on_event | An widget event handler. |
priv | User private data. |
Definition at line 68 of file gp_widget_stock_switch.h.
References gp_widget_on_event_set(), and gp_widget_stock_switch_new().