summaryrefslogtreecommitdiff
path: root/textscreen/examples
diff options
context:
space:
mode:
authorSimon Howard2009-01-29 22:54:13 +0000
committerSimon Howard2009-01-29 22:54:13 +0000
commit5a122d591e8fdecd767f12e93f13974cfc86f75a (patch)
tree6bde3cbb3a8db2f6c18495248877306ce2744d02 /textscreen/examples
parent63c1c6e6dbf7058c162b01a066759bb7b507af45 (diff)
downloadchocolate-doom-5a122d591e8fdecd767f12e93f13974cfc86f75a.tar.gz
chocolate-doom-5a122d591e8fdecd767f12e93f13974cfc86f75a.tar.bz2
chocolate-doom-5a122d591e8fdecd767f12e93f13974cfc86f75a.zip
Add scrollable pane widget to textscreen library.
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1437
Diffstat (limited to 'textscreen/examples')
-rw-r--r--textscreen/examples/guitest.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/textscreen/examples/guitest.c b/textscreen/examples/guitest.c
index 94483236..2a4d78cb 100644
--- a/textscreen/examples/guitest.c
+++ b/textscreen/examples/guitest.c
@@ -119,7 +119,7 @@ void SetupWindow(void)
}
UpdateLabel(NULL, NULL);
-
+
TXT_AddWidget(window, TXT_NewButton2("Close Window", CloseWindow, NULL));
pwn = TXT_NewWindowAction(KEY_F1, "PWN!");
@@ -133,8 +133,9 @@ void Window2(void)
{
txt_window_t *window;
txt_table_t *table;
+ txt_scrollpane_t *scrollpane;
int i;
-
+
window = TXT_NewWindow("Another test");
TXT_SetWindowPosition(window,
TXT_HORIZ_RIGHT,
@@ -155,6 +156,22 @@ void Window2(void)
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_AddWidget(window, TXT_NewSeparator("Scroll pane test"));
+ scrollpane = TXT_NewScrollPane(40, 5, TXT_NewLabel(
+ "This is a scrollable pane. The contents\n"
+ "of this box are larger than the box\n"
+ "itself, but it can be scrolled around\n"
+ "to explore the full contents.\n"
+ "\n"
+ "Scrollable panes can be scrolled both\n"
+ "vertically and horizontally. They\n"
+ "can contain any widget. The scroll bars\n"
+ "appear automatically as needed.\n"
+ "\n"
+ "This is a very long line of text that forces a horizontal scrollbar"
+ ));
+ TXT_AddWidget(window, scrollpane);
}
int main(int argc, char *argv[])