Create generic GWIN Draw routine

For some GWIN controls they support a Draw() routine.
For those controls the base class now supports a generic Draw routine
which will call their specific Draw routine.
The only GWIN's with a Draw routine currently are Buttons and Sliders.
ugfx_release_2.6
Andrew Hannam 2013-04-06 22:31:40 +10:00
parent 25ed70bade
commit be919fc38d
2 changed files with 25 additions and 0 deletions

View File

@ -165,6 +165,16 @@ void gwinDestroyWindow(GHandle gh);
/* Drawing Functions */
/**
* @brief Draw the window
* @note Redraws the Window if the GWIN object has a draw routine
*
* @param[in] gh The window handle
*
* @api
*/
void gwinDraw(GHandle gh);
/**
* @brief Clear the window
* @note Uses the current background color to clear the window

View File

@ -107,6 +107,21 @@ void gwinDestroyWindow(GHandle gh) {
}
}
void gwinDraw(GHandle gh) {
switch(gh->type) {
#if GWIN_NEED_BUTTON
case GW_BUTTON:
gwinButtonDraw(gh);
break;
#endif
#if GWIN_NEED_SLIDER
case GW_SLIDER:
gwinSliderDraw(gh);
break;
#endif
}
}
#if GDISP_NEED_TEXT
void gwinSetFont(GHandle gh, font_t font) {
gh->font = font;