indexing description: "The main Scene of the elfractal Application" author: "Lars Krapf" date: "$Date$" revision: "$Revision$" class EF_SCENE inherit EM_COMPONENT_SCENE EM_SHARED_STANDARD_FONTS create make feature -- Initialization make is do make_component_scene initialize_scene -- Create 3D Display create panel_view.make_from_dimension(600,600) panel_view.set_position(200,0) add_component(panel_view) -- Create Menu Panels (Simple & Expert) create panel_simple_menu.make(panel_view) panel_simple_menu.set_position(0,0) -- Show Simple Menu add_component(panel_simple_menu) panel_view.set_simple_mode(True) -- Create View and Mode Menu create panel_small.make_from_dimension (200,70) panel_small.set_position(0,530) panel_small.set_background(create {EM_BITMAP_BACKGROUND}.make_from_file ("menu_small.png")) -- expert mode create button_expert.make_from_text("extended definitions") button_expert.set_dimension(182,18) button_expert.set_position(9,9) button_expert.set_font(standard_ttf_fonts.bitstream_vera_sans (11)) button_expert.mouse_clicked_event.subscribe(agent show_definitions) panel_small.add_widget(button_expert) -- stereoscopic view create button_stereoscopic.make_from_text("stereoscopic view") button_stereoscopic.set_dimension(182,18) button_stereoscopic.set_position(9,26) button_stereoscopic.set_font(standard_ttf_fonts.bitstream_vera_sans (11)) button_stereoscopic.mouse_clicked_event.subscribe(agent change_stereoscopic) panel_small.add_widget(button_stereoscopic) -- show screenshot history create button_colors.make_from_text("no coloring") button_colors.set_dimension(182,18) button_colors.set_position(9,43) button_colors.set_font(standard_ttf_fonts.bitstream_vera_sans (11)) button_colors.mouse_clicked_event.subscribe(agent change_colors) panel_small.add_widget(button_colors) add_component(panel_small) -- extended definitions create panel_definitions.make(panel_view) panel_definitions.set_position(250,50) panel_definitions.hide add_component(panel_definitions) event_loop.key_up_event.subscribe(agent keyboard_handler) end feature -- Status setting show_definitions(an_event: EM_MOUSEBUTTON_EVENT) is -- show textarea for extended defintions do panel_definitions.show end change_colors(an_event: EM_MOUSEBUTTON_EVENT) is -- show normal or stereoscopic view do if is_coloring then button_colors.set_text ("no coloring") panel_view.set_simple_mode (True) is_coloring := False else button_colors.set_text("simple coloring") panel_view.set_simple_mode (False) is_coloring := True end panel_view.create_script ensure color_mode_switched: is_coloring = not old is_coloring end change_stereoscopic(an_event: EM_MOUSEBUTTON_EVENT) is -- show normal or stereoscopic view do if is_stereoscopic then button_stereoscopic.set_text ("stereoscopic view") panel_view.set_stereoscopic (False) is_stereoscopic := False else button_stereoscopic.set_text("normal view") panel_view.set_stereoscopic (True) is_stereoscopic := True end ensure is_stereoscopic_changed: is_stereoscopic = not (old is_stereoscopic) end feature {NONE} -- Implementation keyboard_handler(an_event: EM_KEYBOARD_EVENT) is do if an_event.key = 27 then quit end end -- Panel for extended Defintions panel_definitions: EF_PANEL_DEFINITIONS -- Panel for Simple Interface panel_simple_menu: EF_SIMPLE_PANEL -- The main 3D Display panel_view: EF_3D_DISPLAY -- Change View and Mode panel_small: EM_PANEL button_expert: EM_BUTTON is_expert: BOOLEAN button_stereoscopic: EM_BUTTON is_stereoscopic: BOOLEAN is_coloring: BOOLEAN button_colors: EM_BUTTON end