X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdesigner%2Fdesigner.cpp;h=3d068d0ad42d4252adb1561f45874e46bb6790ee;hb=ab0cffffb161d8d76e77e7444eb6141312059bfb;hp=32fe42391d13691d7d1d45a14d614bcd1251fa07;hpb=2220ba2f11705ea9a4e480603d43ab7ed4cf5a89;p=r2c2.git diff --git a/source/designer/designer.cpp b/source/designer/designer.cpp index 32fe423..3d068d0 100644 --- a/source/designer/designer.cpp +++ b/source/designer/designer.cpp @@ -56,7 +56,8 @@ Designer::Designer(int argc, char **argv): cur_zone(0), mode(TOOL), sel_wrap(selection), - cur_tool(0) + cur_tool(0), + keep_status(0) { window.set_title("Railway Designer"); window.signal_close.connect(sigc::bind(sigc::mem_fun(this, &Designer::exit), 0)); @@ -346,6 +347,7 @@ void Designer::tick() cur_tool->update_selection(selection); use_select_tool(); } + keep_status = 0; window.tick(); root.tick(); @@ -465,8 +467,10 @@ void Designer::use_tool(Tool *tool) cur_tool = tool; cur_tool->signal_status.connect(sigc::mem_fun(this, &Designer::tool_status)); - tool_status(cur_tool->get_status()); + if(keep_status<2) + tool_status(tool->get_status()); mode = TOOL; + keep_status = 1; } void Designer::use_select_tool() @@ -481,7 +485,7 @@ void Designer::button_press(unsigned btn) if(mode==CATALOGUE) { - Object *obj; + Object *obj = 0; if(btn==1) obj = pick_object(pointer); @@ -557,6 +561,8 @@ void Designer::update_object_icon(Object &obj) void Designer::tool_status(const string &status) { lbl_status->set_text(status); + if(keep_status==1) + keep_status = 2; } void Designer::object_properties_response(int) @@ -619,6 +625,7 @@ void Designer::show_route(const Route &route) path->set_color(GL::Color(0.5, 0.8, 1.0)); if(unsigned taddr = (*i)->get_turnout_address()) path->set_path(route.get_turnout(taddr)); + highlight_paths.push_back(path); } } @@ -632,5 +639,6 @@ void Designer::show_zone(const Zone &zone) Track3D &t3d = layout_3d->get_3d(**i); Path3D *path = new Path3D(t3d); path->set_color(GL::Color(0.8, 1.0, 0.5)); + highlight_paths.push_back(path); } }