indexing description: "[ Line border with equal width on all sides and a fixed color. ]" date: "$Date$" revision: "$Revision$" class EM_LINE_BORDER inherit EM_BORDER create make feature {NONE} -- Initialisation make (a_color: like color; a_width: like width) is -- Initialise `Current' with `a_color' and `a_width'. require a_color_not_void: a_color /= Void a_width_not_negative: a_width >= 0 do set_color (a_color) set_width (a_width) ensure color_set: color = a_color width_set: width = a_width end feature -- Access color: EM_COLOR -- Color of border width: INTEGER -- Width of border feature -- Element change set_width (a_width: like width) is -- Set `width' to `a_width'. require a_width_not_negative: a_width >= 0 do width := a_width top := width left := width bottom := width right := width ensure width_set: width = a_width end set_color (a_color: like color) is -- Set `color' to `a_color'. require a_color_not_void: a_color /= Void do color := a_color ensure color_set: color = a_color end feature -- Drawing draw_on (a_widget: EM_WIDGET) is -- Draw border on `a_widget'. local x: INTEGER do from x := 0 variant width - x until x >= width loop a_widget.surface.put_rectangle (x, x, a_widget.width-1-x, a_widget.height-1-x, color) x := x + 1 end end invariant width_not_negative: width >= 0 color_not_void: color /= Void end