Transition Windows
Transition windows were added to [EiffelStudio] in version [6.2] and are used to inform the user some action is being performed that may take a few seconds or more. They are visual cues to the user, beyond a simple wait cursor, preventing any other UI interaction whilst some foreground task is being processed.
A few examples of the use of transition windows are:
- Switching between edit/debug profiles.
- Submitting exceptions reports, while the report is being posted.
- Rescanning the code template catalog for changes.
Transition windows however are not to be used in place of a wait cursor. They are for prolonged tasks processed at the users request. Too many transition windows will hinder and annoy rather than simply assist in informing the user. For example, it would see like loading a project calls for a transition window because it can take a few seconds for large projects. However, showing a transition window as the project is loaded seems like it is adding a peripheral step to the opening project process. The are also visual cues that the project is loading from within the IDE and so a transition window here would not be recommended.
Transition windows are shown prior to running a task and are shutdown on the completion of a task.
The Anatomy of a Transition Window
A transition window is composed of three parts; a window, a message and an optional icon. The image below shows the window constituents, each part fully accessible from the ES_POPUP_TRANSITION_WINDOW
interface.
Transition windows are specialized [Popup Windows|pop-up window] but are not susceptible to demanded focusing as with pop-up windows, hence clicking elsewhere in the background will not force with window to close.
Using Transition Windows
There are two usage models for showing and performing actions whilst a transition window is shown. First there is a simplistic approach, letting the transition window do all the work for you, just by setting an action on the window. This approach frees any client from having to retain a reference to a transition window to close it when the action is performed, as
on_submit_report -- Submits a report. local l_thanks: !ES_INFORMATION_PROMPT l_transition: !ES_POPUP_TRANSITION_WINDOW do create l_transition.make_with_icon ( ("Submitting report, please wait...").as_string_32, submit_icon) l_transition.set_action (agent perform_submit) l_transition.show_relative_to_window (dialog) end ... perform_submit -- Performs actual submission. do ... end
Once the action has been performed the transition window will be automatically closed. Because transition windows are based on ESF dialog, they are recycled on closing so no explicit call to recycle
is needed.
The other approach is to call the action, to be processed when the transition window is shown, explicitly and call hide
on the window after the action has been processed.
on_submit_report -- Submits a report. local l_transition: !ES_POPUP_TRANSITION_WINDOW do create l_transition.make_with_icon ( ("Submitting report, please wait...").as_string_32, submit_icon) l_transition.show_relative_to_window (dialog) perform_submit l_transition.hide end