indexing description: "[ Basic delegate of an EM_PANEL. ]" date: "$Date$" revision: "$Revision$" class EM_BASIC_PANEL_DELEGATE inherit EM_WIDGET_DELEGATE redefine install, optimal_height, optimal_width end feature -- Initialisation install (panel: EM_WIDGET) is -- Install style on `panel'. -- Set up all default values for background, border, font and colors. do Precursor {EM_WIDGET_DELEGATE} (panel) end feature -- Measurement optimal_width (panel: EM_WIDGET): INTEGER is -- Optimal width of `panel' local a_cursor: DS_LINEAR_CURSOR [EM_WIDGET] do a_cursor := panel.widgets.new_cursor from a_cursor.start until a_cursor.after loop Result := Result.max (a_cursor.item.x+a_cursor.item.width) a_cursor.forth end end optimal_height (panel: EM_WIDGET): INTEGER is -- Optimal height of `panel' local a_cursor: DS_LINEAR_CURSOR [EM_WIDGET] do a_cursor := panel.widgets.new_cursor from a_cursor.start until a_cursor.after loop Result := Result.max (a_cursor.item.y+a_cursor.item.height) a_cursor.forth end end end