Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/Window-creation/Eiffel/window-creation-1.e
Normal file
19
Task/Window-creation/Eiffel/window-creation-1.e
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
class
|
||||
APPLICATION
|
||||
inherit
|
||||
EV_APPLICATION
|
||||
create
|
||||
make_and_launch
|
||||
feature {NONE} -- Initialization
|
||||
make_and_launch
|
||||
-- Initialize and launch application
|
||||
do
|
||||
default_create
|
||||
create first_window
|
||||
first_window.show
|
||||
launch
|
||||
end
|
||||
feature {NONE} -- Implementation
|
||||
first_window: MAIN_WINDOW
|
||||
-- Main window.
|
||||
end
|
||||
51
Task/Window-creation/Eiffel/window-creation-2.e
Normal file
51
Task/Window-creation/Eiffel/window-creation-2.e
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
class
|
||||
MAIN_WINDOW
|
||||
inherit
|
||||
EV_TITLED_WINDOW
|
||||
redefine
|
||||
initialize
|
||||
end
|
||||
create
|
||||
default_create
|
||||
feature {NONE} -- Initialization
|
||||
initialize
|
||||
-- Build the interface for this window.
|
||||
do
|
||||
-- Call initialize in parent class EV_TITLED_WINDOW
|
||||
Precursor {EV_TITLED_WINDOW}
|
||||
-- Build a container for widgets for this window
|
||||
build_main_container
|
||||
-- Add the container to this window
|
||||
extend (main_container)
|
||||
-- Add `request_close_window' to the actions taken 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 ("Rosetta Code")
|
||||
-- Set the initial size of the window
|
||||
set_size (400, 400)
|
||||
end
|
||||
feature {NONE} -- Implementation, Close event
|
||||
request_close_window
|
||||
-- The user wants to close the window
|
||||
do
|
||||
-- Destroy this window
|
||||
destroy;
|
||||
-- Destroy application
|
||||
(create {EV_ENVIRONMENT}).application.destroy
|
||||
end
|
||||
feature {NONE} -- Implementation
|
||||
main_container: EV_VERTICAL_BOX
|
||||
-- Main container contains all widgets displayed in this window.
|
||||
-- In this case a single text area.
|
||||
build_main_container
|
||||
-- Create and populate `main_container'.
|
||||
require
|
||||
main_container_not_yet_created: main_container = Void
|
||||
do
|
||||
create main_container
|
||||
main_container.extend (create {EV_TEXT})
|
||||
ensure
|
||||
main_container_created: main_container /= Void
|
||||
end
|
||||
end
|
||||
19
Task/Window-creation/Eiffel/window-creation-3.e
Normal file
19
Task/Window-creation/Eiffel/window-creation-3.e
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
class
|
||||
APPLICATION
|
||||
inherit
|
||||
WINFORMS_FORM
|
||||
rename
|
||||
make as make_form
|
||||
end
|
||||
create
|
||||
make
|
||||
feature {NONE} -- Initialization
|
||||
make
|
||||
-- Run application.
|
||||
do
|
||||
-- Set window title
|
||||
set_text ("Rosetta Code")
|
||||
-- Launch application
|
||||
{WINFORMS_APPLICATION}.run_form (Current)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue