116 lines
2.5 KiB
Plaintext
116 lines
2.5 KiB
Plaintext
note
|
|
description: "[
|
|
Main window for VITP
|
|
]"
|
|
author: "Jimmy J. Johnson"
|
|
|
|
class
|
|
VITP_MAIN_WINDOW
|
|
|
|
inherit
|
|
|
|
JJ_MAIN_WINDOW
|
|
redefine
|
|
create_interface_objects,
|
|
initialize,
|
|
-- initialize_interface,
|
|
target_imp,
|
|
set_target
|
|
-- draw
|
|
end
|
|
|
|
FONT_AND_COLOR_CONSTANTS
|
|
export
|
|
{NONE}
|
|
all
|
|
undefine
|
|
default_create,
|
|
copy
|
|
end
|
|
|
|
GAME_CONSTANTS
|
|
export
|
|
{NONE}
|
|
all
|
|
undefine
|
|
default_create,
|
|
copy
|
|
end
|
|
|
|
create
|
|
make
|
|
|
|
feature {NONE} -- Initialization
|
|
|
|
create_interface_objects
|
|
-- Create objects to be used by `Current' in `initialize'
|
|
-- Implemented by descendants to create attached objects
|
|
-- in order to adhere to void-safety due to the implementation bridge pattern.
|
|
do
|
|
print ("VITP_MAIN_WINDOW.create_interface_objects %N")
|
|
Precursor {JJ_MAIN_WINDOW}
|
|
-- Call to force creation of VITP_GAME
|
|
print ("%T VITP_MAIN_WINDOW.create_interface_objects just before creating board_tool %N")
|
|
create board_tool.make (target)
|
|
print ("%T VITP_MAIN_WINDOW.create_interface_objects just before creating chart_tool %N")
|
|
create chart_tool.make (target)
|
|
create sequence_tool.make (target)
|
|
-- create board_tool
|
|
-- create chart_tool
|
|
-- create sequence_tool
|
|
print ("%T end VITP_MAIN_WINDOW.create_interface_objects %N")
|
|
end
|
|
|
|
initialize
|
|
-- Set up the window
|
|
local
|
|
g: VITP_GAME
|
|
do
|
|
print ("VITP_MAIN_WINDOW.initialize %N")
|
|
Precursor {JJ_MAIN_WINDOW}
|
|
split_manager.enable_mode_changes
|
|
split_manager.set_vertical
|
|
-- split_manager.extend (sequence_tool)
|
|
split_manager.extend (board_tool)
|
|
split_manager.set_horizontal
|
|
split_manager.extend (chart_tool)
|
|
-- -- Must `start' the `sequence_of_play' here, not in
|
|
-- -- {VITP_GAME} because of Void safety
|
|
-- create g
|
|
-- g.sequence_of_play.start
|
|
-- set_target (g)
|
|
-- Set window size, etc.
|
|
set_size (1600, 1200)
|
|
set_position (600, 100)
|
|
print ("%T end VITP_MAIN_WINDOW.initialize %N")
|
|
end
|
|
|
|
feature -- Element change
|
|
|
|
set_target (a_game: like target)
|
|
-- Change the target
|
|
do
|
|
Precursor {JJ_MAIN_WINDOW} (a_game)
|
|
board_tool.set_target (a_game)
|
|
chart_tool.set_target (a_game)
|
|
end
|
|
|
|
feature -- Basic operations
|
|
|
|
feature {NONE} -- Implementation
|
|
|
|
board_tool: BOARD_TOOL
|
|
-- Drawing will be done here.
|
|
|
|
chart_tool: CHART_TOOL
|
|
-- Draw the order of appearance charts here
|
|
|
|
sequence_tool: GAME_SEQUENCE_TOOL
|
|
-- Tool containing the view that displays the sequence of play
|
|
|
|
target_imp: detachable VITP_GAME
|
|
-- Implementation of the `target'
|
|
|
|
|
|
end
|