aboutsummaryrefslogtreecommitdiffstats
path: root/widget.c
diff options
context:
space:
mode:
authormichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2008-12-31 06:28:11 +0000
committermichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2008-12-31 06:28:11 +0000
commit509ea3a22fa798ad2f4b506bda5d6bd2eaa6e400 (patch)
treefd95635b3fe7a873c4b0626275e397228de987cb /widget.c
parent51eb1ecfa9ab1faa133ceed79ace85922a5fb1fe (diff)
downloadlcd4linux-509ea3a22fa798ad2f4b506bda5d6bd2eaa6e400.tar.gz
ported r837 from volker_dev
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@925 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'widget.c')
-rw-r--r--widget.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/widget.c b/widget.c
index 5f5f6a7..bc3fe31 100644
--- a/widget.c
+++ b/widget.c
@@ -180,6 +180,19 @@ int widget_add(const char *name, const int type, const int layer, const int row,
/* check if widget type matches */
if (Class->type != type) {
error("widget '%s': class '%s' not applicable", name, class);
+ switch (Class->type) {
+ case WIDGET_TYPE_RC:
+ error(" Widgetclass %s is placed by Row/Column", class);
+ break;
+ case WIDGET_TYPE_XY:
+ error(" Widgetclass %s is placed by X/Y", class);
+ break;
+ case WIDGET_TYPE_GPO:
+ case WIDGET_TYPE_TIMER:
+ case WIDGET_TYPE_KEYPAD:
+ default:
+ error(" Widgetclass %s has unknown type %d", class, Class->type);
+ }
free(class);
return -1;
}
@@ -200,7 +213,7 @@ int widget_add(const char *name, const int type, const int layer, const int row,
/* another sanity check */
if (nWidgets >= MAX_WIDGETS) {
- error("internal error: widget buffer full! Tried to allocate %d widgets (max: %s)", nWidgets, MAX_WIDGETS);
+ error("internal error: widget buffer full! Tried to allocate %d widgets (max: %d)", nWidgets, MAX_WIDGETS);
return -1;
}
@@ -227,8 +240,10 @@ int widget_add(const char *name, const int type, const int layer, const int row,
Widget->row = row;
Widget->col = col;
- info(" widget '%s': Class '%s', Parent '%s', Layer %d, Row %d, Col %d",
- name, (NULL == Class) ? "<none>" : Class->name, (NULL == Parent) ? "<root>" : Parent->name, layer, row, col);
+ info(" widget '%s': Class '%s', Parent '%s', Layer %d, %s %d, %s %d",
+ name, (NULL == Class) ? "<none>" : Class->name,
+ (NULL == Parent) ? "<root>" : Parent->name,
+ layer, (WIDGET_TYPE_XY == Class->type) ? "Y" : "Row", row, (WIDGET_TYPE_XY == Class->type) ? "X" : "Col", col);
if (Class->init != NULL) {
Class->init(Widget);