indexing description: "[ Main window for this application ]" date: "$Date$" revision: "$Revision$" class MAIN_WINDOW inherit MAIN_WINDOW_IMP feature {NONE} -- Initialization user_initialization is -- Called by `initialize'. -- Any custom user initialization that -- could not be performed in `initialize', -- (due to regeneration of implementation class) -- can be added here. do set_size (600, 400) end feature {NONE} -- Implementation on_button_click is -- `Change Scene' button was clicked local question_dialog: EV_CONFIRMATION_DIALOG do create question_dialog.make_with_text ("Hello World!") question_dialog.show_modal_to_window (Current) end on_item_changed is -- Called by `select_actions' of `listbox'. do if listbox.selected_item = simple_list_item then em_widget.scene.set_next_scene_from_outside (agent setup_simple_scene) elseif listbox.selected_item = goof_list_item then em_widget.scene.set_next_scene_from_outside (agent setup_goof_scene) elseif listbox.selected_item = tunnel_list_item then em_widget.scene.set_next_scene_from_outside (agent setup_tunnel_scene) elseif listbox.selected_item = sierpinskie_list_item then em_widget.scene.set_next_scene_from_outside (agent setup_sierpinski_scene) elseif listbox.selected_item = cube_list_item then em_widget.scene.set_next_scene_from_outside (agent setup_cube_scene) end end request_close_window is -- The user wants to close the window local question_dialog: EV_CONFIRMATION_DIALOG do create question_dialog.make_with_text (Label_confirm_close_window) question_dialog.show_modal_to_window (Current) if question_dialog.selected_button.is_equal ((create {EV_DIALOG_CONSTANTS}).ev_ok) then -- Destroy the window em_widget.scene.set_next_scene_from_outside (void) destroy; -- End the application --| TODO: Remove this line if you don't want the application --| to end when the first window is closed.. (create {EV_ENVIRONMENT}).application.destroy end end setup_simple_scene: EM_SCENE is -- It will be called from the SDL Thread do create {SIMPLE_SCENE}result.make ensure scene_creation_successful: result /= void end setup_goof_scene: EM_SCENE is -- It will be called from the SDL Thread do create {GOOF_SCENE}result.make ensure scene_creation_successful: result /= void end setup_tunnel_scene: EM_SCENE is -- It will be called from the SDL Thread do create {TUNNEL_SCENE}result.make ensure scene_creation_successful: result /= void end setup_sierpinski_scene: EM_SCENE is -- It will be called from the SDL Thread do create {SIERPINSKI_SCENE}result.make ensure scene_creation_successful: result /= void end setup_cube_scene: EM_SCENE is -- It will be called from the SDL Thread do create {CUBE_SCENE}result.make ensure scene_creation_successful: result /= void end feature {NONE} -- Constants Label_confirm_close_window: STRING is "Are you sure you want to quit EiffelMedia Vision2 Widget example" end