added slider enable/disable API
This commit is contained in:
parent
9c33df953d
commit
a4ca308dd5
2 changed files with 31 additions and 0 deletions
|
@ -141,6 +141,16 @@ void gwinSetSliderStyle(GHandle gh, const GSliderDrawStyle *pStyle);
|
|||
*/
|
||||
void gwinSliderDraw(GHandle gh);
|
||||
|
||||
/**
|
||||
* @brief Enable or disable a button
|
||||
*
|
||||
* @param[in] gh The window handle (must be a slider window)
|
||||
* @param[in] enabled Enable or disable the slider
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void gwinSliderSetEnabled(GHandle gh, bool_t enabled);
|
||||
|
||||
/**
|
||||
* @brief Set the callback routine to perform a custom slider drawing.
|
||||
*
|
||||
|
@ -152,6 +162,20 @@ void gwinSliderDraw(GHandle gh);
|
|||
*/
|
||||
void gwinSetSliderCustom(GHandle gh, GSliderDrawFunction fn, void *param);
|
||||
|
||||
/**
|
||||
* @brief Enable a slider
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
#define gwinEnableSlider(gh) gwinSetSliderEnabled( ((GSliderObject *)(gh)), TRUE)
|
||||
|
||||
/**
|
||||
* @brief Disable a slider
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
#define gwinDisableSlider(gh) gwinSetSliderEnabled( ((GSliderObject *)(gh)), FALSE)
|
||||
|
||||
/**
|
||||
* @brief Get the current slider position.
|
||||
* @return The slider position
|
||||
|
|
|
@ -241,6 +241,13 @@ void gwinSetSliderCustom(GHandle gh, GSliderDrawFunction fn, void *param) {
|
|||
#undef gsw
|
||||
}
|
||||
|
||||
void gwinSliderSetEnabled(GHandle gh, bool_t enabled) {
|
||||
if (gh->type != GW_SLIDER)
|
||||
return;
|
||||
|
||||
gh->enabled = enabled;
|
||||
}
|
||||
|
||||
void gwinSliderDraw_Std(GHandle gh, bool_t isVertical, coord_t thumbpos, const GSliderDrawStyle *pstyle, void *param) {
|
||||
(void) param;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue