aboutsummaryrefslogtreecommitdiff
path: root/bin/tests/test_gui.cpp
diff options
context:
space:
mode:
authorHubert Jarosz2016-03-09 00:00:52 +0100
committerHubert Jarosz2016-03-09 00:00:52 +0100
commit4a4f2479146aa33e235ed57cde311efda68d3c8f (patch)
treecf91f2869ff8f058c6682569fb31e22e5ee736ad /bin/tests/test_gui.cpp
parent1dad6eca812e5c2e313b54265114de8a1d73d999 (diff)
downloadgodot-4a4f2479146aa33e235ed57cde311efda68d3c8f.tar.gz
godot-4a4f2479146aa33e235ed57cde311efda68d3c8f.tar.zst
godot-4a4f2479146aa33e235ed57cde311efda68d3c8f.zip
Diffstat (limited to 'bin/tests/test_gui.cpp')
-rw-r--r--bin/tests/test_gui.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/bin/tests/test_gui.cpp b/bin/tests/test_gui.cpp
index cba488a3d..f4341fd7b 100644
--- a/bin/tests/test_gui.cpp
+++ b/bin/tests/test_gui.cpp
@@ -62,16 +62,16 @@ class TestMainLoop : public SceneTree {
Control *control;
-
+
public:
virtual void request_quit() {
-
+
quit();
-
+
}
virtual void init() {
-
+
SceneTree::init();
@@ -112,7 +112,7 @@ public:
Ref<Theme> t = memnew( Theme );
frame->set_theme(t);
-
+
get_root()->add_child( frame );
Label *label = memnew( Label );
@@ -198,21 +198,21 @@ public:
//root->add_child( control );
-
+
LineEdit *line_edit = memnew( LineEdit );
-
+
line_edit->set_pos( Point2( 30,190 ) );
line_edit->set_size( Point2( 180,1 ) );
-
+
frame->add_child(line_edit);
-
+
HScrollBar *hscroll = memnew( HScrollBar );
-
+
hscroll->set_pos( Point2( 30,290 ) );
hscroll->set_size( Point2( 180,1 ) );
hscroll->set_max(10);
hscroll->set_page(4);
-
+
frame->add_child(hscroll);
@@ -234,36 +234,36 @@ public:
hscroll->share(progress);
MenuButton *menu_button = memnew( MenuButton );
-
+
menu_button->set_text("I'm a menu!");
menu_button->set_pos( Point2( 30,380 ) );
menu_button->set_size( Point2( 1,1 ) );
-
- frame->add_child(menu_button);
-
+
+ frame->add_child(menu_button);
+
PopupMenu *popup = menu_button->get_popup();
-
+
popup->add_item("Hello, testing");
popup->add_item("My Dearest");
popup->add_separator();
popup->add_item("Popup");
popup->add_check_item("Check Popup");
- popup->set_item_checked(4,true);
-
+ popup->set_item_checked(4,true);
+
OptionButton *options = memnew( OptionButton );
-
+
options->add_item("Hello, testing");
options->add_item("My Dearest");
-
+
options->set_pos( Point2( 230,180 ) );
options->set_size( Point2( 1,1 ) );
-
- frame->add_child(options);
+
+ frame->add_child(options);
/*
Tree * tree = memnew( Tree );
tree->set_columns(2);
-
+
tree->set_pos( Point2( 230,210 ) );
tree->set_size( Point2( 150,250 ) );
@@ -286,7 +286,7 @@ public:
item->set_editable(0,true);
item->set_text(0,"Have,Many,Several,Options!");
item->set_range(0,2);
-
+
frame->add_child(tree);
*/
@@ -365,11 +365,11 @@ public:
tabc->add_child(ctl);
frame->add_child(tabc);
-
+
tabc->set_pos( Point2( 400,210 ) );
tabc->set_size( Point2( 180,250 ) );
-
+
Ref<ImageTexture> text = memnew( ImageTexture );
text->load("test_data/concave.png");
@@ -387,13 +387,13 @@ public:
}
-
+
};
MainLoop* test() {
-
+
return memnew( TestMainLoop );
}