Feature #3597
closedAdd a method to WSuggestionPopup to expose the selected hint (if any)
0%
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.
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
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.
Updated by Koen Deforche almost 10 years ago
- Assignee changed from Pavel Sopher to Benoit Daccache
Updated by Benoit Daccache almost 10 years ago
- Status changed from InProgress to Resolved
Updated by Koen Deforche almost 10 years ago
- Status changed from Resolved to Closed