int main(const std::vector<std::string> &args) { ConsoleWindow console("Console"); try { DisplayCache resources; resources.load("../../../Resources/GUIThemeLuna/resources.xml"); GUIManager gui; GUIWindowManagerSystem wm; gui.set_window_manager(wm); GUIThemeDefault theme; theme.set_resources(resources); gui.set_theme(theme); gui.set_css_document("../../../Resources/GUIThemeLuna/theme.css"); DisplayWindowDescription win_desc; win_desc.set_allow_resize(true); win_desc.set_title("CheckBox test app."); win_desc.set_position(Rect(200,200,600,600), false); Window root(&gui, win_desc); root.func_close().set(this, &App::on_close, &root); CheckBox checkbox1(&root); checkbox1.set_geometry(Rect(20, 20, 200, 40)); checkbox1.set_text("CheckBox 1"); gui.exec(); } catch (Exception e) { Console::write_line(e.message); console.display_close_message(); } return 0; }
int main(const std::vector<std::string> &args) { ConsoleWindow console("Console"); try { DisplayCache resources; resources.load("../../../Resources/GUIThemeLuna/resources.xml"); GUIManager gui; GUIWindowManagerSystem wm; gui.set_window_manager(wm); GUIThemeDefault theme; theme.set_resources(resources); gui.set_theme(theme); gui.set_css_document("../../../Resources/GUIThemeLuna/theme.css"); DisplayWindowDescription win_desc; win_desc.set_allow_resize(true); win_desc.set_title("Label test app."); win_desc.set_position(Rect(200,200,600,700), false); Window root(&gui, win_desc); root.func_close().set(this, &App::on_close, &root); Tab tab(&root); tab.set_geometry(Rect(Point(50,20),Size(280,360))); // tab 1 TabPage *tab_page_1 = tab.add_page("foo"); //tab_page_1->set_geometry(Rect(Point(0,0),Size(230,300))); //tab.add_page("foo", "foo", &tab_page_1); Label label_p1(tab_page_1); label_p1.set_geometry(Rect(Point(10,10),Size(130,20))); label_p1.set_text("tab page 1"); PushButton btn_p1(tab_page_1); btn_p1.set_geometry(Rect(Point(10,30),Size(130,20))); btn_p1.set_text("Button Foo"); // tab 2 TabPage *tab_page_2 = tab.add_page("bar"); //tab_page_2->set_geometry(Rect(Point(0,0),Size(230,300))); //tab.add_page("bar", "tab with really long name", &tab_page_2); Label label_p2(tab_page_2); label_p2.set_geometry(Rect(Point(10,10),Size(130,20))); label_p2.set_text("tab page 2"); PushButton btn_p2(tab_page_2); btn_p2.set_geometry(Rect(Point(10,30),Size(80,26))); btn_p2.set_text("Button Bar"); // tab 3 TabPage *tab_page_3 = tab.add_page("p3"); //tab_page_3->set_geometry(Rect(Point(0,0),Size(230,300))); //tab.add_page("p3", "p3", &tab_page_3); gui.exec(); } catch (Exception e) { Console::write_line(e.message); console.display_close_message(); } return 0; }