indexing description: "Common features for the top shells of the design and game subsystems." deferred class V_SHELL inherit -- WEL_MDI_FRAME_WINDOW -- Couldn't get subwindows to listen to events WEL_FRAME_WINDOW -- Now subwindows listen to events! redefine closeable, on_sys_command, on_get_min_max_info end PUZZLE_COMPONENT feature{NONE} wp : WEL_POINT is -- Ordered pair consisting of the fixed width and height of -- the rooms. once !!Result.make( room_width, room_height ) end make( b : BASE ; s : STRING ) is -- Initialize a puzzle shell window do base := b make_menu_bar make_top( s ) set_menu( menu_bar ) resize( room_width, room_height ) make_room end room_width : INTEGER is -- Get width from config, adjust to improve image. once Result := configuration.room_width + 5 end room_height : INTEGER is -- Get height from config, adjust to improve image. once Result := configuration.room_height + 45 end room : V_ROOM -- My room. make_room is -- Make a room appropriate for me. deferred end make_menu_bar is -- Make a menu bar appropriate for me. deferred end menu_bar : WEL_MENU -- My menu bar. base : BASE -- The main menu widget. closeable : BOOLEAN is False -- Prevents users from being able to close this window from the Windows banner. See also -- ISE example "controls". If we let 'em do this then the widget is destroyed -- and would have to be recreated upon request which is time consuming. -- This way we can use hide and show which are fast. sc : WEL_SC_CONSTANTS -- sc : expanded WEL_SC_CONSTANTS -- System command constants help: WEL_MENU display_about_message is local about : ABOUT_BOX do create about.make( Current, "About Stooge", configuration.about_message, configuration.more_message, True ) about.show end make_help_menu is -- Make the menu with various help commands. deferred end feature prepend_text : STRING is -- Text to prepend my title. e.g "Solving ", "Designing ", "Testing" deferred end on_sys_command (a_command, x_pos, y_pos: INTEGER) is -- Catch user's attempt to destroy me via system menu bar and use it -- as an alias for `exit' do !!sc if a_command = sc.sc_close then exit end end on_get_min_max_info (min_max_info: WEL_MIN_MAX_INFO) is -- Prevents resizing by the user. do min_max_info.set_max_track_size( wp ) min_max_info.set_min_track_size( wp ) min_max_info.set_max_size( wp ) end exit is -- Clean up and return to the main menu. do -- RML HW4 room.clear room.exit -- RML HW4 hide -- RML HW5 base.return end raise is -- Raise this window to the top of the stacking order. do -- set_z_order( hwnd_topmost ) set_z_order( hwnd_top ) -- set_z_order( hwnd_notopmost ) -- set_z_order( hwnd_bottom ) -- Different for Control windows than frames, see V_PIECE. end set_title is -- Set my title using `prepend_text'. local t : STRING do t := clone( room.title ) t.prepend( prepend_text ) set_text( t ) end end