Tool::Tool(Designer &d, Input::Mouse &mouse):
designer(d),
- done(false)
+ done(false),
+ accepted(false)
{
mouse.signal_button_press.connect(sigc::bind_return(sigc::mem_fun(this, &Tool::button_press), false));
mouse.signal_axis_motion.connect(sigc::bind_return(sigc::mem_fun(this, &Tool::axis_motion), false));
signal_status.emit(status);
}
-void Tool::set_done()
+void Tool::set_done(bool a)
{
+ accepted = a;
done = true;
signal_done.emit();
}
+void Tool::button_press(unsigned btn)
+{
+ if(btn==1)
+ {
+ finish();
+ set_done(true);
+ }
+ else if(btn==3)
+ set_done(false);
+}
+
void Tool::axis_motion(unsigned axis, float value, float)
{
if(axis==0)
else if(axis==1)
pointer.y = value;
ground_pointer = designer.map_pointer_to_ground(pointer);
+
+ pointer_motion();
}