From 347daac67daddad37f0722ea2ea9b717e96c10ab Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Tue, 2 Feb 2010 21:53:52 +0200 Subject: Fixed normal bug EXT-4105 ([BSI] group names are not able to be copied from side panel) - changed LLTextBoxEx class to inherit the LLTextEditor behavior --HG-- branch : product-engine --- indra/newview/llexpandabletextbox.cpp | 11 ++++++++--- indra/newview/llexpandabletextbox.h | 11 ++++++++--- .../newview/skins/default/xui/en/widgets/expandable_text.xml | 9 ++++++--- 3 files changed, 22 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp index e0a9e080fa..3818ee6f78 100644 --- a/indra/newview/llexpandabletextbox.cpp +++ b/indra/newview/llexpandabletextbox.cpp @@ -116,7 +116,7 @@ LLExpandableTextBox::LLTextBoxEx::Params::Params() } LLExpandableTextBox::LLTextBoxEx::LLTextBoxEx(const Params& p) -: LLTextBox(p), +: LLTextEditor(p), mExpanderLabel(p.more_label), mExpanderVisible(false) { @@ -127,7 +127,7 @@ LLExpandableTextBox::LLTextBoxEx::LLTextBoxEx(const Params& p) void LLExpandableTextBox::LLTextBoxEx::reshape(S32 width, S32 height, BOOL called_from_parent) { hideExpandText(); - LLTextBox::reshape(width, height, called_from_parent); + LLTextEditor::reshape(width, height, called_from_parent); if (getTextPixelHeight() > getRect().getHeight()) { @@ -140,7 +140,7 @@ void LLExpandableTextBox::LLTextBoxEx::setText(const LLStringExplicit& text,cons // LLTextBox::setText will obliterate the expander segment, so make sure // we generate it again by clearing mExpanderVisible mExpanderVisible = false; - LLTextBox::setText(text, input_params); + LLTextEditor::setText(text, input_params); // text contents have changed, segments are cleared out // so hide the expander and determine if we need it @@ -201,6 +201,11 @@ S32 LLExpandableTextBox::LLTextBoxEx::getVerticalTextDelta() return text_height - textbox_height; } +S32 LLExpandableTextBox::LLTextBoxEx::getTextPixelHeight() +{ + return getTextBoundingRect().getHeight(); +} + ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llexpandabletextbox.h b/indra/newview/llexpandabletextbox.h index 2b4f9e527c..58316ddb98 100644 --- a/indra/newview/llexpandabletextbox.h +++ b/indra/newview/llexpandabletextbox.h @@ -33,7 +33,7 @@ #ifndef LL_LLEXPANDABLETEXTBOX_H #define LL_LLEXPANDABLETEXTBOX_H -#include "lltextbox.h" +#include "lltexteditor.h" #include "llscrollcontainer.h" /** @@ -49,10 +49,10 @@ protected: * Extended text box. "More" link will appear at end of text if * text is too long to fit into text box size. */ - class LLTextBoxEx : public LLTextBox + class LLTextBoxEx : public LLTextEditor { public: - struct Params : public LLInitParam::Block + struct Params : public LLInitParam::Block { Mandatory more_label; Params(); @@ -69,6 +69,11 @@ protected: */ virtual S32 getVerticalTextDelta(); + /** + * Returns the height of text rect. + */ + S32 getTextPixelHeight(); + /** * Shows "More" link */ diff --git a/indra/newview/skins/default/xui/en/widgets/expandable_text.xml b/indra/newview/skins/default/xui/en/widgets/expandable_text.xml index f59c46b2f5..d9b6387f0d 100644 --- a/indra/newview/skins/default/xui/en/widgets/expandable_text.xml +++ b/indra/newview/skins/default/xui/en/widgets/expandable_text.xml @@ -2,10 +2,13 @@ - \ No newline at end of file + -- cgit v1.2.3