#include <msp/gl/matrix.h>
#include <msp/gl/misc.h>
#include <msp/gl/tests.h>
+#include <msp/gltk/floatingarrangement.h>
#include <msp/io/print.h>
#include <msp/strings/format.h>
#include <msp/time/units.h>
window.signal_close.connect(sigc::bind(sigc::mem_fun(this, &Engineer::exit), 0));
root = new GLtk::Root(ui_res, &window, &keyboard, &mouse);
+ GLtk::Layout *root_layout = new GLtk::Layout;
+ root->set_layout(root_layout);
+ root_layout->set_margin(GLtk::Sides());
+ root_arrangement = new GLtk::FloatingArrangement(*root_layout);
mouse.signal_button_press.connect(sigc::bind_return(sigc::mem_fun(this, &Engineer::button_press), false));
mouse.signal_axis_motion.connect(sigc::bind_return(sigc::mem_fun(this, &Engineer::axis_motion), false));
root->set_visible(true);
}
delete overlay;
+ delete root_arrangement;
delete root;
delete server;
Msp::Input::Mouse mouse;
Msp::GLtk::Resources ui_res;
Msp::GLtk::Root *root;
+ Msp::GLtk::Arrangement *root_arrangement;
R2C2::Catalogue catalogue;
R2C2::Layout layout;
{
TrainListDialog *dlg = new TrainListDialog(engineer);
find_ancestor<GLtk::Root>()->add(*dlg);
- dlg->autosize();
}
void MainWindow::quit_clicked()
#include <msp/core/maputils.h>
#include <msp/core/raii.h>
#include <msp/gltk/part.h>
+#include <msp/gltk/root.h>
#include <msp/gltk/stack.h>
#include <msp/strings/format.h>
#include "libr2c2/aicontrol.h"
{
pnl_expander->set_visible(!pnl_expander->is_visible());
btn_expand->set_style(pnl_expander->is_visible() ? "arrow_up" : "arrow_down");
- GLtk::Geometry ageom = geom;
- ageom.h = 0;
- layout->autosize(ageom);
- ageom.y = geom.y+geom.h-ageom.h;
- set_geometry(ageom);
+ signal_autosize_changed.emit();
+ find_ancestor<GLtk::Root>()->get_layout()->update();
}
void TrainDialog::toggle_panel(bool show, GLtk::Panel *panel)
{
TrainDialog *dlg = new TrainDialog(engineer, *trains.get(index));
find_ancestor<GLtk::Root>()->add(*dlg);
- dlg->autosize();
}
}