indexing description : "Wizard Step." author : "Generated by the Wizard wizard" revision : "1.0.0" class wizard_first_state inherit WIZARD_INTERMEDIARY_STATE_WINDOW redefine update_state_information, proceed_with_current_info, build, pixmap_location, can_go_next end create make feature -- Basic Operation build is -- Build entries. local label_text_vb: EV_VERTICAL_BOX center_hb, hostname_hb, port_hb: EV_HORIZONTAL_BOX space: EV_CELL system: APPLICATION label_width: INTEGER do label_width := 60 system ?= current_application -- create the center horizontal box which is used to center the text_field box in the dialog. create center_hb main_box.extend (center_hb) -- left space of the center box. create space space.set_minimum_width (80) system.add_without_expand (center_hb, space) -- create the vertical box in which the labels and text field boxes are displayed. create label_text_vb system.add_without_expand (center_hb, label_text_vb) -- right space of the center box create space space.set_minimum_width (80) system.add_without_expand (center_hb, space) -- fill label and text field box create hostname_hb system.add_label (hostname_hb, "hostname: ", label_width) create hostname_txt hostname_txt.set_minimum_width_in_characters (20) if system.server_host /= Void then hostname_txt.set_text (system.server_host) end system.add_without_expand (hostname_hb, hostname_txt) system.add_without_expand (label_text_vb, hostname_hb) create port_hb system.add_label (port_hb, "port: ", label_width) create port_txt if system.server_port = 0 then system.set_default_port end port_txt.set_text (system.server_port.out) port_txt.set_minimum_width_in_characters (5) system.add_without_expand (port_hb, port_txt) system.add_without_expand (label_text_vb, port_hb) set_updatable_entries(<>) check_wizard_status end proceed_with_current_info is -- User has clicked next, go to next step. do Precursor proceed_with_new_state(create {WIZARD_SECOND_STATE}.make(wizard_information)) end update_state_information is -- Check User Entries local system: APPLICATION do Precursor -- save entries system ?= current_application if system /= Void then if not hostname_txt.text.is_empty then system.set_server_host (hostname_txt.text) end if not port_txt.text.is_empty and then port_txt.text.is_integer and then port_txt.text.to_integer >= 0 and then port_txt.text.to_integer <= 65535 then system.set_server_port (port_txt.text.to_integer) else system.set_default_port end end end feature -- Queries can_go_next: BOOLEAN is -- returns true if entries are valid; not empty. do Result := not (hostname_txt.text.is_empty or port_txt.text.is_empty) and then port_txt.text.is_integer and then port_txt.text.to_integer >= 0 and then port_txt.text.to_integer <= 65535 end feature {NONE} -- Implementation display_state_text is -- Set the messages for this state. do title.set_text ("Create a new EMU project (Step 1).") subtitle.set_text ("Specify EMU server") message.set_text ("Please enter the hostname and the port of the EMU server.") end feature -- Text fields hostname_txt: EV_TEXT_FIELD -- the text field for the hostname. port_txt: EV_TEXT_FIELD -- the remote port. feature -- Pixmap pixmap_location: FILE_NAME is -- Pixmap location once create Result.make_from_string ("emu_icon_01") Result.add_extension (pixmap_extension) end end -- class wizard_first_state