indexing description : "Main window for this application" legal: "See notice at end of class." status: "See notice at end of class." author : "Generated by the New Vision2 Application Wizard." date : "$Date$" revision : "1.0.0" class MAIN_WINDOW inherit EV_TITLED_WINDOW redefine initialize, is_in_default_state end INTERFACE_NAMES export {NONE} all undefine default_create, copy end DOCKING_MANAGER_HODLER undefine default_create, copy end create default_create feature {NONE} -- Initialization initialize is -- Build the interface for this window. do Precursor {EV_TITLED_WINDOW} build_containers extend (main_container) main_container.extend (docking_container) setup_docking_attributes build_content_control_panel build_docking_editor_contents build_docking_tool_contents build_docking_tool_contents -- Execute `request_close_window' when the user clicks -- on the cross in the title bar. close_request_actions.extend (agent request_close_window) -- Set the title of the window set_title (Window_title) -- Set the initial size of the window set_size (Window_width, Window_height) end setup_docking_attributes is -- Setup docking attributes. do -- Build the Docking Manager. create docking_manager.make (docking_container, Current) end is_in_default_state: BOOLEAN is -- Is the window in its default state -- (as stated in `initialize') do Result := (width = Window_width) and then (height = Window_height) and then (title.is_equal (Window_title)) end feature -- Access content_control_panel: CONTENT_CONTROL_PANEL -- Content contol panel toolbar_manager: SD_TOOL_BAR_MANAGER -- Tool bar manager. feature {NONE} -- Implemetation, Docking management build_docking_editor_contents is -- Build editor contents. do content_control_panel.build_docking_editor_content end build_docking_tool_contents is -- Build tool contents. do content_control_panel.build_docking_tool_content end build_content_control_panel is -- Build center control panel. local l_dialog: EV_DIALOG l_title: STRING_GENERAL do l_title := "Control Panel" create content_control_panel.make (docking_manager, Current) create l_dialog.make_with_title (l_title) l_dialog.extend (content_control_panel) l_dialog.set_width (400) l_dialog.set_height (400) l_dialog.show_relative_to_window (Current) end feature {NONE} -- Implementation, Close event 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 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 feature {NONE} -- Implementation main_container: EV_VERTICAL_BOX -- Main container (contains all widgets displayed in this window) docking_container: EV_VERTICAL_BOX -- Container managed by docking manager. build_containers is -- Create `main_container' and `docking_container'. require main_container_not_yet_created: main_container = Void do create main_container create docking_container ensure main_container_created: main_container /= Void end feature {NONE} -- Implementation / Constants sd_shared: SD_SHARED -- Docking icons, etc. once create Result end Window_title: STRING is "Docking Control" -- Title of the window. Window_width: INTEGER is 800 -- Initial width for this window. Window_height: INTEGER is 600; -- Initial height for this window. indexing copyright: "Copyright (c) 1984-2006, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software 356 Storke Road, Goleta, CA 93117 USA Telephone 805-685-1006, Fax 805-685-6869 Website http://www.eiffel.com Customer support http://support.eiffel.com ]" end -- class MAIN_WINDOW