indexing description: "[ Exhibit box showcasing vertical, horizontal, and depth group-boxes ]" author: "" date: "$Date$" revision: "$Revision$" class EXHIBIT_VHD_BOX inherit EXHIBIT_BOX create make feature -- Access title: STRING is -- Title "Vertical- / Horizontal- / Depth-Boxes" description: STRING is -- Description "Below you'll find tree times the same three colored boxes: % %A red one, a yellow one, and a blue one. % %Each group of three boxes is arranged by either a horizontal, % %a vertical or a depth-box.%N% %Try toggling ortographic projection by pressing `o' to % %better see how things extend to the third dimension.%N% %" vbox: EM_VIZ_VERTICAL_BOX [EM_VIZ_COLOR_BOX] -- Vertical box hbox: EM_VIZ_HORIZONTAL_BOX [EM_VIZ_COLOR_BOX] -- Horizontal box dbox: EM_VIZ_DEPTH_BOX [EM_VIZ_COLOR_BOX] -- Depth box feature -- Manufacturing put_color_boxes (lbox: EM_VIZ_LIST_BOX [EM_VIZ_COLOR_BOX]) is -- Add some color boxes to list box local cbox: EM_VIZ_COLOR_BOX do -- Red colored cube create cbox.make ([0,0,0], [255, 0, 0, 195]) lbox.put_last (cbox) -- Yellow colored cube create cbox.make ([0,0,0], [255, 255, 0, 195]) lbox.put_last (cbox) -- Blue colored cube create cbox.make ([0,0,0], [0, 0, 255, 195]) lbox.put_last (cbox) animate_color_boxes (0, lbox) end create_exhibit is -- Create showcase do -- Three columns total create_column_layout (3) -- Depth grouped boxes create dbox.make put_color_boxes (dbox) dbox.set_alignment ([Align_center, Align_center, Align_front]) put_column_title ("Depth-box, centered horizontally as well as vertically", 1) put_column_content (dbox, 1) -- Horizontally grouped boxes create hbox.make put_color_boxes (hbox) hbox.set_alignment ([Align_left, Align_bottom, Align_back]) put_column_title ("Horizontal-box, aligned to bottom and back", 2) put_column_content (hbox, 2) -- Vertically grouped boxes create vbox.make put_color_boxes (vbox) put_column_title ("Vertical-box, default alignment", 3) put_column_content (vbox, 3) exhibit := column_layout end feature animate_color_boxes (a_time: INTEGER; lbox: EM_VIZ_LIST_BOX [EM_VIZ_COLOR_BOX]) is -- Animate color boxes inside one of the listboxes local c: DOUBLE do c := -20*cosine (a_time / 1000.0) lbox.item (1).set_size ([50 + c, 50 + c, 50 + c]) c := -20*cosine (a_time / 1000.0 + 1) lbox.item (2).set_size ([50 + c, 50 + c, 50 + c]) c := -20*cosine (a_time / 1000.0 + 2) lbox.item (3).set_size ([50 + c, 50 + c, 50 + c]) end go_to_time (a_time: INTEGER) is -- Animate exhibit do animate_color_boxes (a_time, vbox) animate_color_boxes (a_time, hbox) animate_color_boxes (a_time, dbox) end end