1 #include "positionlabel.hpp"
3 PositionLabel::PositionLabel (int elevator, const std::string text)
6 , direction_img_(Gtk::Stock::YES, Gtk::ICON_SIZE_BUTTON)
9 attach (label_, 0, 1, 0, 1);
10 attach (direction_img_, 1, 2, 0, 1);
14 int PositionLabel::getElevatorNumber () const
19 void PositionLabel::update_position (float floor, Direction direction)
24 direction_img_.set(Gtk::Stock::GO_UP, Gtk::ICON_SIZE_BUTTON);
27 direction_img_.set(Gtk::Stock::GO_DOWN, Gtk::ICON_SIZE_BUTTON);
30 direction_img_.set(Gtk::Stock::YES, Gtk::ICON_SIZE_BUTTON);
33 std::cout << "Bad direction in PositionLabel->update_position(" << floor
34 << ", " << direction << ")" << std::endl;
38 std::ostringstream str;
41 str << std::setiosflags (std::ios_base::showpoint | std::ios_base::fixed)
42 << std::setprecision(1) << floor;
44 label_.set_text (str.str());
48 /* vim: set ts=4 sts=4 sw=4 noet tw=112: */