aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/llradiogroup.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:34 -0500
committerJacek Antonelli2008-08-15 23:45:34 -0500
commitcd17687f01420952712a500107e0f93e7ab8d5f8 (patch)
treece48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/llui/llradiogroup.cpp
parentSecond Life viewer sources 1.19.0.5 (diff)
downloadmeta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz
Second Life viewer sources 1.19.1.0
Diffstat (limited to 'linden/indra/llui/llradiogroup.cpp')
-rw-r--r--linden/indra/llui/llradiogroup.cpp28
1 files changed, 8 insertions, 20 deletions
diff --git a/linden/indra/llui/llradiogroup.cpp b/linden/indra/llui/llradiogroup.cpp
index dad1941..039fe81 100644
--- a/linden/indra/llui/llradiogroup.cpp
+++ b/linden/indra/llui/llradiogroup.cpp
@@ -29,9 +29,6 @@
29 * $/LicenseInfo$ 29 * $/LicenseInfo$
30 */ 30 */
31 31
32// An invisible view containing multiple mutually exclusive toggling
33// buttons (usually radio buttons). Automatically handles the mutex
34// condition by highlighting only one button at a time.
35 32
36#include "linden_common.h" 33#include "linden_common.h"
37 34
@@ -45,6 +42,7 @@
45#include "llui.h" 42#include "llui.h"
46#include "llfocusmgr.h" 43#include "llfocusmgr.h"
47 44
45
48LLRadioGroup::LLRadioGroup(const LLString& name, const LLRect& rect, 46LLRadioGroup::LLRadioGroup(const LLString& name, const LLRect& rect,
49 const LLString& control_name, 47 const LLString& control_name,
50 LLUICtrlCallback callback, 48 LLUICtrlCallback callback,
@@ -73,7 +71,7 @@ void LLRadioGroup::init(BOOL border)
73 if (border) 71 if (border)
74 { 72 {
75 addChild( new LLViewBorder( "radio group border", 73 addChild( new LLViewBorder( "radio group border",
76 LLRect(0, mRect.getHeight(), mRect.getWidth(), 0), 74 LLRect(0, getRect().getHeight(), getRect().getWidth(), 0),
77 LLViewBorder::BEVEL_NONE, 75 LLViewBorder::BEVEL_NONE,
78 LLViewBorder::STYLE_LINE, 76 LLViewBorder::STYLE_LINE,
79 1 ) ); 77 1 ) );
@@ -146,11 +144,6 @@ void LLRadioGroup::setIndexEnabled(S32 index, BOOL enabled)
146 } 144 }
147} 145}
148 146
149S32 LLRadioGroup::getSelectedIndex() const
150{
151 return mSelectedIndex;
152}
153
154BOOL LLRadioGroup::setSelectedIndex(S32 index, BOOL from_event) 147BOOL LLRadioGroup::setSelectedIndex(S32 index, BOOL from_event)
155{ 148{
156 if (index < 0 || index >= (S32)mRadioButtons.size()) 149 if (index < 0 || index >= (S32)mRadioButtons.size())
@@ -245,7 +238,9 @@ void LLRadioGroup::draw()
245 radio->setValue( selected ); 238 radio->setValue( selected );
246 if (take_focus && selected && !gFocusMgr.childHasKeyboardFocus(radio)) 239 if (take_focus && selected && !gFocusMgr.childHasKeyboardFocus(radio))
247 { 240 {
248 radio->focusFirstItem(); 241 // don't flash keyboard focus when navigating via keyboard
242 BOOL DONT_FLASH = FALSE;
243 radio->focusFirstItem(FALSE, DONT_FLASH);
249 } 244 }
250 current_button++; 245 current_button++;
251 } 246 }
@@ -450,12 +445,12 @@ BOOL LLRadioGroup::setCurrentByID( const LLUUID& id )
450 return FALSE; 445 return FALSE;
451} 446}
452 447
453LLUUID LLRadioGroup::getCurrentID() 448LLUUID LLRadioGroup::getCurrentID() const
454{ 449{
455 return LLUUID::null; 450 return LLUUID::null;
456} 451}
457 452
458BOOL LLRadioGroup::setSelectedByValue(LLSD value, BOOL selected) 453BOOL LLRadioGroup::setSelectedByValue(const LLSD& value, BOOL selected)
459{ 454{
460 S32 idx = 0; 455 S32 idx = 0;
461 std::string value_string = value.asString(); 456 std::string value_string = value.asString();
@@ -478,7 +473,7 @@ LLSD LLRadioGroup::getSelectedValue()
478 return getValue(); 473 return getValue();
479} 474}
480 475
481BOOL LLRadioGroup::isSelected(LLSD value) 476BOOL LLRadioGroup::isSelected(const LLSD& value) const
482{ 477{
483 S32 idx = 0; 478 S32 idx = 0;
484 std::string value_string = value.asString(); 479 std::string value_string = value.asString();
@@ -508,13 +503,6 @@ BOOL LLRadioGroup::operateOnAll(EOperation op)
508} 503}
509 504
510 505
511LLRadioCtrl::LLRadioCtrl(const LLString& name, const LLRect& rect, const LLString& label,
512 const LLFontGL* font, void (*commit_callback)(LLUICtrl*, void*), void* callback_userdata) :
513 LLCheckBoxCtrl(name, rect, label, font, commit_callback, callback_userdata, FALSE, RADIO_STYLE)
514{
515 setTabStop(FALSE);
516}
517
518LLRadioCtrl::~LLRadioCtrl() 506LLRadioCtrl::~LLRadioCtrl()
519{ 507{
520} 508}