X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fremote%2Fremote.cpp;h=e5384777bf49ffaf5f52b21196483361e5088186;hb=d084e6f369a829f41086d1f7f9befa52d0392d58;hp=830a06d05a2f3fc07eb624718629c45772a1f5aa;hpb=1ff06c5bc46a677fa389ef86c6b26664368f1653;p=r2c2.git diff --git a/source/remote/remote.cpp b/source/remote/remote.cpp index 830a06d..e538477 100644 --- a/source/remote/remote.cpp +++ b/source/remote/remote.cpp @@ -1,13 +1,15 @@ /* $Id$ This file is part of R²C² -Copyright © 2009-2010 Mikkosoft Productions, Mikko Rasa +Copyright © 2009-2011 Mikkosoft Productions, Mikko Rasa Distributed under the GPL */ +#include #include #include #include +#include "mainpanel.h" #include "remote.h" #include "trainpanel.h" @@ -38,8 +40,15 @@ Remote::Remote(int argc, char **argv): window.set_default_size(300, 200); window.set_border_width(5); - train_box = new Gtk::VBox(false, 5); - window.add(*manage(train_box)); + Gtk::ScrolledWindow *scroll = new Gtk::ScrolledWindow; + window.add(*manage(scroll)); + scroll->set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); + + panel_box = new Gtk::VBox(false, 5); + scroll->add(*manage(panel_box)); + + main_panel = new MainPanel(*this, client); + panel_box->pack_start(*manage(main_panel), false, true); window.show_all(); } @@ -52,13 +61,11 @@ void Remote::tick() void Remote::train_added(R2C2::NetTrain &t) { + Gtk::HSeparator *sep = new Gtk::HSeparator; + panel_box->pack_start(*manage(sep), false, true); + sep->show(); + TrainPanel *panel = new TrainPanel(*this, client, t); - if(!train_panels.empty()) - { - Gtk::HSeparator *sep = new Gtk::HSeparator; - train_box->pack_start(*manage(sep), false, true); - sep->show(); - } - train_box->pack_start(*manage(panel), false, true); + panel_box->pack_start(*manage(panel), false, true); train_panels.push_back(panel); }