diff options
| author | Joel Bodenmann <joel@unormal.org> | 2013-11-10 21:07:16 +0100 | 
|---|---|---|
| committer | Joel Bodenmann <joel@unormal.org> | 2013-11-10 21:07:16 +0100 | 
| commit | da2740b706d720292113445ee1db30f8a9873dc4 (patch) | |
| tree | 8f8b1902d4af6a23b3daf26990f580b76ea31ea4 /src/gwin/label.c | |
| parent | 6ca3537a696e7ace8098771a9a7105380604253d (diff) | |
| parent | a8ce005e2621b0108863297948cea0fa52c8bf2a (diff) | |
| download | uGFX-da2740b706d720292113445ee1db30f8a9873dc4.tar.gz uGFX-da2740b706d720292113445ee1db30f8a9873dc4.tar.bz2 uGFX-da2740b706d720292113445ee1db30f8a9873dc4.zip  | |
merging GDISPStreaming
Diffstat (limited to 'src/gwin/label.c')
| -rw-r--r-- | src/gwin/label.c | 16 | 
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gwin/label.c b/src/gwin/label.c index 65afff7e..5619761a 100644 --- a/src/gwin/label.c +++ b/src/gwin/label.c @@ -48,8 +48,8 @@ static void gwinLabelDefaultDraw(GWidgetObject *gw, void *param) {  	coord_t				w, h;  	(void)				param; -	w = (gw->g.flags & GLABEL_FLG_WAUTO) ? getwidth(gw->text, gw->g.font, gdispGetWidth() - gw->g.x) : gw->g.width; -	h = (gw->g.flags & GLABEL_FLG_HAUTO) ? getheight(gw->text, gw->g.font, gdispGetWidth() - gw->g.x) : gw->g.height; +	w = (gw->g.flags & GLABEL_FLG_WAUTO) ? getwidth(gw->text, gw->g.font, gdispGGetWidth(gw->g.display) - gw->g.x) : gw->g.width; +	h = (gw->g.flags & GLABEL_FLG_HAUTO) ? getheight(gw->text, gw->g.font, gdispGGetWidth(gw->g.display) - gw->g.x) : gw->g.height;  	if (gw->g.width != w || gw->g.height != h) {  		gwinResize(&gw->g, w, h); @@ -58,13 +58,13 @@ static void gwinLabelDefaultDraw(GWidgetObject *gw, void *param) {  	}  	// render the text -	gdispFillStringBox(gw->g.x, gw->g.y, gw->g.width, gw->g.height, gw->text, gw->g.font, +	gdispGFillStringBox(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gw->g.height, gw->text, gw->g.font,  			(gw->g.flags & GWIN_FLG_ENABLED) ? gw->pstyle->enabled.text : gw->pstyle->disabled.text, gw->pstyle->background,  			justifyLeft);  	// render the border (if any)  	if (gw->g.flags & GLABEL_FLG_BORDER) -		gdispDrawBox(gw->g.x, gw->g.y, gw->g.width, gw->g.height, (gw->g.flags & GWIN_FLG_ENABLED) ? gw->pstyle->enabled.edge : gw->pstyle->disabled.edge); +		gdispGDrawBox(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gw->g.height, (gw->g.flags & GWIN_FLG_ENABLED) ? gw->pstyle->enabled.edge : gw->pstyle->disabled.edge);  }  static const gwidgetVMT labelVMT = { @@ -102,23 +102,23 @@ static const gwidgetVMT labelVMT = {  	#endif  }; -GHandle gwinLabelCreate(GLabelObject *widget, GWidgetInit *pInit) { +GHandle gwinGLabelCreate(GDisplay *g, GLabelObject *widget, GWidgetInit *pInit) {  	uint16_t flags = 0;  	// auto assign width  	if (pInit->g.width <= 0) {  		flags |= GLABEL_FLG_WAUTO; -		pInit->g.width = getwidth(pInit->text, gwinGetDefaultFont(), gdispGetWidth() - pInit->g.x); +		pInit->g.width = getwidth(pInit->text, gwinGetDefaultFont(), gdispGGetWidth(g) - pInit->g.x);  	}  	// auto assign height  	if (pInit->g.height <= 0) {  		flags |= GLABEL_FLG_HAUTO; -		pInit->g.height = getheight(pInit->text, gwinGetDefaultFont(), gdispGetWidth() - pInit->g.x); +		pInit->g.height = getheight(pInit->text, gwinGetDefaultFont(), gdispGGetWidth(g) - pInit->g.x);  	} -	if (!(widget = (GLabelObject *)_gwidgetCreate(&widget->w, pInit, &labelVMT))) +	if (!(widget = (GLabelObject *)_gwidgetCreate(g, &widget->w, pInit, &labelVMT)))  		return 0;  	// no borders by default  | 
