indexing description: "[ A widget that enables the user to zoom and scroll its content. ]" date: "$Date$" revision: "$Revision$" class EM_ZOOMABLE_WIDGET inherit EM_ZOOMABLE_CONTAINER redefine make end create make feature {NONE} -- Initialization make (a_width, a_height: INTEGER) is -- Make empty container with size `a_width' and `a_height'. do Precursor (a_width, a_height) mouse_motion_event.subscribe (agent process_mouse_move_event) ensure then no_contained_drawables: is_empty end feature {NONE} -- Implementation process_mouse_move_event (a_event: EM_MOUSEMOTION_EVENT) is -- Process mouse move event over `Current' to zoom or scroll Current. local zoom_step: DOUBLE do if a_event.button_state_right then scroll_proportional (- a_event.motion) end if a_event.button_state_middle then zoom_step := 1.0 - (a_event.y_motion / 100) if zoom_step <= 0.5 then zoom_step := 0.5 end if zoom_step > 2.0 then zoom_step := 2.0 end zoom (zoom_step) end end end