summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2007-07-26 01:22:23 +0000
committerDon Kjer <don@lindenlab.com>2007-07-26 01:22:23 +0000
commit9746cf5310871f305a1419163c5adfbed3f1534b (patch)
treed1f1d278927683fe837173318cc0da1e3c2f8ca4 /indra/llui
parent4284da17878eb9f8ade673d172148d34887aa816 (diff)
EFFECTIVE MERGE: svn merge -r 65485:66133 svn+ssh://svn/svn/linden/branches/maintenance into release
This includes fixes to the maintenance-r66133 branch, and sync'ing up with release@r66392 ACTUAL MERGE: svn merge -r 66394:66435 svn+ssh://svn/svn/linden/branches/release-r66392 into release EQUIVALENT TO: svn merge -r 65485:66434 svn+ssh://svn/svn/linden/branches/maintenance-r66133 into release (plus branch sync'ing)
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llbutton.cpp14
-rw-r--r--indra/llui/llbutton.h4
-rw-r--r--indra/llui/llcheckboxctrl.cpp12
-rw-r--r--indra/llui/llcheckboxctrl.h2
-rw-r--r--indra/llui/lllineeditor.h1
-rw-r--r--indra/llui/lluictrl.h3
6 files changed, 34 insertions, 2 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index d28cf96fa0..d93748d069 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -69,7 +69,8 @@ LLButton::LLButton( const LLString& name, const LLRect& rect, const LLString& co
mCurGlowStrength(0.f),
mNeedsHighlight(FALSE),
mCommitOnReturn(TRUE),
- mImagep( NULL )
+ mImagep( NULL ),
+ mIsDirty( FALSE )
{
mUnselectedLabel = name;
mSelectedLabel = name;
@@ -251,8 +252,12 @@ void LLButton::onCommit()
{
(*mClickedCallback)( mCallbackUserData );
}
+
+ mIsDirty = TRUE;
}
+
+
BOOL LLButton::handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent)
{
BOOL handled = FALSE;
@@ -262,7 +267,8 @@ BOOL LLButton::handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent)
{
(*mClickedCallback)( mCallbackUserData );
}
- handled = TRUE;
+ handled = TRUE;
+ mIsDirty = TRUE;
}
return handled;
}
@@ -279,6 +285,7 @@ BOOL LLButton::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent )
(*mClickedCallback)( mCallbackUserData );
}
handled = TRUE;
+ mIsDirty = TRUE;
}
}
return handled;
@@ -339,6 +346,8 @@ BOOL LLButton::handleMouseUp(S32 x, S32 y, MASK mask)
{
(*mClickedCallback)( mCallbackUserData );
}
+
+ mIsDirty = TRUE;
}
mMouseDownTimer.stop();
@@ -741,6 +750,7 @@ void LLButton::setToggleState(BOOL b)
void LLButton::setValue(const LLSD& value )
{
mToggleState = value.asBoolean();
+ mIsDirty = FALSE;
}
LLSD LLButton::getValue() const
diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h
index 470c34fb64..ba77220a7b 100644
--- a/indra/llui/llbutton.h
+++ b/indra/llui/llbutton.h
@@ -80,6 +80,8 @@ public:
// HACK: "committing" a button is the same as clicking on it.
virtual void onCommit();
+ virtual BOOL isDirty() { return mIsDirty; }; // Returns TRUE if the user has clicked on the button at all
+
void setUnselectedLabelColor( const LLColor4& c ) { mUnselectedLabelColor = c; }
void setSelectedLabelColor( const LLColor4& c ) { mSelectedLabelColor = c; }
@@ -256,6 +258,8 @@ protected:
LLPointer<LLImageGL> mImagep;
+ BOOL mIsDirty;
+
static LLFrameTimer sFlashingTimer;
};
diff --git a/indra/llui/llcheckboxctrl.cpp b/indra/llui/llcheckboxctrl.cpp
index 215f6d40ed..6c181acc94 100644
--- a/indra/llui/llcheckboxctrl.cpp
+++ b/indra/llui/llcheckboxctrl.cpp
@@ -247,6 +247,18 @@ void LLCheckBoxCtrl::setControlName(const LLString& control_name, LLView* contex
mButton->setControlName(control_name, context);
}
+
+// virtual Returns TRUE if the user has modified this control.
+BOOL LLCheckBoxCtrl::isDirty()
+{
+ if ( mButton )
+ {
+ return mButton->isDirty();
+ }
+ return FALSE; // Shouldn't get here
+}
+
+
// virtual
LLXMLNodePtr LLCheckBoxCtrl::getXML(bool save_children) const
{
diff --git a/indra/llui/llcheckboxctrl.h b/indra/llui/llcheckboxctrl.h
index b2f9c95974..76b197125d 100644
--- a/indra/llui/llcheckboxctrl.h
+++ b/indra/llui/llcheckboxctrl.h
@@ -90,6 +90,8 @@ public:
static void onButtonPress(void *userdata);
+ virtual BOOL isDirty(); // Returns TRUE if the user has modified this control.
+
protected:
// note: value is stored in toggle state of button
LLButton* mButton;
diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h
index b3eff3c8e2..110e40b92d 100644
--- a/indra/llui/lllineeditor.h
+++ b/indra/llui/lllineeditor.h
@@ -107,6 +107,7 @@ public:
virtual void setRect(const LLRect& rect);
virtual BOOL acceptsTextInput() const;
virtual void onCommit();
+ virtual BOOL isDirty() { return ( mText.getString() != mPrevText ); }; // Returns TRUE if the user has changed value at all
// assumes UTF8 text
virtual void setValue(const LLSD& value );
diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h
index f07cbec328..7b96ec5655 100644
--- a/indra/llui/lluictrl.h
+++ b/indra/llui/lluictrl.h
@@ -128,6 +128,9 @@ public:
}
};
+ // Returns TRUE if the user has modified this control. Editable controls should override this.
+ virtual BOOL isDirty() { return FALSE; };
+
protected:
virtual void onFocusReceived();
virtual void onFocusLost();