diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llui/llcheckboxctrl.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/linden/indra/llui/llcheckboxctrl.cpp b/linden/indra/llui/llcheckboxctrl.cpp index 24cf680..f49e220 100644 --- a/linden/indra/llui/llcheckboxctrl.cpp +++ b/linden/indra/llui/llcheckboxctrl.cpp | |||
@@ -59,7 +59,8 @@ LLCheckBoxCtrl::LLCheckBoxCtrl(const LLString& name, const LLRect& rect, | |||
59 | mTextEnabledColor( LLUI::sColorsGroup->getColor( "LabelTextColor" ) ), | 59 | mTextEnabledColor( LLUI::sColorsGroup->getColor( "LabelTextColor" ) ), |
60 | mTextDisabledColor( LLUI::sColorsGroup->getColor( "LabelDisabledColor" ) ), | 60 | mTextDisabledColor( LLUI::sColorsGroup->getColor( "LabelDisabledColor" ) ), |
61 | mRadioStyle( use_radio_style ), | 61 | mRadioStyle( use_radio_style ), |
62 | mInitialValue( initial_value ) | 62 | mInitialValue( initial_value ), |
63 | mSetValue( initial_value ) | ||
63 | { | 64 | { |
64 | if (font) | 65 | if (font) |
65 | { | 66 | { |
@@ -228,7 +229,8 @@ void LLCheckBoxCtrl::draw() | |||
228 | //virtual | 229 | //virtual |
229 | void LLCheckBoxCtrl::setValue(const LLSD& value ) | 230 | void LLCheckBoxCtrl::setValue(const LLSD& value ) |
230 | { | 231 | { |
231 | mButton->setToggleState( value.asBoolean() ); | 232 | mSetValue = value.asBoolean(); |
233 | mButton->setToggleState( mSetValue ); | ||
232 | } | 234 | } |
233 | 235 | ||
234 | //virtual | 236 | //virtual |
@@ -269,16 +271,27 @@ void LLCheckBoxCtrl::setControlName(const LLString& control_name, LLView* contex | |||
269 | 271 | ||
270 | 272 | ||
271 | // virtual Returns TRUE if the user has modified this control. | 273 | // virtual Returns TRUE if the user has modified this control. |
272 | BOOL LLCheckBoxCtrl::isDirty() | 274 | BOOL LLCheckBoxCtrl::isDirty() const |
273 | { | 275 | { |
274 | if ( mButton ) | 276 | if ( mButton ) |
275 | { | 277 | { |
276 | return mButton->isDirty(); | 278 | return (mSetValue != mButton->getToggleState()); |
277 | } | 279 | } |
278 | return FALSE; // Shouldn't get here | 280 | return FALSE; // Shouldn't get here |
279 | } | 281 | } |
280 | 282 | ||
281 | 283 | ||
284 | // virtual Clear dirty state | ||
285 | void LLCheckBoxCtrl::resetDirty() | ||
286 | { | ||
287 | if ( mButton ) | ||
288 | { | ||
289 | mSetValue = mButton->getToggleState(); | ||
290 | } | ||
291 | } | ||
292 | |||
293 | |||
294 | |||
282 | // virtual | 295 | // virtual |
283 | LLXMLNodePtr LLCheckBoxCtrl::getXML(bool save_children) const | 296 | LLXMLNodePtr LLCheckBoxCtrl::getXML(bool save_children) const |
284 | { | 297 | { |