summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2006-05-20 21:37:07 +0000
committerSimon Howard2006-05-20 21:37:07 +0000
commit1df732ab78cb0ff08104e67dedf57cbd1d176f28 (patch)
tree381d649147a59f82abd0eca8bf5f47235ae1358e
parent27307fa2d7cca6081fa16ecc01e0c3977b58c088 (diff)
downloadchocolate-doom-1df732ab78cb0ff08104e67dedf57cbd1d176f28.tar.gz
chocolate-doom-1df732ab78cb0ff08104e67dedf57cbd1d176f28.tar.bz2
chocolate-doom-1df732ab78cb0ff08104e67dedf57cbd1d176f28.zip
Updated guitest.
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 495
-rw-r--r--textscreen/guitest.c55
1 files changed, 40 insertions, 15 deletions
diff --git a/textscreen/guitest.c b/textscreen/guitest.c
index 66f2a363..43fae098 100644
--- a/textscreen/guitest.c
+++ b/textscreen/guitest.c
@@ -3,41 +3,46 @@
#include "txt_main.h"
+#include "txt_checkbox.h"
#include "txt_button.h"
#include "txt_desktop.h"
#include "txt_separator.h"
+#include "txt_table.h"
#include "txt_window.h"
txt_window_t *firstwin;
+int checkbox_value;
void SetupWindow(void)
{
txt_window_t *window;
+ txt_table_t *table;
char buf[100];
int i;
window = TXT_NewWindow("Window test");
- strcpy(buf, "This is a button label: ");
+ table = TXT_NewTable(3);
- TXT_AddWidget(window, TXT_NewSeparator("Main Section"));
+ TXT_AddWidget(window, TXT_NewLabel(" This is a multiline label.\n"
+ " A single label object contains \n"
+ " all three of these lines.\n"));
- for (i=0; i<8; ++i)
- {
- strcat(buf, "a");
- TXT_AddWidget(window, TXT_NewButton(buf));
+ TXT_AddWidget(window, table);
- if (i == 4)
- {
- TXT_AddWidget(window, TXT_NewSeparator("Section"));
- }
-
- if (i == 6)
- {
- TXT_AddWidget(window, TXT_NewSeparator(NULL));
- }
+ for (i=0; i<5; ++i)
+ {
+ sprintf(buf, " Option %i in a table:", i + 1);
+ TXT_AddWidget(table, TXT_NewLabel(buf));
+ sprintf(buf, "Button %i-1", i + 1);
+ TXT_AddWidget(table, TXT_NewButton(buf));
+ sprintf(buf, "Button %i-2", i + 1);
+ TXT_AddWidget(table, TXT_NewButton(buf));
}
+ TXT_AddWidget(window, TXT_NewLabel(""));
+ TXT_AddWidget(window, TXT_NewCheckBox("Checkbox", &checkbox_value));
+
firstwin = window;
}
@@ -58,9 +63,29 @@ void Window2(void)
}
}
+void DrawASCIIChart()
+{
+ int x, y;
+
+ TXT_ClearScreen();
+
+ for (y=0; y<16; ++y)
+ {
+ for (x=0; x<16; ++x)
+ {
+ TXT_PutChar(' ');
+ TXT_PutChar(' ');
+ TXT_PutChar(' ');
+ TXT_PutChar(y * 16 + x);
+ }
+ TXT_PutChar('\n');
+ }
+}
+
int main()
{
TXT_Init();
+
TXT_SetDesktopTitle("Not Chocolate Doom Setup");
Window2();