From 8fd0a54c0b60fd6e5adc1c7ab0f3bf6437060b20 Mon Sep 17 00:00:00 2001 From: "Ira W. Snyder" Date: Tue, 9 Oct 2007 13:56:48 -0700 Subject: [PATCH] Add spacing to the GUI Also, remove an extra table column that was not needed. Signed-off-by: Ira W. Snyder --- elevatorgui.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/elevatorgui.cpp b/elevatorgui.cpp index 2c82772..4ca5fe9 100644 --- a/elevatorgui.cpp +++ b/elevatorgui.cpp @@ -13,7 +13,7 @@ ElevatorGUI::ElevatorGUI (int floors, int elevators) , timer_() /* GUI Elements */ - , table_(floors+1, elevators+3) + , table_(floors+1, elevators+2) , button_playpause_(Gtk::Stock::MEDIA_PLAY) , button_stop_(Gtk::Stock::STOP) , button_quit_(Gtk::Stock::QUIT) @@ -27,6 +27,11 @@ ElevatorGUI::ElevatorGUI (int floors, int elevators) int i, j, e, f, e_num, f_num, f_attach; std::ostringstream str; + /* Set Table Spacing / Window Border Size */ + table_.set_col_spacings (8); + table_.set_row_spacings (8); + set_border_width (10); + /* Fill in all of the ElevatorDoors and CallButtons */ for (f_attach=0, f=floors-1; f>=0; --f, ++f_attach) { @@ -51,6 +56,11 @@ ElevatorGUI::ElevatorGUI (int floors, int elevators) call_buttons_.push_back (callbutton); box->pack_start (*callbutton); } + else // we are on the top floor, create a dummy label + { + Gtk::Label *label = new Gtk::Label (""); + box->pack_start (*label); + } /* Only create the DOWN CallButton if we are not on the bottom floor */ if (f != 0) @@ -69,6 +79,11 @@ ElevatorGUI::ElevatorGUI (int floors, int elevators) call_buttons_.push_back (callbutton); box->pack_end (*callbutton); } + else // we are on the bottom floor, create a dummy label + { + Gtk::Label *label = new Gtk::Label (""); + box->pack_end (*label); + } for (e=0; e