summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorAlexander Gavriliuk <alexandrgproductengine@lindenlab.com>2025-01-24 00:26:00 +0100
committerAlexander Gavriliuk <alexandrgproductengine@lindenlab.com>2025-01-25 03:02:29 +0100
commit7f88aedbc3b53496bc99d8e0e64a818c7a3f6d6f (patch)
tree2877cdffc55025608cfd756ece65a34ddad3dd57 /indra/llui
parent5029f0322f264e17f7509952f7bf9812db17a9ec (diff)
#3423 Add Lua as Compile Target in Viewer Script Editor
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llcombobox.cpp17
-rw-r--r--indra/llui/llcombobox.h5
-rw-r--r--indra/llui/llscrolllistctrl.cpp13
-rw-r--r--indra/llui/llscrolllistctrl.h3
4 files changed, 35 insertions, 3 deletions
diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp
index f3876ef695..17e583b868 100644
--- a/indra/llui/llcombobox.cpp
+++ b/indra/llui/llcombobox.cpp
@@ -251,11 +251,26 @@ void LLComboBox::resetDirty()
}
}
-bool LLComboBox::itemExists(const std::string& name)
+bool LLComboBox::itemExists(const std::string& name) const
{
return mList->getItemByLabel(name);
}
+bool LLComboBox::valueExists(const std::string& value) const
+{
+ return mList->getItemByValue(value);
+}
+
+LLScrollListItem* LLComboBox::findItemByValue(const std::string& value) const
+{
+ return mList->getItemByValue(value);
+}
+
+std::vector<LLScrollListItem*> LLComboBox::getAllData() const
+{
+ return mList->getAllData();
+}
+
// add item "name" to menu
LLScrollListItem* LLComboBox::add(const std::string& name, EAddPosition pos, bool enabled)
{
diff --git a/indra/llui/llcombobox.h b/indra/llui/llcombobox.h
index 8be3eb57e4..be18cdba48 100644
--- a/indra/llui/llcombobox.h
+++ b/indra/llui/llcombobox.h
@@ -143,7 +143,10 @@ public:
LLScrollListItem* addSeparator(EAddPosition pos = ADD_BOTTOM);
bool remove( S32 index ); // remove item by index, return true if found and removed
void removeall() { clearRows(); }
- bool itemExists(const std::string& name);
+ bool itemExists(const std::string& name) const;
+ bool valueExists(const std::string& value) const;
+ LLScrollListItem* findItemByValue(const std::string& value) const;
+ std::vector<LLScrollListItem*> getAllData() const;
void sortByName(bool ascending = true); // Sort the entries in the combobox by name
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index 93bd3c6bed..deaf2fe188 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -1281,6 +1281,19 @@ LLScrollListItem* LLScrollListCtrl::getItemByLabel(const std::string& label, boo
return NULL;
}
+LLScrollListItem* LLScrollListCtrl::getItemByValue(const std::string& value)
+{
+ for (LLScrollListItem* item : mItemList)
+ {
+ if (item->getValue().asString() == value)
+ {
+ return item;
+ }
+ }
+
+ return NULL;
+}
+
LLScrollListItem* LLScrollListCtrl::getItemByIndex(S32 index)
{
if (index >= 0 && index < (S32)mItemList.size())
diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h
index c24784338a..70d4a75fb5 100644
--- a/indra/llui/llscrolllistctrl.h
+++ b/indra/llui/llscrolllistctrl.h
@@ -263,7 +263,8 @@ public:
bool selectItemByLabel(const std::string& item, bool case_sensitive = true, S32 column = 0); // false if item not found
bool selectItemByPrefix(const std::string& target, bool case_sensitive = true, S32 column = -1);
bool selectItemByPrefix(const LLWString& target, bool case_sensitive = true, S32 column = -1);
- LLScrollListItem* getItemByLabel(const std::string& item, bool case_sensitive = true, S32 column = 0);
+ LLScrollListItem* getItemByLabel(const std::string& label, bool case_sensitive = true, S32 column = 0);
+ LLScrollListItem* getItemByValue(const std::string& value);
LLScrollListItem* getItemByIndex(S32 index);
std::string getSelectedItemLabel(S32 column = 0) const;
LLSD getSelectedValue();