summaryrefslogtreecommitdiff
path: root/indra/llui/llcombobox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/llcombobox.cpp')
-rw-r--r--indra/llui/llcombobox.cpp150
1 files changed, 75 insertions, 75 deletions
diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp
index 9ca05a16f3..07d1be3762 100644
--- a/indra/llui/llcombobox.cpp
+++ b/indra/llui/llcombobox.cpp
@@ -171,13 +171,13 @@ void LLComboBox::initFromParams(const LLComboBox::Params& p)
}
// virtual
-BOOL LLComboBox::postBuild()
+bool LLComboBox::postBuild()
{
if (mControlVariable)
{
setValue(mControlVariable->getValue()); // selects the appropriate item
}
- return TRUE;
+ return true;
}
@@ -210,16 +210,16 @@ void LLComboBox::onCommit()
// we have selected an existing item, blitz the manual text entry with
// the properly capitalized item
mTextEntry->setValue(getSimple());
- mTextEntry->setTentative(FALSE);
+ mTextEntry->setTentative(false);
}
setControlValue(getValue());
LLUICtrl::onCommit();
}
// virtual
-BOOL LLComboBox::isDirty() const
+bool LLComboBox::isDirty() const
{
- BOOL grubby = FALSE;
+ bool grubby = false;
if ( mList )
{
grubby = mList->isDirty();
@@ -242,7 +242,7 @@ bool LLComboBox::itemExists(const std::string& name)
}
// add item "name" to menu
-LLScrollListItem* LLComboBox::add(const std::string& name, EAddPosition pos, BOOL enabled)
+LLScrollListItem* LLComboBox::add(const std::string& name, EAddPosition pos, bool enabled)
{
LLScrollListItem* item = mList->addSimpleElement(name, pos);
item->setEnabled(enabled);
@@ -261,7 +261,7 @@ LLScrollListItem* LLComboBox::add(const std::string& name, EAddPosition pos, BOO
}
// add item "name" with a unique id to menu
-LLScrollListItem* LLComboBox::add(const std::string& name, const LLUUID& id, EAddPosition pos, BOOL enabled )
+LLScrollListItem* LLComboBox::add(const std::string& name, const LLUUID& id, EAddPosition pos, bool enabled )
{
LLScrollListItem* item = mList->addSimpleElement(name, pos, id);
item->setEnabled(enabled);
@@ -280,7 +280,7 @@ LLScrollListItem* LLComboBox::add(const std::string& name, const LLUUID& id, EAd
}
// add item "name" with attached userdata
-LLScrollListItem* LLComboBox::add(const std::string& name, void* userdata, EAddPosition pos, BOOL enabled )
+LLScrollListItem* LLComboBox::add(const std::string& name, void* userdata, EAddPosition pos, bool enabled )
{
LLScrollListItem* item = mList->addSimpleElement(name, pos);
item->setEnabled(enabled);
@@ -300,7 +300,7 @@ LLScrollListItem* LLComboBox::add(const std::string& name, void* userdata, EAddP
}
// add item "name" with attached generic data
-LLScrollListItem* LLComboBox::add(const std::string& name, LLSD value, EAddPosition pos, BOOL enabled )
+LLScrollListItem* LLComboBox::add(const std::string& name, LLSD value, EAddPosition pos, bool enabled )
{
LLScrollListItem* item = mList->addSimpleElement(name, pos, value);
item->setEnabled(enabled);
@@ -323,17 +323,17 @@ LLScrollListItem* LLComboBox::addSeparator(EAddPosition pos)
return mList->addSeparator(pos);
}
-void LLComboBox::sortByName(BOOL ascending)
+void LLComboBox::sortByName(bool ascending)
{
mList->sortOnce(0, ascending);
}
// Choose an item with a given name in the menu.
-// Returns TRUE if the item was found.
-BOOL LLComboBox::setSimple(const LLStringExplicit& name)
+// Returns true if the item was found.
+bool LLComboBox::setSimple(const LLStringExplicit& name)
{
- BOOL found = mList->selectItemByLabel(name, FALSE);
+ bool found = mList->selectItemByLabel(name, false);
if (found)
{
@@ -347,7 +347,7 @@ BOOL LLComboBox::setSimple(const LLStringExplicit& name)
// virtual
void LLComboBox::setValue(const LLSD& value)
{
- BOOL found = mList->selectByValue(value);
+ bool found = mList->selectByValue(value);
if (found)
{
LLScrollListItem* item = mList->getFirstSelected();
@@ -404,9 +404,9 @@ void LLComboBox::setLabel(const LLStringExplicit& name)
if ( mTextEntry )
{
mTextEntry->setText(name);
- if (mList->selectItemByLabel(name, FALSE))
+ if (mList->selectItemByLabel(name, false))
{
- mTextEntry->setTentative(FALSE);
+ mTextEntry->setTentative(false);
mLastSelectedIndex = mList->getFirstSelectedIndex();
}
else
@@ -428,7 +428,7 @@ void LLComboBox::updateLabel()
if (mTextEntry)
{
mTextEntry->setText(getSelectedItemLabel());
- mTextEntry->setTentative(FALSE);
+ mTextEntry->setTentative(false);
}
// If combo box doesn't allow text entry update
@@ -439,9 +439,9 @@ void LLComboBox::updateLabel()
}
}
-BOOL LLComboBox::remove(const std::string& name)
+bool LLComboBox::remove(const std::string& name)
{
- BOOL found = mList->selectItemByLabel(name);
+ bool found = mList->selectItemByLabel(name);
if (found)
{
@@ -456,15 +456,15 @@ BOOL LLComboBox::remove(const std::string& name)
return found;
}
-BOOL LLComboBox::remove(S32 index)
+bool LLComboBox::remove(S32 index)
{
if (index < mList->getItemCount())
{
mList->deleteSingleItem(index);
setLabel(getSelectedItemLabel());
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
// Keyboard focus lost.
@@ -480,7 +480,7 @@ void LLComboBox::onFocusLost()
LLUICtrl::onFocusLost();
}
-void LLComboBox::setButtonVisible(BOOL visible)
+void LLComboBox::setButtonVisible(bool visible)
{
static LLUICachedControl<S32> drop_shadow_button ("DropShadowButton", 0);
@@ -494,13 +494,13 @@ void LLComboBox::setButtonVisible(BOOL visible)
text_entry_rect.mRight -= llmax(8,arrow_width) + 2 * drop_shadow_button;
}
//mTextEntry->setRect(text_entry_rect);
- mTextEntry->reshape(text_entry_rect.getWidth(), text_entry_rect.getHeight(), TRUE);
+ mTextEntry->reshape(text_entry_rect.getWidth(), text_entry_rect.getHeight(), true);
}
}
-BOOL LLComboBox::setCurrentByIndex( S32 index )
+bool LLComboBox::setCurrentByIndex( S32 index )
{
- BOOL found = mList->selectNthItem( index );
+ bool found = mList->selectNthItem( index );
if (found)
{
setLabel(getSelectedItemLabel());
@@ -519,7 +519,7 @@ S32 LLComboBox::getCurrentIndex() const
return -1;
}
-void LLComboBox::setEnabledByValue(const LLSD& value, BOOL enabled)
+void LLComboBox::setEnabledByValue(const LLSD& value, bool enabled)
{
LLScrollListItem *found = mList->getItem(value);
if (found)
@@ -538,7 +538,7 @@ void LLComboBox::createLineEditor(const LLComboBox::Params& p)
S32 shadow_size = drop_shadow_button;
mButton->setRect(LLRect( getRect().getWidth() - llmax(8,arrow_width) - 2 * shadow_size,
rect.mTop, rect.mRight, rect.mBottom));
- mButton->setTabStop(FALSE);
+ mButton->setTabStop(false);
mButton->setHAlign(LLFontGL::HCENTER);
LLRect text_entry_rect(0, getRect().getHeight(), getRect().getWidth(), 0);
@@ -556,7 +556,7 @@ void LLComboBox::createLineEditor(const LLComboBox::Params& p)
params.label(mLabel);
mTextEntry = LLUICtrlFactory::create<LLLineEditor> (params);
mTextEntry->setText(cur_label);
- mTextEntry->setIgnoreTab(TRUE);
+ mTextEntry->setIgnoreTab(true);
addChild(mTextEntry);
// clear label on button
@@ -571,7 +571,7 @@ void LLComboBox::createLineEditor(const LLComboBox::Params& p)
if (mTextEntry)
{
- mTextEntry->setVisible(FALSE);
+ mTextEntry->setVisible(false);
}
}
}
@@ -675,15 +675,15 @@ void LLComboBox::showList()
// NB: this call will trigger the focuslost callback which will hide the list, so do it first
// before finally showing the list
- mList->setFocus(TRUE);
+ mList->setFocus(true);
// Show the list and push the button down
- mButton->setToggleState(TRUE);
- mList->setVisible(TRUE);
+ mButton->setToggleState(true);
+ mList->setVisible(true);
LLUI::getInstance()->addPopup(this);
- setUseBoundingRect(TRUE);
+ setUseBoundingRect(true);
// updateBoundingRect();
}
@@ -702,11 +702,11 @@ void LLComboBox::hideList()
else if(mLastSelectedIndex >= 0)
mList->selectNthItem(mLastSelectedIndex);
- mButton->setToggleState(FALSE);
- mList->setVisible(FALSE);
+ mButton->setToggleState(false);
+ mList->setVisible(false);
mList->mouseOverHighlightNthItem(-1);
- setUseBoundingRect(FALSE);
+ setUseBoundingRect(false);
LLUI::getInstance()->removePopup(this);
// updateBoundingRect();
}
@@ -732,7 +732,7 @@ void LLComboBox::onButtonMouseDown()
showList();
}
- setFocus( TRUE );
+ setFocus( true );
// pass mouse capture on to list if button is depressed
if (mButton->hasMouseCapture())
@@ -782,13 +782,13 @@ void LLComboBox::onItemSelected(const LLSD& data)
onCommit();
}
-BOOL LLComboBox::handleToolTip(S32 x, S32 y, MASK mask)
+bool LLComboBox::handleToolTip(S32 x, S32 y, MASK mask)
{
std::string tool_tip;
if(LLUICtrl::handleToolTip(x, y, mask))
{
- return TRUE;
+ return true;
}
tool_tip = getToolTip();
@@ -803,19 +803,19 @@ BOOL LLComboBox::handleToolTip(S32 x, S32 y, MASK mask)
.message(tool_tip)
.sticky_rect(calcScreenRect()));
}
- return TRUE;
+ return true;
}
-BOOL LLComboBox::handleKeyHere(KEY key, MASK mask)
+bool LLComboBox::handleKeyHere(KEY key, MASK mask)
{
- BOOL result = FALSE;
+ bool result = false;
if (hasFocus())
{
if (mList->getVisible()
&& key == KEY_ESCAPE && mask == MASK_NONE)
{
hideList();
- return TRUE;
+ return true;
}
//give list a chance to pop up and handle key
LLScrollListItem* last_selected_item = mList->getLastSelectedItem();
@@ -838,7 +838,7 @@ BOOL LLComboBox::handleKeyHere(KEY key, MASK mask)
// don't show list and don't eat key input when committing
// free-form text entry with RETURN since user already knows
// what they are trying to select
- return FALSE;
+ return false;
}
// if selection has changed, pop open list
else if (mList->getLastSelectedItem() != last_selected_item
@@ -852,9 +852,9 @@ BOOL LLComboBox::handleKeyHere(KEY key, MASK mask)
return result;
}
-BOOL LLComboBox::handleUnicodeCharHere(llwchar uni_char)
+bool LLComboBox::handleUnicodeCharHere(llwchar uni_char)
{
- BOOL result = FALSE;
+ bool result = false;
if (gFocusMgr.childHasKeyboardFocus(this))
{
// space bar just shows the list
@@ -881,12 +881,12 @@ void LLComboBox::setTextEntry(const LLStringExplicit& text)
if (mTextEntry)
{
mTextEntry->setText(text);
- mHasAutocompletedText = FALSE;
+ mHasAutocompletedText = false;
updateSelection();
}
}
-void LLComboBox::setKeystrokeOnEsc(BOOL enable)
+void LLComboBox::setKeystrokeOnEsc(bool enable)
{
if (mTextEntry)
{
@@ -905,9 +905,9 @@ void LLComboBox::onTextEntry(LLLineEditor* line_editor)
if (key == KEY_BACKSPACE ||
key == KEY_DELETE)
{
- if (mList->selectItemByLabel(line_editor->getText(), FALSE))
+ if (mList->selectItemByLabel(line_editor->getText(), false))
{
- line_editor->setTentative(FALSE);
+ line_editor->setTentative(false);
mLastSelectedIndex = mList->getFirstSelectedIndex();
}
else
@@ -942,7 +942,7 @@ void LLComboBox::onTextEntry(LLLineEditor* line_editor)
}
}
line_editor->selectAll();
- line_editor->setTentative(FALSE);
+ line_editor->setTentative(false);
}
else if (key == KEY_UP)
{
@@ -957,7 +957,7 @@ void LLComboBox::onTextEntry(LLLineEditor* line_editor)
}
}
line_editor->selectAll();
- line_editor->setTentative(FALSE);
+ line_editor->setTentative(false);
}
else
{
@@ -986,20 +986,20 @@ void LLComboBox::updateSelection()
prearrangeList(mTextEntry->getText());
}
- if (mList->selectItemByLabel(full_string, FALSE))
+ if (mList->selectItemByLabel(full_string, false))
{
- mTextEntry->setTentative(FALSE);
+ mTextEntry->setTentative(false);
mLastSelectedIndex = mList->getFirstSelectedIndex();
}
- else if (mList->selectItemByPrefix(left_wstring, FALSE))
+ else if (mList->selectItemByPrefix(left_wstring, false))
{
LLWString selected_item = utf8str_to_wstring(getSelectedItemLabel());
LLWString wtext = left_wstring + selected_item.substr(left_wstring.size(), selected_item.size());
mTextEntry->setText(wstring_to_utf8str(wtext));
mTextEntry->setSelection(left_wstring.size(), mTextEntry->getWText().size());
mTextEntry->endSelection();
- mTextEntry->setTentative(FALSE);
- mHasAutocompletedText = TRUE;
+ mTextEntry->setTentative(false);
+ mHasAutocompletedText = true;
mLastSelectedIndex = mList->getFirstSelectedIndex();
}
else // no matching items found
@@ -1007,7 +1007,7 @@ void LLComboBox::updateSelection()
mList->deselectAllItems();
mTextEntry->setText(wstring_to_utf8str(user_wstring)); // removes text added by autocompletion
mTextEntry->setTentative(mTextEntryTentative);
- mHasAutocompletedText = FALSE;
+ mHasAutocompletedText = false;
mLastSelectedIndex = -1;
}
}
@@ -1020,7 +1020,7 @@ void LLComboBox::onTextCommit(const LLSD& data)
mTextEntry->selectAll();
}
-void LLComboBox::setFocus(BOOL b)
+void LLComboBox::setFocus(bool b)
{
LLUICtrl::setFocus(b);
@@ -1029,7 +1029,7 @@ void LLComboBox::setFocus(BOOL b)
mList->clearSearchString();
if (mList->getVisible())
{
- mList->setFocus(TRUE);
+ mList->setFocus(true);
}
}
}
@@ -1097,7 +1097,7 @@ void LLComboBox::imageLoaded()
{
LLRect text_entry_rect(0, getRect().getHeight(), getRect().getWidth(), 0);
text_entry_rect.mRight -= llmax(8, arrow_width) + 2 * drop_shadow_button;
- mTextEntry->reshape(text_entry_rect.getWidth(), text_entry_rect.getHeight(), TRUE);
+ mTextEntry->reshape(text_entry_rect.getWidth(), text_entry_rect.getHeight(), true);
}
}
}
@@ -1142,7 +1142,7 @@ void LLComboBox::clearRows()
mList->clearRows();
}
-void LLComboBox::sortByColumn(const std::string& name, BOOL ascending)
+void LLComboBox::sortByColumn(const std::string& name, bool ascending)
{
mList->sortByColumn(name, ascending);
}
@@ -1150,9 +1150,9 @@ void LLComboBox::sortByColumn(const std::string& name, BOOL ascending)
//============================================================================
//LLCtrlSelectionInterface functions
-BOOL LLComboBox::setCurrentByID(const LLUUID& id)
+bool LLComboBox::setCurrentByID(const LLUUID& id)
{
- BOOL found = mList->selectByID( id );
+ bool found = mList->selectByID( id );
if (found)
{
@@ -1167,9 +1167,9 @@ LLUUID LLComboBox::getCurrentID() const
{
return mList->getStringUUIDSelectedItem();
}
-BOOL LLComboBox::setSelectedByValue(const LLSD& value, BOOL selected)
+bool LLComboBox::setSelectedByValue(const LLSD& value, bool selected)
{
- BOOL found = mList->setSelectedByValue(value, selected);
+ bool found = mList->setSelectedByValue(value, selected);
if (found)
{
setLabel(getSelectedItemLabel());
@@ -1182,32 +1182,32 @@ LLSD LLComboBox::getSelectedValue()
return mList->getSelectedValue();
}
-BOOL LLComboBox::isSelected(const LLSD& value) const
+bool LLComboBox::isSelected(const LLSD& value) const
{
return mList->isSelected(value);
}
-BOOL LLComboBox::operateOnSelection(EOperation op)
+bool LLComboBox::operateOnSelection(EOperation op)
{
if (op == OP_DELETE)
{
mList->deleteSelectedItems();
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-BOOL LLComboBox::operateOnAll(EOperation op)
+bool LLComboBox::operateOnAll(EOperation op)
{
if (op == OP_DELETE)
{
clearRows();
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-BOOL LLComboBox::selectItemRange( S32 first, S32 last )
+bool LLComboBox::selectItemRange( S32 first, S32 last )
{
return mList->selectItemRange(first, last);
}