summaryrefslogtreecommitdiff
path: root/fluid/template_panel.fl
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-11-06 19:09:48 +0100
committerMatthias Melcher <github@matthiasm.com>2023-11-07 14:28:22 +0100
commitd7768b76d042eaa6cdce97976e96315d0bceccb2 (patch)
tree92b8c751fa1affc7f5fdb10d980bd4ea4ba1e36e /fluid/template_panel.fl
parent8b31954d6698bded12d6252b1bbc46c6eece7f73 (diff)
FLUID: Adds template for tutorial.
Tutorial still to be written. Also adds convenience methods to Fl_Input_ for getting and setting numeric values.
Diffstat (limited to 'fluid/template_panel.fl')
-rw-r--r--fluid/template_panel.fl30
1 files changed, 23 insertions, 7 deletions
diff --git a/fluid/template_panel.fl b/fluid/template_panel.fl
index 1f6f801f0..8f063ec75 100644
--- a/fluid/template_panel.fl
+++ b/fluid/template_panel.fl
@@ -68,7 +68,7 @@ template_preview->image(0);
template_browser->deselect();
template_name->value("");
template_instance->value("");
-template_panel->hide();}
+template_panel->hide();} open
xywh {478 284 460 355} type Double resizable modal visible
} {
Fl_Browser template_browser {
@@ -120,7 +120,8 @@ if (img) {
xywh {10 28 180 250} type Hold labelfont 1 align 5 when 3
}
Fl_Box template_preview {
- xywh {200 28 250 250} box THIN_DOWN_BOX align 85 resizable
+ label {no preview...} selected
+ xywh {200 28 250 250} box THIN_DOWN_BOX align 80 resizable
}
Fl_Input template_name {
label {Template Name:}
@@ -134,7 +135,7 @@ if (img) {
label {Instance Name:}
xywh {198 288 252 25} labelfont 1 textfont 4 hide
}
- Fl_Group {} {
+ Fl_Group {} {open
xywh {10 323 440 25}
} {
Fl_Button template_delete {
@@ -217,7 +218,7 @@ strlcat(path, "templates", sizeof(path));
int sample_templates_generated = 0;
fluid_prefs.get("sample_templates_generated", sample_templates_generated, 0);
-if (!sample_templates_generated) {
+if (sample_templates_generated < 2) {
strcpy(filename, path);
strcat(filename, "/FLTK_License.fl");
FILE *f = fopen(filename, "wb");
@@ -233,7 +234,23 @@ if (!sample_templates_generated) {
"er\\n}\\n", f);
fclose(f);
}
- sample_templates_generated = 1;
+ strcpy(filename, path);
+ strcat(filename, "/1of7GUIs.fl");
+ f = fopen(filename, "wb");
+ if (f) {
+ fputs(
+"\# data file for the Fltk User Interface Designer (fluid)\\n version 1.0400\\n header_name {.h}\\n"
+"code_name {.cxx}\\n comment {\\n1 of 7GUIs\\n\\n7GUIs was been created as a spin-off of the master’s\\n"
+"thesis Comparison of Object-Oriented and Functional\\nProgramming for GUI Development by Eugen Kiss at the\\n"
+"Human-Computer Interaction group of the Leibniz\\nUniversität Hannover in 2014.\\n\\n"
+"https://7guis.github.io/7guis/\\n} {selected in_source not_in_header\\n}\\n\\nFunction {} {open\\n"
+"} {\\nFl_Window {} {\\nlabel Counter open\\nxywh {486 292 194 55} type Double resizable visible\\n"
+"} {\\nFl_Output counter_widget {\\nxywh {15 15 80 22}\\ncode0 {counter_widget->value(0);}\\n"
+"}\\nFl_Button {} {\\nlabel Count\\ncallback {int i = counter_widget->ivalue();\\ni++;\\n"
+"counter_widget->value(i);}\\nxywh {99 15 80 22}\\n}\\n}\\n}\\n", f);
+ fclose(f);
+ }
+ sample_templates_generated = 2;
fluid_prefs.set("sample_templates_generated", sample_templates_generated);
fluid_prefs.flush();
}
@@ -259,6 +276,5 @@ for (i = 0; i < num_files; i ++) {
free(files[i]);
}
-if (num_files > 0) free(files);} {selected
- }
+if (num_files > 0) free(files);} {}
}