Project

General

Profile

Actions

Feature #3597

closed

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

Added by Vincenzo Romano about 10 years ago. Updated over 9 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.

Actions #1

Updated by Koen Deforche about 10 years ago

  • Status changed from New to InProgress
  • Assignee set to Koen Deforche
  • Target version set to 3.3.4
Actions #2

Updated by Koen Deforche about 10 years ago

  • Assignee changed from Koen Deforche to Pavel Sopher
  • Trigger WLineEdit::changed() when a suggestion popup alters its value
  • Add a method int WSuggestionPopup::currentItem() which returns the last activated item index.
Actions #3

Updated by Koen Deforche over 9 years ago

  • Assignee changed from Pavel Sopher to Benoit Daccache
Actions #4

Updated by Benoit Daccache over 9 years ago

  • Status changed from InProgress to Resolved
Actions #5

Updated by Koen Deforche over 9 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF