indexing description: "[ A panel which displays EM_DRAWABLE's. Add new EM_DRAWABLE's to `container'. ]" date: "$Date$" revision: "$Revision$" class EM_DRAWABLE_PANEL inherit EM_WIDGET redefine make_void_surface, next_frame end create make_from_container, make_from_dimension, make_from_surface, make_void_surface feature {NONE} -- Initialisation make_void_surface is -- Initialise default values. do create container.make Precursor {EM_WIDGET} mouse_button_down_event.subscribe (agent dispatch_wrapper_button_event (?)) mouse_button_up_event.subscribe (agent dispatch_wrapper_button_event (?)) mouse_moved_event.subscribe (agent dispatch_wrapper_motion_event (?)) mouse_dragged_event.subscribe (agent dispatch_wrapper_motion_event (?)) end make_from_container (a_container: EM_DRAWABLE_CONTAINER [EM_DRAWABLE]) is -- Initialise panel with `a_container'. require a_container_not_void: a_container /= Void do make_void_surface container := a_container if a_container.width > 0 and then a_container.height > 0 then set_dimension (a_container.width, a_container.height) end end delegate_factory: FUNCTION [ANY, TUPLE [], like delegate] is -- Factory to create default delegate do Result := theme_delegates.drawable_panel_delegate_factory end feature -- Access container: EM_DRAWABLE_CONTAINER [EM_DRAWABLE] -- Container of drawables feature -- Miscellaneous next_frame is -- Handle frame change. do set_changed end feature {NONE} -- Implementation dispatch_wrapper_button_event (event: EM_MOUSEBUTTON_EVENT) is -- Forward `event' to `container'. do container.publish_mouse_event (event) end dispatch_wrapper_motion_event (event: EM_MOUSEMOTION_EVENT) is -- Forward `event' to `container'. do container.publish_mouse_event (event) end invariant container_not_void: container /= Void end