summaryrefslogtreecommitdiff
path: root/textscreen/examples
diff options
context:
space:
mode:
authorSimon Howard2013-03-31 18:46:25 +0000
committerSimon Howard2013-03-31 18:46:25 +0000
commit3ac144025a055a3b85c1f4b2ef05b6f2892788f5 (patch)
tree7b8bb16691ac21ec3ff1c1a414dd28b25edb1319 /textscreen/examples
parentadbfa3216cf3ef6f71cc5b6b22c25a04ae737212 (diff)
downloadchocolate-doom-3ac144025a055a3b85c1f4b2ef05b6f2892788f5.tar.gz
chocolate-doom-3ac144025a055a3b85c1f4b2ef05b6f2892788f5.tar.bz2
chocolate-doom-3ac144025a055a3b85c1f4b2ef05b6f2892788f5.zip
Add file selector widget to textscreen library.
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2570
Diffstat (limited to 'textscreen/examples')
-rw-r--r--textscreen/examples/guitest.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/textscreen/examples/guitest.c b/textscreen/examples/guitest.c
index a5aad93f..08faae98 100644
--- a/textscreen/examples/guitest.c
+++ b/textscreen/examples/guitest.c
@@ -39,10 +39,13 @@ enum
RADIO_VALUE_MUSHROOM,
RADIO_VALUE_SNAKE,
};
+char *extensions[] = { "wad", "lmp", "txt", NULL };
char *radio_values[] = { "Badger", "Mushroom", "Snake" };
char *textbox_value = NULL;
int numbox_value = 0;
int radiobutton_value;
+char *file_path = NULL;
+char *dir_path = NULL;
txt_label_t *value_label;
txt_window_t *firstwin;
int cheesy;
@@ -187,12 +190,20 @@ void Window2(void)
TXT_AddWidget(window, TXT_NewSeparator("Input boxes"));
table = TXT_NewTable(2);
TXT_AddWidget(window, table);
- TXT_AddWidget(table, TXT_NewLabel("String: "));
- TXT_AddWidget(table, TXT_NewInputBox(&textbox_value, 20));
- TXT_AddWidget(table, TXT_NewLabel("Int: "));
- TXT_AddWidget(table, TXT_NewIntInputBox(&numbox_value, 10));
- TXT_AddWidget(table, TXT_NewLabel("Spin control:"));
- TXT_AddWidget(table, TXT_NewSpinControl(&numbox_value, 0, 15));
+ TXT_AddWidgets(table,
+ TXT_NewLabel("String: "),
+ TXT_NewInputBox(&textbox_value, 20),
+ TXT_NewLabel("Int: "),
+ TXT_NewIntInputBox(&numbox_value, 10),
+ TXT_NewLabel("Spin control:"),
+ TXT_NewSpinControl(&numbox_value, 0, 15),
+ TXT_NewLabel("File:"),
+ TXT_NewFileSelector(&file_path, 28, "Select file:",
+ extensions),
+ TXT_NewLabel("Directory:"),
+ TXT_NewFileSelector(&dir_path, 28, "Select directory:",
+ TXT_DIRECTORY),
+ NULL);
TXT_AddWidget(window, TXT_NewSeparator("Scroll pane test"));
scrollpane = TXT_NewScrollPane(40, 5, TXT_NewLabel(