diff options
author | Joel Bodenmann <info@b-electronics.ch> | 2018-10-01 15:06:14 +0200 |
---|---|---|
committer | Gogs <gogs@fake.local> | 2018-10-01 15:06:14 +0200 |
commit | e414e77d23739835607616203b2d44590b1090a1 (patch) | |
tree | 5f7cd72afd293b312e0606699a1cb2293415979f | |
parent | 3486e475796b1df79b46dd34119ea72ed74be732 (diff) | |
parent | 82287d168fc7544b0cd95b135eb59eea5d084f3b (diff) | |
download | uGFX-e414e77d23739835607616203b2d44590b1090a1.tar.gz uGFX-e414e77d23739835607616203b2d44590b1090a1.tar.bz2 uGFX-e414e77d23739835607616203b2d44590b1090a1.zip |
Merge branch 'feature/label_renderer' of XenotriX/uGFX into master
-rw-r--r-- | src/gwin/gwin_label.c | 10 | ||||
-rw-r--r-- | src/gwin/gwin_label.h | 11 |
2 files changed, 16 insertions, 5 deletions
diff --git a/src/gwin/gwin_label.c b/src/gwin/gwin_label.c index ff70fdde..c34b1ea7 100644 --- a/src/gwin/gwin_label.c +++ b/src/gwin/gwin_label.c @@ -99,10 +99,12 @@ void gwinLabelSetBorder(GHandle gh, gBool border) { } #endif // GWIN_LABEL_ATTRIBUTE -static void gwinLabelDraw(GWidgetObject *gw, gJustify justify) { +void gwinLabelDrawJustified(GWidgetObject *gw, void *param) { gCoord w, h; gColor c; + gJustify justify = (gJustify)param; + // is it a valid handle? if (gw->g.vmt != (gwinVMT *)&labelVMT) return; @@ -129,19 +131,19 @@ static void gwinLabelDraw(GWidgetObject *gw, gJustify justify) { void gwinLabelDrawJustifiedLeft(GWidgetObject *gw, void *param) { (void)param; - gwinLabelDraw(gw, gJustifyLeft); + gwinLabelDrawJustified(gw, (void *)gJustifyLeft); } void gwinLabelDrawJustifiedRight(GWidgetObject *gw, void *param) { (void)param; - gwinLabelDraw(gw, gJustifyRight); + gwinLabelDrawJustified(gw, (void *)gJustifyRight); } void gwinLabelDrawJustifiedCenter(GWidgetObject *gw, void *param) { (void)param; - gwinLabelDraw(gw, gJustifyCenter); + gwinLabelDrawJustified(gw, (void *)gJustifyCenter); } #undef gh2obj diff --git a/src/gwin/gwin_label.h b/src/gwin/gwin_label.h index 9308efae..a3ba7a0d 100644 --- a/src/gwin/gwin_label.h +++ b/src/gwin/gwin_label.h @@ -112,7 +112,6 @@ void gwinLabelSetBorder(GHandle gh, gBool border); * * @note In your custom label drawing function you may optionally call these * standard functions and then draw your extra details on top. - * @note The built-in functions below ignore the param parameter. * @note These custom drawing routines don't have to worry about setting clipping as the framework * sets clipping to the object window prior to calling these routines. * @@ -120,6 +119,16 @@ void gwinLabelSetBorder(GHandle gh, gBool border); */ /** + * @brief Renders a label with the text justified based on the parameter. + * + * @param[in] gw The widget object (must be a label object) + * @param[in] param A parameter passed in from the user. Must be of type gJustify. + * + * @api + */ +void gwinLabelDrawJustified(GWidgetObject *gw, void *param); + +/** * @brief Renders a label with the text left jestified. * * @note This is the default rendering function. |