diff options
| author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2026-04-01 19:23:41 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-01 19:23:41 +0300 |
| commit | b4f1072a492f5baa8338bd1a5dc2d87ccfacc086 (patch) | |
| tree | 40c12699f5642475ff71461f2b6b08081a834e8b /indra/llui | |
| parent | a77156ebbdfa61a9c88437a61b78f986e191ac80 (diff) | |
#5367 Leap API support for combo boxes
Diffstat (limited to 'indra/llui')
| -rw-r--r-- | indra/llui/llcombobox.cpp | 33 | ||||
| -rw-r--r-- | indra/llui/llcombobox.h | 4 |
2 files changed, 37 insertions, 0 deletions
diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index ae676251ff..01463b4962 100644 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -1323,6 +1323,39 @@ bool LLComboBox::selectItemRange( S32 first, S32 last ) return mList->selectItemRange(first, last); } +void LLComboBox::addInfo(LLSD& info) +{ + LLUICtrl::addInfo(info); + + if (mList && mList->getItemCount() > 0) + { + LLSD items_array; + std::vector<LLScrollListItem*> item_list = mList->getAllData(); + for (std::vector<LLScrollListItem*>::iterator iter = item_list.begin(); iter != item_list.end(); ++iter) + { + if (LLScrollListItem* item = *iter) + { + LLSD item_info; + item_info["value"] = item->getValue(); + if (item->getNumColumns() > 0) + { + if (LLScrollListCell* cell = item->getColumn(0)) + { + item_info["label"] = cell->getValue(); + } + } + items_array.append(item_info); + } + } + info["items"] = items_array; + info["item_count"] = mList->getItemCount(); + info["current_selection"] = getSelectedItemLabel(); + } + else + { + info["item_count"] = 0; + } +} static LLDefaultChildRegistry::Register<LLIconsComboBox> register_icons_combo_box("icons_combo_box"); diff --git a/indra/llui/llcombobox.h b/indra/llui/llcombobox.h index d6ea1202d3..dad60ffb65 100644 --- a/indra/llui/llcombobox.h +++ b/indra/llui/llcombobox.h @@ -219,6 +219,10 @@ public: void setButtonVisible(bool visible); + // Populates the provided LLSD with combo box-specific information(list of items, item count, current selection label) + // also includes base LLUICtrl information via parent class + void addInfo(LLSD & info); + void onButtonMouseDown(); void onListMouseUp(); void onItemSelected(const LLSD& data); |
