};
};
+style "label-title"
+{
+ font_color 0 0 0;
+ part "text"
+ {
+ align 0.5 1.0;
+ fill 0.0 0.0;
+ margin { bottom 5; };
+ };
+};
+
style "image"
{
part "image"
{
texture "gui.png";
slice 50 93 20 10;
- border { top 2; right 2; bottom 2; left 2; };
+ border { horizontal 2; vertical 2; };
};
style "label-tooltip"
{
align 0.0 0.5;
fill 0.0 0.0;
- margin { top 2; right 2; bottom 2; left 2; };
+ margin { horizontal 2; vertical 2; };
};
};
graphic ACTIVE "grey_button_pressed";
align 0.5 0.0;
fill 0.0 0.0;
+ margin { horizontal 5; };
};
part "text"
{
align 0.5 1.0;
fill 0.0 0.0;
+ margin { bottom 10; };
};
};
graphic ACTIVE "green_button_pressed";
align 0.5 0.0;
fill 0.0 0.0;
+ margin { horizontal 5; };
};
part "text"
{
align 0.5 1.0;
fill 0.0 0.0;
+ margin { bottom 10; };
};
};
graphic ACTIVE "red_button_pressed";
align 0.5 0.0;
fill 0.0 0.0;
+ margin { horizontal 5; };
};
part "text"
{
align 0.5 1.0;
fill 0.0 0.0;
+ margin { bottom 10; };
};
};
{
texture "gui.png";
slice 2 74 24 16;
- border { top 4; right 4; bottom 4; left 4; };
+ border { horizontal 4; vertical 4; };
};
style "panel"
{
texture "gui.png";
slice 2 110 24 16;
- border { top 4; right 4; bottom 4; left 4; };
+ border { horizontal 4; vertical 4; };
};
style "label-digital"
{
texture "gui.png";
slice 2 92 24 16;
- border { top 4; right 4; bottom 4; left 4; };
+ border { horizontal 4; vertical 4; };
};
graphic "cursor"
{
align 0.0 0.5;
fill 0.0 0.0;
- margin { left 3; right 3; };
+ margin { horizontal 3; vertical 2; };
};
part "cursor"
{
align 0.0 1.0;
fill 0.0 0.0;
- margin { top 2; right 13; left 3; bottom 2; };
+ margin { vertical 2; right 13; left 3; };
};
part "cursor"
align 1.0 0.0;
fill 0.0 1.0;
size 10 0;
- margin { top 3; right 2; bottom 3; };
+ margin { vertical 3; right 2; };
};
};
{
texture "gui.png";
slice 44 81 20 10;
- border { top 4; right 4; bottom 4; left 4; };
+ border { horizontal 4; vertical 4; };
};
style "list"
{
graphic NORMAL "selection";
fill 1.0 1.0;
- margin { top 2; right 13; bottom 2; left 2; };
+ margin { vertical 2; right 13; left 2; };
};
part "items"
{
- margin { top 2; right 13; bottom 2; left 2; };
+ margin { vertical 2; right 13; left 2; };
};
part "slider"
align 1.0 0.0;
fill 0.0 1.0;
size 10 0;
- margin { top 3; right 2; bottom 3; };
+ margin { vertical 3; right 2; };
};
};
{
align 0.0 0.5;
fill 0.0 0.0;
- margin { left 2; };
+ margin { vertical 2; left 3; right 17; };
};
part "list";
{
texture "gui.png";
slice 32 97 12 2;
- border { left 1; right 1; };
+ border { horizontal 1; };
};
graphic "horizontal_knob"
graphic NORMAL "horizontal_slot";
align 0.5 0.5;
fill 1.0 0.0;
- margin { left 4; right 4; };
+ margin { horizontal 4; };
};
part "slider"
{
texture "gui.png";
slice 32 75 2 12;
- border { top 1; bottom 1; };
+ border { vertical 1; };
};
graphic "vertical_knob"
graphic NORMAL "vertical_slot";
align 0.5 0.5;
fill 0.0 1.0;
- margin { top 4; bottom 4; };
+ margin { vertical 4; };
};
part "slider"
mouse.signal_button_press.connect(sigc::bind_return(sigc::mem_fun(this, &Designer::button_press), false));
mouse.signal_axis_motion.connect(sigc::bind_return(sigc::mem_fun(this, &Designer::axis_motion), false));
root.signal_tooltip.connect(sigc::mem_fun(this, &Designer::tooltip));
+ root_layout = new GLtk::Layout;
+ root_layout->set_margin(0);
+ root.set_layout(root_layout);
toolbars.push_back(new Layoutbar(*this));
toolbars.push_back(new Trackbar(*this));
toolbars.push_back(new Routebar(*this));
toolbars.push_back(new Zonebar(*this));
+ Toolbar *prev = 0;
for(vector<Toolbar *>::iterator i=toolbars.begin(); i!=toolbars.end(); ++i)
{
root.add(**i);
if(i!=toolbars.begin())
(*i)->expand(false);
- (*i)->signal_expanded.connect(sigc::hide(sigc::mem_fun(this, &Designer::arrange_toolbars)));
+ (*i)->signal_expanded.connect(sigc::hide(sigc::mem_fun(root_layout, &GLtk::Layout::update)));
+ if(prev)
+ {
+ root_layout->add_constraint(**i, GLtk::Layout::RIGHT_OF, *prev, 0);
+ root_layout->add_constraint(**i, GLtk::Layout::COPY_HEIGHT, *prev);
+ }
+ prev = *i;
}
- arrange_toolbars();
GLtk::Panel *statusbar = new GLtk::Panel;
root.add(*statusbar);
- statusbar->set_size(window.get_width(), 20);
statusbar->set_focusable(false);
+ root_layout->set_gravity(*statusbar, -1, -1);
+ root_layout->set_expand(*statusbar, true, false);
lbl_status = new GLtk::Label;
statusbar->add(*lbl_status);
{
InputDialog *input = new InputDialog(*this, "Save layout", filename);
input->signal_accept.connect(sigc::mem_fun(layout, &Layout::save));
+ root.add(*input);
+ root_layout->set_gravity(*input, 0, 0);
}
void Designer::quit()
TrackProperties *track_prop = new TrackProperties(selection);
root.add(*track_prop);
- const GLtk::Geometry &root_geom = root.get_geometry();
- const GLtk::Geometry &dlg_geom = track_prop->get_geometry();
- track_prop->set_position((root_geom.w-dlg_geom.w)/2, (root_geom.h-dlg_geom.h)/2);
+ root_layout->set_gravity(*track_prop, 0, 0);
track_prop->signal_response.connect(sigc::mem_fun(this, &Designer::track_properties_response));
}
{
InputDialog *input = new InputDialog(*this, "SVG export", FS::basepart(filename)+".svg");
input->signal_accept.connect(sigc::mem_fun(this, &Designer::svg_export_accept));
+ root.add(*input);
+ root_layout->set_gravity(*input, 0, 0);
}
void Designer::edit_route(Route *r)
InputDialog *input = new InputDialog(*this, "Route name", cur_route->get_name());
input->signal_accept.connect(sigc::mem_fun(this, &Designer::route_name_accept));
+ root.add(*input);
+ root_layout->set_gravity(*input, 0, 0);
}
void Designer::add_selection_to_route()
selection_changed();
}
-void Designer::arrange_toolbars()
-{
- unsigned x = 0;
- for(vector<Toolbar *>::iterator i=toolbars.begin(); i!=toolbars.end(); ++i)
- {
- const GLtk::Geometry &geom = (*i)->get_geometry();
- (*i)->set_position(x, window.get_height()-geom.h);
- x += geom.w;
- }
-}
-
void Designer::track_properties_response(int)
{
const set<Track *> &tracks = selection.get_objects<Track>();
string Designer::tooltip(int x, int y)
{
- if(Object *obj = pick_object(Vector(x*2.0f/window.get_width()-1.0f, y*2.0f/window.get_height()-1.0f, 0)))
+ const GLtk::Geometry &rgeom = root.get_geometry();
+ if(Object *obj = pick_object(Vector(x*2.0f/rgeom.w-1.0f, y*2.0f/rgeom.h-1.0f, 0)))
{
const ObjectType &otype = obj->get_type();
string info = format("%d %s", otype.get_article_number(), otype.get_description());
#include <msp/gl/object.h>
#include <msp/gl/pipeline.h>
#include <msp/gltk/label.h>
+#include <msp/gltk/layout.h>
#include <msp/gltk/resources.h>
#include <msp/gltk/root.h>
#include <msp/time/timestamp.h>
Msp::Input::Mouse mouse;
Msp::GLtk::Resources ui_res;
Msp::GLtk::Root root;
+ Msp::GLtk::Layout *root_layout;
std::vector<Toolbar *> toolbars;
Msp::GLtk::Label *lbl_status;
R2C2::Layout &get_layout() { return *layout; }
R2C2::Layout3D &get_layout_3d() { return *layout_3d; }
const CameraController &get_camera_controller() const { return *camera_ctl; }
- const Msp::GLtk::Resources &get_ui_resources() const { return ui_res; }
- Msp::GLtk::Root &get_root() { return root; }
void new_track();
void erase_tracks();
void manipulation_done(bool);
void measure_changed();
void measure_done();
- void arrange_toolbars();
void track_properties_response(int);
void route_name_accept(const std::string &);
void svg_export_accept(const std::string &);
#include <GL/gl.h>
#include <msp/gl/texture.h>
#include <msp/gltk/button.h>
+#include <msp/gltk/mixedrows.h>
#include <msp/input/keys.h>
#include "designer.h"
#include "input.h"
InputDialog::InputDialog(Designer &d, const string &title, const string &text):
designer(d)
{
- set_size(300, 100);
+ GLtk::MixedRows *rows = new GLtk::MixedRows;
+ set_layout(rows);
GLtk::Label *lbl;
add(*(lbl=new GLtk::Label(title)));
- lbl->set_geometry(GLtk::Geometry(10, geom.h-30, geom.w-20, 20));
+ layout->set_expand(*lbl, true, false);
+ lbl->set_style("title");
+ rows->start_row();
add(*(entry=new GLtk::Entry(text)));
- entry->set_geometry(GLtk::Geometry(10, geom.h-60, geom.w-20, 20));
+ entry->set_edit_size(60, 1);
GLtk::Button *btn;
+ rows->start_row();
+ rows->split_columns();
add_button(*(btn=new GLtk::Button("Cncl")), 0);
- btn->set_geometry(GLtk::Geometry(geom.w-90, 10, 40, 24));
btn->set_style("red");
add_button(*(btn=new GLtk::Button("OK")), 1);
- btn->set_geometry(GLtk::Geometry(geom.w-50, 10, 40, 24));
btn->set_style("green");
- designer.get_root().add(*this);
- const GLtk::Geometry &rgeom=designer.get_root().get_geometry();
- set_position((rgeom.w-geom.w)/2, (rgeom.h-geom.h)/2);
entry->set_focus();
}
using namespace Msp;
Layoutbar::Layoutbar(Designer &designer):
- Toolbar("Layout", 160)
+ Toolbar("Layout")
{
GLtk::Button *btn;
pnl_content->add(*(btn = new GLtk::Button("Load")));
- btn->set_geometry(GLtk::Geometry(0, 10, 40, 24));
btn->set_tooltip("Load layout (not implemented)");
pnl_content->add(*(btn = new GLtk::Button("Save")));
- btn->set_geometry(GLtk::Geometry(40, 10, 40, 24));
btn->set_tooltip("Save current layout (W)");
btn->signal_clicked.connect(sigc::mem_fun(&designer, &Designer::save));
pnl_content->add(*(btn = new GLtk::Button("SVG")));
- btn->set_geometry(GLtk::Geometry(80, 10, 40, 24));
btn->set_tooltip("Export layout as SVG (V)");
btn->signal_clicked.connect(sigc::mem_fun(&designer, &Designer::svg_export));
pnl_content->add(*(btn = new GLtk::Button("Quit")));
- btn->set_geometry(GLtk::Geometry(120, 10, 40, 24));
btn->set_style("red");
btn->set_tooltip("Exit Designer");
btn->signal_clicked.connect(sigc::mem_fun(&designer, &Designer::quit));
using namespace R2C2;
Routebar::Routebar(Designer &d):
- Toolbar("Route", 370),
+ Toolbar("Route"),
designer(d)
{
pnl_content->add(*(drp_routes = new GLtk::Dropdown));
- drp_routes->set_geometry(GLtk::Geometry(0, 10, 250, 20));
drp_routes->set_tooltip("Select route to edit");
drp_routes->append("(new route)");
drp_routes->signal_item_selected.connect(sigc::mem_fun(this, &Routebar::route_selected));
GLtk::Button *btn;
pnl_content->add(*(btn = new GLtk::Button("Del")));
- btn->set_geometry(GLtk::Geometry(250, 10, 40, 24));
btn->set_style("red");
btn->set_tooltip("Delete the current route");
btn->signal_clicked.connect(sigc::mem_fun(this, &Routebar::delete_route_clicked));
pnl_content->add(*(btn = new GLtk::Button("Name")));
- btn->set_geometry(GLtk::Geometry(290, 10, 40, 24));
btn->set_tooltip("Rename the current route");
btn->signal_clicked.connect(sigc::mem_fun(&designer, &Designer::rename_route));
pnl_content->add(*(btn = new GLtk::Button("Add")));
- btn->set_geometry(GLtk::Geometry(330, 10, 40, 24));
btn->set_tooltip("Add selected tracks to current route (A)");
btn->signal_clicked.connect(sigc::mem_fun(&designer, &Designer::add_selection_to_route));
+#include <msp/gltk/row.h>
#include "toolbar.h"
using namespace std;
using namespace Msp;
-Toolbar::Toolbar(const string &name, unsigned w):
- content_width(w),
+Toolbar::Toolbar(const string &name):
expanded(true)
{
set_focusable(false);
+ set_layout(new GLtk::Row);
+ layout->set_margin(GLtk::Sides(6, 10));
+ layout->set_column_spacing(10);
add(*(lbl_title = new GLtk::Label(name)));
add(*(btn_expand = new GLtk::Button));
- btn_expand->set_size(15, 20);
btn_expand->set_style("arrow_left");
btn_expand->set_tooltip("Collapse toolbar");
btn_expand->signal_clicked.connect(sigc::mem_fun(this, &Toolbar::expand_clicked));
add(*(pnl_content = new GLtk::Panel));
- pnl_content->set_size(content_width, 40);
pnl_content->set_style("group");
+ GLtk::Layout *content_layout = new GLtk::Row;
+ pnl_content->set_layout(content_layout);
+ content_layout->set_margin(0);
}
void Toolbar::expand(bool e)
btn_expand->set_style(expanded ? "arrow_left" : "arrow_right");
btn_expand->set_tooltip(expanded ? "Collapse toolbar" : "Expand toolbar");
pnl_content->set_visible(expanded);
-
- unsigned w = lbl_title->get_geometry().w+40;
- if(expanded)
- w += content_width+5;
- set_size(w, 40);
+ signal_autosize_changed.emit();
signal_expanded.emit(expanded);
}
{
expand(!expanded);
}
-
-void Toolbar::on_style_change()
-{
- lbl_title->autosize();
- const GLtk::Geometry &lbl_geom = lbl_title->get_geometry();
- unsigned w = lbl_geom.w+40;
- if(expanded)
- w += content_width+5;
- set_size(w, 40);
-
- lbl_title->set_position(10, (geom.h-lbl_geom.h)/2);
- btn_expand->set_position(lbl_geom.w+15, 10);
- pnl_content->set_position(lbl_geom.w+35, 0);
-}
sigc::signal<void, bool> signal_expanded;
private:
- unsigned content_width;
Msp::GLtk::Label *lbl_title;
Msp::GLtk::Button *btn_expand;
bool expanded;
protected:
Msp::GLtk::Panel *pnl_content;
- Toolbar(const std::string &, unsigned);
+ Toolbar(const std::string &);
public:
void expand(bool);
private:
void expand_clicked();
- virtual void on_style_change();
};
#endif
using namespace Msp;
Trackbar::Trackbar(Designer &designer):
- Toolbar("Track", 240)
+ Toolbar("Track")
{
GLtk::Button *btn;
pnl_content->add(*(btn = new GLtk::Button("New")));
- btn->set_geometry(GLtk::Geometry(0, 10, 40, 24));
btn->set_style("green");
btn->set_tooltip("Add a track piece (N)");
btn->signal_clicked.connect(sigc::mem_fun(&designer, &Designer::new_track));
pnl_content->add(*(btn = new GLtk::Button("Del")));
- btn->set_geometry(GLtk::Geometry(40, 10, 40, 24));
btn->set_style("red");
btn->set_tooltip("Delete selected tracks (X)");
btn->signal_clicked.connect(sigc::mem_fun(&designer, &Designer::erase_tracks));
pnl_content->add(*(btn = new GLtk::Button("Prop")));
- btn->set_geometry(GLtk::Geometry(80, 10, 40, 24));
btn->set_tooltip("Change properties of selected tracks (P)");
btn->signal_clicked.connect(sigc::mem_fun(&designer, &Designer::track_properties));
pnl_content->add(*(btn = new GLtk::Button("Xtnd")));
- btn->set_geometry(GLtk::Geometry(120, 10, 40, 24));
btn->set_tooltip("Extend straight track out of free endpoint (Shift+N)");
btn->signal_clicked.connect(sigc::mem_fun(&designer, &Designer::extend_track));
pnl_content->add(*(btn = new GLtk::Button("Conn")));
- btn->set_geometry(GLtk::Geometry(160, 10, 40, 24));
btn->set_tooltip("Connect free endpoints of selected tracks (C)");
btn->signal_clicked.connect(sigc::mem_fun(&designer, &Designer::connect_tracks));
pnl_content->add(*(btn = new GLtk::Button("Flat")));
- btn->set_geometry(GLtk::Geometry(200, 10, 40, 24));
btn->set_tooltip("Make selected tracks flat (F)");
btn->signal_clicked.connect(sigc::mem_fun(&designer, &Designer::flatten_tracks));
}
#include <msp/gltk/button.h>
#include <msp/gltk/label.h>
+#include <msp/gltk/mixedrows.h>
#include "libr2c2/track.h"
#include "libr2c2/tracktype.h"
#include "selection.h"
TrackProperties::TrackProperties(const Selection &s):
selection(s)
{
- set_size(300, 110);
+ GLtk::MixedRows *rows = new GLtk::MixedRows;
+ set_layout(rows);
- GLtk::Label *lbl;
+ GLtk::Label *lbl1, *lbl2;
- add(*(lbl = new GLtk::Label("Track properties")));
- lbl->set_geometry(GLtk::Geometry(10, geom.h-30, geom.w-20, 20));
-
- add(*(lbl = new GLtk::Label("Turnout ID")));
- lbl->set_geometry(GLtk::Geometry(10, geom.h-65, 70, 20));
+ add(*(lbl1 = new GLtk::Label("Track properties")));
+ layout->set_expand(*lbl1, true, false);
+ lbl1->set_style("title");
+ rows->start_row();
+ add(*(lbl1 = new GLtk::Label("Turnout ID")));
add(*(ent_turnout_id = new GLtk::Entry));
- ent_turnout_id->set_geometry(GLtk::Geometry(80, geom.h-65, 50, 20));
-
- add(*(lbl = new GLtk::Label("Sensor ID")));
- lbl->set_geometry(GLtk::Geometry(150, geom.h-65, 70, 20));
+ ent_turnout_id->set_edit_size(5, 1);
+ rows->start_row();
+ add(*(lbl2 = new GLtk::Label("Sensor ID")));
+ rows->add_constraint(*lbl1, GLtk::Layout::COPY_WIDTH, *lbl2);
add(*(ent_sensor_id = new GLtk::Entry));
- ent_sensor_id->set_geometry(GLtk::Geometry(220, geom.h-65, 50, 20));
+ ent_sensor_id->set_edit_size(5, 1);
GLtk::Button *btn;
+ rows->start_row();
+ rows->split_columns();
add_button(*(btn = new GLtk::Button("Cncl")), 0);
- btn->set_geometry(GLtk::Geometry(geom.w-90, 10, 40, 24));
btn->set_style("red");
add_button(*(btn = new GLtk::Button("OK")), 1);
- btn->set_geometry(GLtk::Geometry(geom.w-50, 10, 40, 24));
btn->set_style("green");
if(selection.size()==1)
using namespace R2C2;
Zonebar::Zonebar(Designer &d):
- Toolbar("Zone", 420),
+ Toolbar("Zone"),
designer(d)
{
pnl_content->add(*(drp_groups = new GLtk::Dropdown));
- drp_groups->set_geometry(GLtk::Geometry(0, 10, 195, 20));
drp_groups->set_tooltip("Select zone group to edit");
drp_groups->signal_item_selected.connect(sigc::mem_fun(this, &Zonebar::group_selected));
pnl_content->add(*(drp_numbers = new GLtk::Dropdown));
- drp_numbers->set_geometry(GLtk::Geometry(200, 10, 100, 20));
drp_groups->set_tooltip("Select zone to edit");
drp_numbers->signal_item_selected.connect(sigc::mem_fun(this, &Zonebar::number_selected));
GLtk::Button *btn;
pnl_content->add(*(btn = new GLtk::Button("Del")));
- btn->set_geometry(GLtk::Geometry(300, 10, 40, 24));
btn->set_style("red");
btn->set_tooltip("Delete selected zone");
btn->signal_clicked.connect(sigc::mem_fun(this, &Zonebar::delete_zone_clicked));
pnl_content->add(*(btn = new GLtk::Button("Prop")));
- btn->set_geometry(GLtk::Geometry(340, 10, 40, 24));
btn->set_tooltip("Change properties of the selected zone");
btn->signal_clicked.connect(sigc::mem_fun(&designer, &Designer::zone_properties));
pnl_content->add(*(btn = new GLtk::Button("AddT")));
- btn->set_geometry(GLtk::Geometry(380, 10, 40, 24));
btn->set_tooltip("Add selected tracks to zone");
btn->signal_clicked.connect(sigc::mem_fun(&designer, &Designer::add_selection_to_zone));
#include <msp/gltk/button.h>
#include <msp/gltk/label.h>
+#include <msp/gltk/mixedrows.h>
#include "zoneproperties.h"
using namespace std;
ZoneProperties::ZoneProperties(Zone &z):
zone(z)
{
- set_size(300, 140);
+ GLtk::MixedRows *rows = new GLtk::MixedRows;
+ set_layout(rows);
- GLtk::Label *lbl;
+ GLtk::Label *lbl1, *lbl2;
- add(*(lbl = new GLtk::Label("Zone properties")));
- lbl->set_geometry(GLtk::Geometry(10, geom.h-30, geom.w-20, 20));
-
- add(*(lbl = new GLtk::Label("Group")));
- lbl->set_geometry(GLtk::Geometry(10, geom.h-65, 70, 20));
+ add(*(lbl1 = new GLtk::Label("Zone properties")));
+ layout->set_expand(*lbl1, true, false);
+ lbl1->set_style("title");
+ rows->start_row();
+ add(*(lbl1 = new GLtk::Label("Group")));
add(*(ent_group = new GLtk::Entry(zone.get_group())));
- ent_group->set_geometry(GLtk::Geometry(80, geom.h-65, geom.w-90, 20));
-
- add(*(lbl = new GLtk::Label("Qualifier")));
- lbl->set_geometry(GLtk::Geometry(10, geom.h-95, 70, 20));
+ ent_group->set_edit_size(30, 1);
+
+ rows->start_row();
+ add(*(lbl2 = new GLtk::Label("Qualifier")));
+ rows->add_constraint(*lbl1, GLtk::Layout::COPY_WIDTH, *lbl2);
add(*(drp_qualifier = new GLtk::Dropdown));
- drp_qualifier->set_geometry(GLtk::Geometry(80, geom.h-95, 80, 20));
const char *qualifiers[] = { "track", "platform", "siding", 0 };
for(unsigned i=0; qualifiers[i]; ++i)
{
drp_qualifier->set_selected_index(i);
}
- add(*(lbl = new GLtk::Label("Number")));
- lbl->set_geometry(GLtk::Geometry(170, geom.h-95, 70, 20));
-
+ rows->start_row();
+ add(*(lbl1 = new GLtk::Label("Number")));
+ rows->add_constraint(*lbl1, GLtk::Layout::COPY_WIDTH, *lbl2);
add(*(ent_number = new GLtk::Entry(lexical_cast<string>(zone.get_number()))));
- ent_number->set_geometry(GLtk::Geometry(240, geom.h-95, 50, 20));
+ ent_number->set_edit_size(4, 1);
GLtk::Button *btn;
+ rows->start_row();
+ rows->split_columns();
add_button(*(btn = new GLtk::Button("Cncl")), 0);
- btn->set_geometry(GLtk::Geometry(geom.w-90, 10, 40, 24));
btn->set_style("red");
add_button(*(btn = new GLtk::Button("OK")), 1);
- btn->set_geometry(GLtk::Geometry(geom.w-50, 10, 40, 24));
btn->set_style("green");
}