Andrew Boyson / web

Dependents:   oldheating gps motorhome heating

Revision:
56:f6e814fe0159
Parent:
46:1822fdbe6c0c
Child:
57:8fa31ff4e773
--- a/page/page.c	Tue Mar 05 16:57:03 2019 +0000
+++ b/page/page.c	Wed Mar 06 11:43:29 2019 +0000
@@ -179,11 +179,20 @@
     snprintf(text, sizeof(text), "%d", value);
     PageAddTextInput(action, width, label, labelwidth, name, inputwidth, text);
 }
-void PageAddCheckInput(char* action, char* label, char* name, char* button)
+void PageAddCheckInput(char* action, char* label, float labelwidth, char* name, char* button)
 {
+    char text[100];
     HttpAddText("<form action='");              HttpAddText(action); HttpAddText("' method='get'>\r\n");
     HttpAddText("<input type='hidden' name='"); HttpAddText(name);   HttpAddText("'>\r\n");
-    HttpAddText(label); HttpAddText("\r\n");
+    if (labelwidth < 0.1)
+    {
+        HttpAddText(label); HttpAddText("\r\n");
+    }
+    else
+    {
+        snprintf(text, sizeof(text), "<div style='width:%.1fem; display:inline-block;'>%s</div>\r\n", labelwidth, label);
+        HttpAddText(text);
+    }
     HttpAddText("<input type='submit' value='"); HttpAddText(button); HttpAddText("'>\r\n");
     HttpAddText("</form>\r\n");
 }