From 551f74125bacfe8353a4b13692d2fdb0cc29958b Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Thu, 15 Jul 2010 16:32:50 -0700 Subject: Changes to allow disabling an LLTextBox (or LLTextBox subclass) to gray out the text. Due to some legacy issues, text boxes will not gray out on disable unless they have their text_readonly_color property in xui set to "LabelDisabledColor" (or some other color distinct from their text color). Reviewed by Richard. --- indra/llui/lltextbox.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'indra/llui/lltextbox.cpp') diff --git a/indra/llui/lltextbox.cpp b/indra/llui/lltextbox.cpp index a1f5b5726b..686179b94e 100644 --- a/indra/llui/lltextbox.cpp +++ b/indra/llui/lltextbox.cpp @@ -119,6 +119,17 @@ BOOL LLTextBox::handleHover(S32 x, S32 y, MASK mask) return handled; } +void LLTextBox::setEnabled(BOOL enabled) +{ + // just treat enabled as read-only flag + bool read_only = !enabled; + if (read_only != mReadOnly) + { + LLTextBase::setReadOnly(read_only); + updateSegments(); + } +} + void LLTextBox::setText(const LLStringExplicit& text , const LLStyle::Params& input_params ) { // does string argument insertion -- cgit v1.2.3