diff options
author | Joel Bodenmann <joel@unormal.org> | 2014-01-05 05:05:59 +0100 |
---|---|---|
committer | Joel Bodenmann <joel@unormal.org> | 2014-01-05 05:05:59 +0100 |
commit | bd3109851b2f239677a8516eec6729124d11b344 (patch) | |
tree | 3e121fdcf435130c83a8131bd05ac46d44afeee1 /src/gwin/checkbox.c | |
parent | a6b81192eb2ce4df34b04253c28b50e797aaccc9 (diff) | |
download | uGFX-bd3109851b2f239677a8516eec6729124d11b344.tar.gz uGFX-bd3109851b2f239677a8516eec6729124d11b344.tar.bz2 uGFX-bd3109851b2f239677a8516eec6729124d11b344.zip |
now using absolute coordinates inside the window
Diffstat (limited to 'src/gwin/checkbox.c')
-rw-r--r-- | src/gwin/checkbox.c | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/src/gwin/checkbox.c b/src/gwin/checkbox.c index 4e487196..13730d50 100644 --- a/src/gwin/checkbox.c +++ b/src/gwin/checkbox.c @@ -153,52 +153,44 @@ static const GColorSet *getDrawColors(GWidgetObject *gw) { void gwinCheckboxDraw_CheckOnLeft(GWidgetObject *gw, void *param) { #define gcw ((GCheckboxObject *)gw) - coord_t ld, df, abs_x, abs_y; + coord_t ld, df; const GColorSet * pcol; (void) param; - if (gw->g.vmt != (gwinVMT *)&checkboxVMT) - return; - - gwinGetAbsoluteCoordinates((GHandle)gw, &abs_x, &abs_y); - + if (gw->g.vmt != (gwinVMT *)&checkboxVMT) return; pcol = getDrawColors(gw); ld = gw->g.width < gw->g.height ? gw->g.width : gw->g.height; - gdispGFillArea(gw->g.display, abs_x+1, abs_y+1, ld, ld-2, gw->pstyle->background); - gdispGDrawBox(gw->g.display, abs_x, abs_y, ld, ld, pcol->edge); + gdispGFillArea(gw->g.display, gw->g.x+1, gw->g.y+1, ld, ld-2, gw->pstyle->background); + gdispGDrawBox(gw->g.display, gw->g.x, gw->g.y, ld, ld, pcol->edge); df = ld < 4 ? 1 : 2; if (gw->g.flags & GCHECKBOX_FLG_CHECKED) - gdispGFillArea(gw->g.display, abs_x+df, abs_y+df, ld-2*df, ld-2*df, pcol->fill); + gdispGFillArea(gw->g.display, gw->g.x+df, gw->g.y+df, ld-2*df, ld-2*df, pcol->fill); - gdispGFillStringBox(gw->g.display, abs_x+ld+1, abs_y, gw->g.width-ld-1, gw->g.height, gw->text, gw->g.font, pcol->text, gw->pstyle->background, justifyLeft); + gdispGFillStringBox(gw->g.display, gw->g.x+ld+1, gw->g.y, gw->g.width-ld-1, gw->g.height, gw->text, gw->g.font, pcol->text, gw->pstyle->background, justifyLeft); #undef gcw } void gwinCheckboxDraw_CheckOnRight(GWidgetObject *gw, void *param) { #define gcw ((GCheckboxObject *)gw) - coord_t ep, ld, df, abs_x, abs_y; + coord_t ep, ld, df; const GColorSet * pcol; (void) param; - if (gw->g.vmt != (gwinVMT *)&checkboxVMT) - return; - - gwinGetAbsoluteCoordinates((GHandle)gw, &abs_x, &abs_y); - + if (gw->g.vmt != (gwinVMT *)&checkboxVMT) return; pcol = getDrawColors(gw); ld = gw->g.width < gw->g.height ? gw->g.width : gw->g.height; ep = gw->g.width-ld-1; - gdispGFillArea(gw->g.display, abs_x+ep-1, abs_y+1, ld, ld-2, gw->pstyle->background); - gdispGDrawBox(gw->g.display, abs_x+ep, abs_y, ld, ld, pcol->edge); + gdispGFillArea(gw->g.display, gw->g.x+ep-1, gw->g.y+1, ld, ld-2, gw->pstyle->background); + gdispGDrawBox(gw->g.display, gw->g.x+ep, gw->g.y, ld, ld, pcol->edge); df = ld < 4 ? 1 : 2; if (gw->g.flags & GCHECKBOX_FLG_CHECKED) - gdispGFillArea(gw->g.display, abs_x+ep+df, abs_y+df, ld-2*df, ld-2*df, pcol->fill); + gdispGFillArea(gw->g.display, gw->g.x+ep+df, gw->g.y+df, ld-2*df, ld-2*df, pcol->fill); - gdispGFillStringBox(gw->g.display, abs_x, abs_y, ep-1, gw->g.height, gw->text, gw->g.font, pcol->text, gw->pstyle->background, justifyRight); + gdispGFillStringBox(gw->g.display, gw->g.x, gw->g.y, ep-1, gw->g.height, gw->text, gw->g.font, pcol->text, gw->pstyle->background, justifyRight); #undef gcw } |