Difference between revisions of "Transition Windows"

 
m
Line 13: Line 13:
  
 
Transition windows are shown prior to running a task and are shutdown on the completion of a task.
 
Transition windows are shown prior to running a task and are shutdown on the completion of a task.
 +
 +
== 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
 +
 +
<e>
 +
  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)
 +
 +
      create l_thanks.make_standard ("Thank you for submitting the report.")
 +
      l_thanks.set_sub_title ("Thank You!")
 +
      l_thanks.show (dialog)
 +
    end
 +
 +
  ...
 +
 +
  perform_submit
 +
      -- Performs actual submission.
 +
    do
 +
      ...
 +
    end
 +
</e>
 +
 +
<e>
 +
<e>
 +
  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.show_relative_to_window (dialog)
 +
      perform_submit
 +
      l_transition.hide
 +
 +
      create l_thanks.make_standard ("Thank you for submitting the report.")
 +
      l_thanks.set_sub_title ("Thank You!")
 +
      l_thanks.show (dialog)
 +
    end
 +
</e>

Revision as of 08:16, 14 May 2008

Construction.png Not Ready for Review: This Page is Under Development!

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.

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)
 
      create l_thanks.make_standard ("Thank you for submitting the report.")
      l_thanks.set_sub_title ("Thank You!")
      l_thanks.show (dialog)
    end
 
  ...
 
  perform_submit
      -- Performs actual submission.
    do
      ...
    end
<e>
  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.show_relative_to_window (dialog)
      perform_submit
      l_transition.hide
 
      create l_thanks.make_standard ("Thank you for submitting the report.")
      l_thanks.set_sub_title ("Thank You!")
      l_thanks.show (dialog)
    end