Combobox enhancement: add add_option
and extract_options
functions to allow easier addition/removal of options
#2684
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added
add_option
andextract_options
functions tocombobox
and splitbuild_matcher
(the logic to build a single matcher) out frombuild_matchers
Add option adds a single option to a
combobox
whileextract_options
extracts all options in the current combobox replacing the state with an empty combobox. The intention of these two function is to make it easier and more efficient to add/remove options from a combobox (unfortunately the loose type bounds on T make it impossible to implement a way to remove a chosen option from a combobox) .By way of example the code below allows the user to enter and remove languages from a combobox