X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdesigner%2Fdesigner.cpp;h=7c100db390172cdbfe76cd90e84844725d3b40c8;hb=9b5a6a6f032863fe525623420c8086a62188b771;hp=292d5a9cb12a3e43c6b952b9306d8588644987b2;hpb=5e39ffb806f876099fcad5f2f5fe35993090de8a;p=r2c2.git diff --git a/source/designer/designer.cpp b/source/designer/designer.cpp index 292d5a9..7c100db 100644 --- a/source/designer/designer.cpp +++ b/source/designer/designer.cpp @@ -398,14 +398,9 @@ void Designer::key_press(unsigned key) use_tool_with_selected_objects(); else if(key==Msp::Input::KEY_ESC) { - if(cur_tool) - { - delete cur_tool; - cur_tool = 0; - } - else if(mode==CATALOGUE) + if(mode==CATALOGUE) mode = SELECT; - else + else if(mode==SELECT) selection.clear(); } else if(key==Msp::Input::KEY_X) @@ -449,7 +444,7 @@ void Designer::key_press(unsigned key) template T *Designer::use_tool_with_selected_objects() { - T *tool = new T(*this, mouse, selection.get_objects()); + T *tool = new T(*this, keyboard, mouse, selection.get_objects()); use_tool(tool); return tool; } @@ -457,7 +452,7 @@ T *Designer::use_tool_with_selected_objects() template T *Designer::use_tool() { - T *tool = new T(*this, mouse); + T *tool = new T(*this, keyboard, mouse); use_tool(tool); return tool; } @@ -471,8 +466,8 @@ void Designer::use_tool(Tool *tool) } cur_tool = tool; - cur_tool->signal_status.connect(sigc::mem_fun(this, &Designer::manipulation_status)); - manipulation_status(cur_tool->get_status()); + cur_tool->signal_status.connect(sigc::mem_fun(this, &Designer::tool_status)); + tool_status(cur_tool->get_status()); mode = TOOL; } @@ -572,17 +567,11 @@ void Designer::selection_changed() } } -void Designer::manipulation_status(const string &status) +void Designer::tool_status(const string &status) { lbl_status->set_text(status); } -void Designer::measure_done() -{ - mode = SELECT; - selection_changed(); -} - void Designer::track_properties_response(int) { const set &tracks = selection.get_objects();