UpdaterWindow::UpdaterWindow(Connection* _con) : agui::Window("Lobby connection"), agreement(NULL), con(_con) { agui::gui->AddElement(this); SetPos(0.5, 0.5); SetSize(0.4, 0.3); agui::VerticalLayout* wndLayout = new agui::VerticalLayout(this); label = new agui::TextElement("", wndLayout); agui::HorizontalLayout* usrLayout = new agui::HorizontalLayout(wndLayout); new agui::TextElement(std::string("Username:"******"name")); user->SetWeight(2); agui::HorizontalLayout* pwdLayout = new agui::HorizontalLayout(wndLayout); new agui::TextElement(std::string("Password:"******"Login", bttnLayout); login->Clicked.connect(boost::bind(&UpdaterWindow::Login, this)); agui::Button* registerb = new agui::Button("Register", bttnLayout); registerb->Clicked.connect(boost::bind(&UpdaterWindow::Register, this)); agui::Button* close = new agui::Button("Close", bttnLayout); close->Clicked.connect(WantClose); serverLabel = new agui::TextElement(std::string("Connecting..."), wndLayout); GeometryChange(); }
void GuiElement::SetSize(float x, float y, bool fixed) { size[0] = x; size[1] = y; fixedSize = fixed; GeometryChange(); }
void GuiElement::AddChild(GuiElement* elem) { children.push_back(elem); elem->SetPos(pos[0], pos[1]); elem->SetSize(size[0], size[1]); GeometryChange(); }
void GuiElement::SetPos(float x, float y) { pos[0] = x; pos[1] = y; GeometryChange(); }