]> git.tdb.fi Git - r2c2.git/blobdiff - source/remote/remote.cpp
Ignore dubious speed measurements when finding speed step
[r2c2.git] / source / remote / remote.cpp
index c6afc6de537e0ab4fe7d3d4ffb75970fc69af24f..c53bddda1c2f08c4578b09cca3e05bf93c66ca5f 100644 (file)
@@ -1,10 +1,11 @@
 /* $Id$
 
-This file is part of the MSP Märklin suite
-Copyright © 2009  Mikkosoft Productions, Mikko Rasa
+This file is part of R²C²
+Copyright © 2009-2010  Mikkosoft Productions, Mikko Rasa
 Distributed under the GPL
 */
 
+#include <gtkmm/scrolledwindow.h>
 #include <gtkmm/separator.h>
 #include <msp/net/resolve.h>
 #include <msp/time/units.h>
@@ -38,8 +39,12 @@ Remote::Remote(int argc, char **argv):
        window.set_default_size(300, 200);
        window.set_border_width(5);
 
+       Gtk::ScrolledWindow *scroll = new Gtk::ScrolledWindow;
+       window.add(*manage(scroll));
+       scroll->set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
+
        train_box = new Gtk::VBox(false, 5);
-       window.add(*manage(train_box));
+       scroll->add(*manage(train_box));
 
        window.show_all();
 }
@@ -50,9 +55,9 @@ void Remote::tick()
        gtk.iteration(false);
 }
 
-void Remote::train_added(Marklin::NetTrain &t)
+void Remote::train_added(R2C2::NetTrain &t)
 {
-       TrainPanel *panel = new TrainPanel(client, t);
+       TrainPanel *panel = new TrainPanel(*this, client, t);
        if(!train_panels.empty())
        {
                Gtk::HSeparator *sep = new Gtk::HSeparator;