jdxi_editor.ui.widgets.combo_box
Submodules
Classes
Custom ComboBox widget with label and value mapping. |
|
A reusable combo box widget with search, category, and bank filtering. |
Package Contents
- class jdxi_editor.ui.widgets.combo_box.ComboBox(label: str, options: list[str], values: list[int] | None = None, parent: object | None = None, show_label: bool = True, tooltip: str = '')[source]
Bases:
PySide6.QtWidgets.QWidgetCustom ComboBox widget with label and value mapping.
- valueChanged
- options
- values = None
- label_widget
- combo_box
- _on_valueChanged(index: int) None[source]
Emit the corresponding value when the selected index changes.
- Parameters:
index – int
- class jdxi_editor.ui.widgets.combo_box.SearchableFilterableComboBox(label: str, options: List[str], values: List[int] | None = None, categories: List[str] | None = None, category_filter_func: Callable[[str, str], bool] | None = None, banks: List[str] | None = None, bank_filter_func: Callable[[str, str], bool] | None = None, show_label: bool = True, show_search: bool = True, show_category: bool = True, show_bank: bool = False, search_placeholder: str = 'Search...', category_label: str = 'Category:', bank_label: str = 'Bank:', search_label: str = 'Search:', use_analog_style: bool = False, parent: jdxi_editor.ui.common.QWidget | None = None)[source]
Bases:
jdxi_editor.ui.common.QWidgetA reusable combo box widget with search, category, and bank filtering.
Maintains proper value mapping when filtered, ensuring MIDI commands are sent correctly regardless of filter state.
Features: - Text search filtering - Category/group filtering - Bank filtering (optional) - Unfilterable mode (show all items) - Proper value mapping for MIDI commands
- valueChanged
- _full_options
- _full_values
- _categories = []
- _category_filter_func
- _banks = []
- _bank_filter_func
- _current_search_text = ''
- _current_category = ''
- _current_bank = ''
- category_combo = None
- bank_combo = None
- add_search(search_label: str, search_placeholder: str, use_analog_style: bool) Any[source]
add search
- _create_search_row(search_label: str, search_placeholder: str, use_analog_style: bool) PySide6.QtWidgets.QHBoxLayout[source]
create search row
- _default_category_filter(option: str, category: str) bool[source]
Default category filter function using substring matching.
- Parameters:
option – Option string to check
category – Category string to match
- Returns:
True if option matches category
- _default_bank_filter(option: str, bank: str) bool[source]
Default bank filter function using substring matching. Checks if the bank letter appears at the start of the option (e.g., “A01 - Program Name”).
- Parameters:
option – Option string to check
bank – Bank string to match
- Returns:
True if option matches bank
- _on_combo_index_changed(filtered_index: int) None[source]
Handle combo box index change.
Emits the original value (not the filtered index) to ensure MIDI commands use the correct value.
- Parameters:
filtered_index – Index in the filtered combo box (may be int or str from Qt)
- setValue(value: int) None[source]
Set the combo box to digital the option with the given value.
This method finds the original index of the value, then finds its position in the filtered list (if any), and sets the combo box index.
- Parameters:
value – The value to set
- value() int[source]
Get the currently selected value (original value, not filtered index).
- Returns:
The original value corresponding to the selected option
- set_options(options: List[str], values: List[int] | None = None, categories: List[str] | None = None, category_filter_func: Callable[[str, str], bool] | None = None) None[source]
Update the combo box with new options, values, and optionally categories.
- Parameters:
options – New list of option strings
values – New list of corresponding integer values (if None, uses indices)
categories – New list of category strings for filtering (optional)
category_filter_func – New category filter function (optional)