diff options
Diffstat (limited to 'linden/indra/llui/llcheckboxctrl.cpp')
-rw-r--r-- | linden/indra/llui/llcheckboxctrl.cpp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/linden/indra/llui/llcheckboxctrl.cpp b/linden/indra/llui/llcheckboxctrl.cpp index b184eda..ff46a80 100644 --- a/linden/indra/llui/llcheckboxctrl.cpp +++ b/linden/indra/llui/llcheckboxctrl.cpp | |||
@@ -12,12 +12,12 @@ | |||
12 | * ("GPL"), unless you have obtained a separate licensing agreement | 12 | * ("GPL"), unless you have obtained a separate licensing agreement |
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | 13 | * ("Other License"), formally executed by you and Linden Lab. Terms of |
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | 14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or |
15 | * online at http://secondlife.com/developers/opensource/gplv2 | 15 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 |
16 | * | 16 | * |
17 | * There are special exceptions to the terms and conditions of the GPL as | 17 | * There are special exceptions to the terms and conditions of the GPL as |
18 | * it is applied to this Source Code. View the full text of the exception | 18 | * it is applied to this Source Code. View the full text of the exception |
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 19 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
20 | * online at http://secondlife.com/developers/opensource/flossexception | 20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception |
21 | * | 21 | * |
22 | * By copying, modifying or distributing this software, you acknowledge | 22 | * By copying, modifying or distributing this software, you acknowledge |
23 | * that you have read and understood your obligations described above, | 23 | * that you have read and understood your obligations described above, |
@@ -75,7 +75,7 @@ LLCheckBoxCtrl::LLCheckBoxCtrl(const LLString& name, const LLRect& rect, | |||
75 | } | 75 | } |
76 | 76 | ||
77 | // must be big enough to hold all children | 77 | // must be big enough to hold all children |
78 | setSpanChildren(TRUE); | 78 | setUseBoundingRect(TRUE); |
79 | 79 | ||
80 | mKeyboardFocusOnClick = TRUE; | 80 | mKeyboardFocusOnClick = TRUE; |
81 | 81 | ||
@@ -130,6 +130,7 @@ LLCheckBoxCtrl::LLCheckBoxCtrl(const LLString& name, const LLRect& rect, | |||
130 | mButton->setDisabledImages( inactive_false_id, inactive_true_id ); | 130 | mButton->setDisabledImages( inactive_false_id, inactive_true_id ); |
131 | mButton->setHoverGlowStrength(0.35f); | 131 | mButton->setHoverGlowStrength(0.35f); |
132 | } | 132 | } |
133 | mButton->setIsToggle(TRUE); | ||
133 | mButton->setToggleState( initial_value ); | 134 | mButton->setToggleState( initial_value ); |
134 | mButton->setFollowsLeft(); | 135 | mButton->setFollowsLeft(); |
135 | mButton->setFollowsBottom(); | 136 | mButton->setFollowsBottom(); |
@@ -150,16 +151,11 @@ void LLCheckBoxCtrl::onButtonPress( void *userdata ) | |||
150 | 151 | ||
151 | if (self->mRadioStyle) | 152 | if (self->mRadioStyle) |
152 | { | 153 | { |
153 | if (!self->getValue()) | 154 | self->setValue(TRUE); |
154 | { | ||
155 | self->setValue(TRUE); | ||
156 | } | ||
157 | } | ||
158 | else | ||
159 | { | ||
160 | self->toggle(); | ||
161 | } | 155 | } |
156 | |||
162 | self->setControlValue(self->getValue()); | 157 | self->setControlValue(self->getValue()); |
158 | // HACK: because buttons don't normally commit | ||
163 | self->onCommit(); | 159 | self->onCommit(); |
164 | 160 | ||
165 | if (self->mKeyboardFocusOnClick) | 161 | if (self->mKeyboardFocusOnClick) |
@@ -232,14 +228,13 @@ void LLCheckBoxCtrl::draw() | |||
232 | //virtual | 228 | //virtual |
233 | void LLCheckBoxCtrl::setValue(const LLSD& value ) | 229 | void LLCheckBoxCtrl::setValue(const LLSD& value ) |
234 | { | 230 | { |
235 | mSetValue = value.asBoolean(); | 231 | mButton->setValue( value ); |
236 | mButton->setToggleState( mSetValue ); | ||
237 | } | 232 | } |
238 | 233 | ||
239 | //virtual | 234 | //virtual |
240 | LLSD LLCheckBoxCtrl::getValue() const | 235 | LLSD LLCheckBoxCtrl::getValue() const |
241 | { | 236 | { |
242 | return mButton->getToggleState(); | 237 | return mButton->getValue(); |
243 | } | 238 | } |
244 | 239 | ||
245 | void LLCheckBoxCtrl::setLabel( const LLStringExplicit& label ) | 240 | void LLCheckBoxCtrl::setLabel( const LLStringExplicit& label ) |