Project

General

Profile

Feature #3597

Add a method to WSuggestionPopup to expose the selected hint (if any)

Added by Vincenzo Romano about 8 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Low
Assignee:
Benoit Daccache
Target version:
Start date:
09/20/2014
Due date:
% Done:

0%

Estimated time:

Description

Currently the selected hint is known only to the signal handler, not to the class itself.

This makes WSuggestionPopup different from most of other interaction widgets that can usually be inspected to know the current status.

This in turn makes the use of a lambda function as signal handler proxy impossible thus requiring a (uselessly) complex class dependence architecture to let the info reach the handler.

Things get complicated especially when all the logics and data is handled and known to a single class.

class Handler; // Handles the data, the events and coordinates the general behaviour

class MyCheckBox: Wt::WCheckBox {
  MyCheckBox( Handler* handler ): Wt::WCheckBox( ... ) {
    ...
    changed().connect( std::bind( [=]() { handler->checkBoxHandler( this ); } ) ); // This works!
  }
};

class MyPopUp: Wt::Wt::WFormWidget {
  MyPopUp( Handler* handler ): WSuggestionPopup( .. ) {
    ...
    activated().connect( std::bind( [=]() { handler->popupHandler( this ); } ) ); // This won't!
  }
}

As of now the Handler::popupHandler() method won't know anything about the actual hint selected, while the Handler::checkBoxHandler() will.

As an option, the WFormWidget linked to the WSuggestionPopup should in turn fire an event as soon as the WSuggestionPopup fills the text in.

In this case the WLIneEdit signal handler could react to the new input passwd by the WSuggestionPopup.

Currently this only happens upon actual user editing.

Also available in: Atom PDF