Ticket #610 (closed Enhancement: fixed)

Opened 7 years ago

Last modified 7 years ago

GUIToolkit: make the Dialog class more comfortable

Reported by: jri Owned by: jri
Priority: Major Milestone: Release 4.2
Component: DeepaMehta Standard Distribution Version: 4.1.3
Keywords: Cc: dgf, Malte
Complexity: 3 Area: Application Framework / API
Module: deepamehta-webclient

Description

The caller of dm4c.ui.dialog() should not be required to

  1. care about closing the dialog
  2. handle the return key (as an alternative way to invoke the dialog handler)

Change History

comment:1 Changed 7 years ago by jri

  • Status changed from new to accepted

comment:2 Changed 7 years ago by Jörg Richter

Webclient GUITookit: revise dialog closing (#610).

GUIToolkit's Dialog handling is simplified.

In standard cases the caller of dm4c.ui.dialog() ...

  1. must no longer care about closing the dialog. The dialog is closed automatically, provided it has a button (and thus a button handler). If it has no button, it's still up to the caller to care about closing. If the caller supplies a button handler but want handle closing itself she can use the new auto_close config setting:
    dm4c.ui.dialog({
        ...
        auto_close: false
    })
    

auto_close controls if the button closes the dialog (boolean). Default is true. If false is specified the caller is responsible for closing the dialog. The auto_close value has only a meaning when a button is supplied as well.

As a consequence in standard cases the caller is not required anymore to store the Dialog object in a temporary variable.

  1. must no longer care about binding a Return key listener to any dialog input element. The dialog invokes the button handler automatically when Return is pressed inside the dialog, provided the dialog has a button (and thus a button handler). If no button handler is supplied the caller still must bind a key listener itself (in case Return key behavior is demanded). If a button handler is supplied, but the caller want prevent its invocation on Return, she must bind a key listener and stop propagation (be returning false).

CHANGES

Webclient API:

Callers of dm4c.on_return_key() can stop event propagation by returning false from the callback function passed.

BREAKING CHANGES

GUIToolkit API:

2nd argument of dialog.close(), the callback, is dropped.

For other recent breaking changes related to the Dialog API see #583.

See #610.

comment:3 Changed 7 years ago by jri

  • Status changed from accepted to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.