Functions | |
void * | mt_SlidCreate (APPvar *app, short min, short max, short sinc, short linc, short value, int ori, int upd) |
Initialise a slider structure. | |
void | mt_SlidDelete (APPvar *app, void *slid) |
delete (free) a slider structure created by mt_SlidCreate() | |
void | mt_SlidAttach (APPvar *app, void *slid, int mode, WINDOW *win, int up, int bsld, int sld, int dn) |
Attach a slider to an object structure in a formular. | |
short | mt_SlidGetValue (APPvar *app, void *slid) |
Returns the current value of a slider. | |
void | mt_SlidSetFunc (APPvar *app, void *slid, func_doslid func, void *data) |
define a slider event function. | |
void | mt_SlidSetSize (APPvar *app, void *slid, int size) |
Change the size of the slider cursor widget. | |
void | mt_SlidSetValue (APPvar *app, void *slid, short value) |
Change the current slider value. | |
void | mt_SlidSetUpdat (APPvar *app, void *slid, int upd) |
Changes a slider update behavior. |
|
Attach a slider to an object structure in a formular.
Objects up and dn are generally TOUCHEXIT SELECTABLE G_BOXCHAR object containing an up arrow and and down arrow if slider is vertical, or left arrow and right arrow if slider is horizontal. When user clicks on these widgets, slider value is increased or decreased using the small increment step defined by sinc mt_SlidCreate() parameter. up and/or dn can be set to -1. In this case, the slider won't use these widgets. Object sld should always be a children of the bsld object. When the user click on pager object (bsld), slider value is increased or decreased using the large increment step defined by linc mt_SlidCreate() parameter. If sld and bg are set to -1, the slider won't use these widgets. The TOUCHEXIT flag is required for the four objects specified in mt_SlidAttach().
|
|
Initialise a slider structure.
The object slider should be creating in a resource editor (or in other way). Then this object slider must to attached to the slider structure created by mt_SlidCreate(). The function mt_SlidAttach() performs this link. When the slider object is no more used (formular closed), the slider object should be delete using mt_SlidDelete(). min, max and value are respectively minimal value, the maximal value and the current value of the internal slider variable. To read or eventually to change an internal variable, use functions mt_SlidGetValue() and mt_SlidSetValue(). Parameters sinc and linc addresses the user interaction in the slider object. linc represents a small incrementation or decrementation of the slider value and linc represents a large incrementation or decrementation (see mt_SlidAttach()). Parameter upd is usefull if you attach an update function to the slider (see mt_SlidSetFunc()). This function is called when the slider value is changed.
|
|
delete (free) a slider structure created by mt_SlidCreate()
|
|
Returns the current value of a slider.
|
|
define a slider event function.
win and mode are respectively the window descriptor host and the formular type (OC_FORM or OC_TOOLBAR). Parameter value is the new value of the slider. data is an optional pointer to a user data specified by mt_SlidSetFunc().
|
|
Change the size of the slider cursor widget.
Generally, a cursor have a fixed size. But in the case of a slider associated to a window displaying a list for elements for example, this size can be used to symbolize the number of elements displayed in the window compare to the total of elements. In this case : size = MIN( (elements_seen / elements_total) * 1000, 1000); |
|
Changes a slider update behavior.
|
|
Change the current slider value.
|