net: minor improvements in tcp client sockets
[quarnos.git] / hydra / test.cpp
blob245fcbf6dc0a965338643420c087580d9f571dda
1 #include "hydra.h"
2 #include "ui.h"
3 #include "form.h"
4 #include "label.h"
5 #include "edit.h"
7 class test : public hydra::application {
8 public:
9 void init();
10 void onedit(hydra::form*);
13 hydra_app_class(test)
15 void test::onedit(hydra::form* a) {
16 delegate<void,hydra::form*>bl;
17 hydra::form *fr = new hydra::form(this, bl);
18 new hydra::label(fr, ((hydra::edit*)a->get_element("edit1"))->get_value(), "label3");
21 void test::init() {
22 set_ui(hydra::ui::ui_console);
23 delegate<void,hydra::form*>bl;
24 bl.method(this, &test::onedit);
26 hydra::form *fr = new hydra::form(this, bl);
27 new hydra::label(fr, "Hydra Sample #1:\nHello World\nEnter data: ", "label1");
28 hydra::edit *ed = new hydra::edit(fr, "edit1");
29 new hydra::label(fr, "OK, data received: ", "label2");
30 new hydra::label(fr, ed->value, "label4");