indexing description: "[ Pan Tool ]" date: "$Date$" revision: "$Revision$" class PAN_TOOL inherit TOOL create make feature -- Access cursor: MOUSE_CURSOR is -- appropriate cursor. do if scene.focus_on_scene then if is_pressed then Result := hand_cursor_closed else Result := hand_cursor_open end else Result := arrow_cursor end end feature -- Event Handling handle_mouse_button_down_event (event: EM_MOUSEBUTTON_EVENT) is -- Handle mouse button down event. do if scene.focus_on_scene and event.is_left_button then is_pressed := True end end handle_mouse_button_up_event (event: EM_MOUSEBUTTON_EVENT) is -- Handle mouse button up event. do if event.is_left_button then is_pressed := False end end handle_mouse_motion_event (event: EM_MOUSEMOTION_EVENT) is -- Handle mouse motion event. do x := event.screen_x y := event.screen_y - 32 if is_pressed then -- the mouse is dragged over the scene scene.set_center (((last_x - x) / scene.scale + scene.center_x).rounded, ((last_y - y) / scene.scale + scene.center_y).rounded) end last_x := x last_y := y end handle_key_down_event (event: EM_KEYBOARD_EVENT) is -- Handle key down event. do end handle_key_up_event (event: EM_KEYBOARD_EVENT) is -- Handle key up event. do end feature {NONE} -- Implementation end