diff options
author | Monroe Williams <monroe@lindenlab.com> | 2007-08-02 01:18:34 +0000 |
---|---|---|
committer | Monroe Williams <monroe@lindenlab.com> | 2007-08-02 01:18:34 +0000 |
commit | 7138fb673ac3df46b9cb5f23d0d74e70fdd2b6b3 (patch) | |
tree | 3c34a3a180b5275bd4166b0056765c5868f56447 /indra/llui/llradiogroup.cpp | |
parent | f6a10b3214d79df4e8f5768acaa68edbd2de5620 (diff) |
Merge down from Branch_1-18-1:
svn merge --ignore-ancestry svn+ssh://svn.lindenlab.com/svn/linden/release@66449 svn+ssh://svn.lindenlab.com/svn/linden/branches/Branch_1-18-1@67131
Diffstat (limited to 'indra/llui/llradiogroup.cpp')
-rw-r--r-- | indra/llui/llradiogroup.cpp | 66 |
1 files changed, 65 insertions, 1 deletions
diff --git a/indra/llui/llradiogroup.cpp b/indra/llui/llradiogroup.cpp index 69c0da6933..b58ae09b5d 100644 --- a/indra/llui/llradiogroup.cpp +++ b/indra/llui/llradiogroup.cpp @@ -149,7 +149,7 @@ BOOL LLRadioGroup::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) { BOOL handled = FALSE; // do any of the tab buttons have keyboard focus? - if (getEnabled() && !called_from_parent) + if (getEnabled() && !called_from_parent && mask == MASK_NONE) { switch(key) { @@ -421,6 +421,69 @@ LLView* LLRadioGroup::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory return radio_group; } +// LLCtrlSelectionInterface functions +BOOL LLRadioGroup::setCurrentByID( const LLUUID& id ) +{ + return FALSE; +} + +LLUUID LLRadioGroup::getCurrentID() +{ + return LLUUID::null; +} + +BOOL LLRadioGroup::setSelectedByValue(LLSD value, BOOL selected) +{ + S32 idx = 0; + std::string value_string = value.asString(); + for (button_list_t::const_iterator iter = mRadioButtons.begin(); + iter != mRadioButtons.end(); ++iter) + { + if((*iter)->getName() == value_string) + { + setSelectedIndex(idx); + return TRUE; + } + idx++; + } + + return FALSE; +} + +LLSD LLRadioGroup::getSimpleSelectedValue() +{ + return getValue(); +} + +BOOL LLRadioGroup::isSelected(LLSD value) +{ + S32 idx = 0; + std::string value_string = value.asString(); + for (button_list_t::const_iterator iter = mRadioButtons.begin(); + iter != mRadioButtons.end(); ++iter) + { + if((*iter)->getName() == value_string) + { + if (idx == mSelectedIndex) + { + return TRUE; + } + } + idx++; + } + return FALSE; +} + +BOOL LLRadioGroup::operateOnSelection(EOperation op) +{ + return FALSE; +} + +BOOL LLRadioGroup::operateOnAll(EOperation op) +{ + return FALSE; +} + LLRadioCtrl::LLRadioCtrl(const LLString& name, const LLRect& rect, const LLString& label, const LLFontGL* font, void (*commit_callback)(LLUICtrl*, void*), void* callback_userdata) : @@ -438,3 +501,4 @@ void LLRadioCtrl::setValue(const LLSD& value) LLCheckBoxCtrl::setValue(value); mButton->setTabStop(value.asBoolean()); } + |