diff options
author | Joel Bodenmann <joel@unormal.org> | 2013-07-17 17:49:21 +0200 |
---|---|---|
committer | Joel Bodenmann <joel@unormal.org> | 2013-07-17 17:49:21 +0200 |
commit | 259f822ba7a30cd729faf273dbb8acbca51c5a3a (patch) | |
tree | a71d4700b623f25898407759ae8b585953004587 /src | |
parent | ceae37b7bfe50f74a1b6ccb0e0c91736d64a5755 (diff) | |
download | uGFX-259f822ba7a30cd729faf273dbb8acbca51c5a3a.tar.gz uGFX-259f822ba7a30cd729faf273dbb8acbca51c5a3a.tar.bz2 uGFX-259f822ba7a30cd729faf273dbb8acbca51c5a3a.zip |
added list widget dummy
Diffstat (limited to 'src')
-rw-r--r-- | src/gwin/gwin.mk | 1 | ||||
-rw-r--r-- | src/gwin/label.c | 1 | ||||
-rw-r--r-- | src/gwin/list.c | 73 |
3 files changed, 75 insertions, 0 deletions
diff --git a/src/gwin/gwin.mk b/src/gwin/gwin.mk index 92b10b7b..ec02f139 100644 --- a/src/gwin/gwin.mk +++ b/src/gwin/gwin.mk @@ -9,4 +9,5 @@ GFXSRC += $(GFXLIB)/src/gwin/gwin.c \ $(GFXLIB)/src/gwin/gimage.c \ $(GFXLIB)/src/gwin/label.c \ $(GFXLIB)/src/gwin/radio.c \ + $(GFXLIB)/src/gwin/list.c \ diff --git a/src/gwin/label.c b/src/gwin/label.c index 2ff60eb4..a76c0ec4 100644 --- a/src/gwin/label.c +++ b/src/gwin/label.c @@ -95,6 +95,7 @@ GHandle gwinLabelCreate(GLabelObject *widget, GWidgetInit *pInit) { // auto assign width if (pInit->g.width <= 0) { + flags |= GLABEL_FLG_WAUTO; pInit->g.width = getwidth(pInit->text, gwinGetDefaultFont(), gdispGetWidth() - pInit->g.x); } diff --git a/src/gwin/list.c b/src/gwin/list.c new file mode 100644 index 00000000..475b4fba --- /dev/null +++ b/src/gwin/list.c @@ -0,0 +1,73 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://chibios-gfx.com/license.html + */ + +/** + * @file include/gwin/list.h + * @brief GWIN list widget header file. + * + * @defgroup List List + * @ingroup GWIN + * + * @{ + */ + +#include "gfx.h" + +#if GFX_USE_GWIN && GWIN_NEED_LIST + +#include "gwin/class_gwin.h" + +static void gwinListDefaultDraw(GWidgetObject* gw, void* param) { + +} + +static const gwidgetVMT listVMT = { + { + "List", // The class name + sizeof(GListObject), // The object size + _gwidgetDestroy, // The destroy routine + _gwidgetRedraw, // The redraw routine + 0, // The after-clear routine + }, + gwinListDefaultDraw, // default drawing routine + #if GWINPUT_NEED_MOUSE + { + 0, + 0, + 0, + }, + #endif + #if GINPUT_NEED_TOGGLE + { + 0, + 0, + 0, + 0, + 0, + }, + #endif + #if GINPUT_NEED_DIAL + { + 0, + 0, + 0, + 0, + }, + #endif +}; + +GHandle gwinListCreate(GListObject* widget, GWidgetInit* pInit) { + if (!(widget = (GListObject *)_gwidgetCreate(&widget->w, pInit, &listVMT))) + return 0; + + gwinSetVisible(&widget->w.g, pInit->g.show); + + return (GHandle)widget; +} + +#endif // GFX_USE_GWIN && GWIN_NEED_LIST + |