From 117e22047c5752352342d64e3fb7ce00a4eb8113 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:45:04 -0500 Subject: Second Life viewer sources 1.18.1.2 --- linden/indra/llui/llradiogroup.cpp | 66 +++++++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) (limited to 'linden/indra/llui/llradiogroup.cpp') diff --git a/linden/indra/llui/llradiogroup.cpp b/linden/indra/llui/llradiogroup.cpp index eda54b1..0104998 100644 --- a/linden/indra/llui/llradiogroup.cpp +++ b/linden/indra/llui/llradiogroup.cpp @@ -169,7 +169,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) { @@ -441,6 +441,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) : @@ -458,3 +521,4 @@ void LLRadioCtrl::setValue(const LLSD& value) LLCheckBoxCtrl::setValue(value); mButton->setTabStop(value.asBoolean()); } + -- cgit v1.1