indexing description: "[ Helper routines for drawing widgets TODO: refactor colors ]" date: "$Date$" revision: "$Revision$" class EM_WIDGET_DRAWING feature -- Border draw_bevel_border_down (x1, y1, x2, y2: INTEGER; surface: EM_SURFACE) is -- Draw a bevel border looking "down" on 'surface'. do draw_bevel_border (x1, y1, x2, y2, surface, down_outer_top_left, down_inner_top_left, down_outer_bottom_right, down_inner_bottom_right) end draw_bevel_border_up (x1, y1, x2, y2: INTEGER; surface: EM_SURFACE) is -- Draw a bevel border looking "down" on 'surface'. do draw_bevel_border (x1, y1, x2, y2, surface, up_outer_top_left, up_inner_top_left, up_outer_bottom_right, up_inner_bottom_right) end draw_bevel_border (x1, y1, x2, y2: INTEGER; surface: EM_SURFACE; outer_top_left, inner_top_left, outer_bottom_right, inner_bottom_right: EM_COLOR) is -- Draw a bevel border on 'surface'. do -- top surface.put_line_segment (x1, y1, x2, y1, outer_top_left) surface.put_line_segment (x1+1, y1+1, x2-1, y1+1, inner_top_left) -- left surface.put_line_segment (x1, y1, x1, y2, outer_top_left) surface.put_line_segment (x1+1, y1+1, x1+1, y2-1, inner_top_left) -- right surface.put_line_segment (x2, y1+1, x2, y2, outer_bottom_right) surface.put_line_segment (x2-1, y1+2, x2-1, y2-1, inner_bottom_right) -- bottom surface.put_line_segment (x1+1, y2, x2, y2, outer_bottom_right) surface.put_line_segment (x1+2, y2-1, x2-1, y2-1, inner_bottom_right) end feature -- Colors up_outer_bottom_right, down_outer_top_left: EM_COLOR is -- Border color once create Result.make_with_rgb (167, 167, 167) end up_inner_bottom_right, down_inner_top_left: EM_COLOR is -- Border color once create Result.make_with_rgb (0, 0, 0) end up_outer_top_left, down_outer_bottom_right: EM_COLOR is -- Border color once create Result.make_with_rgb (255, 255, 255) end up_inner_top_left, down_inner_bottom_right: EM_COLOR is -- Border color once create Result.make_with_rgb (211, 211, 211) end end