From 3a02b9ec882c98009ae6c24913ee8a7a620b0f87 Mon Sep 17 00:00:00 2001 From: richard Date: Tue, 15 Dec 2009 19:33:18 -0800 Subject: added setBlockFromValue so setting a LLRect param in code will set the individual left, right, top, bottom values, for example don't call setupParams when creating widgets from code moved Multiple param constraints into BaseBlock to remove extra scoping --- indra/llui/lluiimage.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'indra/llui/lluiimage.cpp') diff --git a/indra/llui/lluiimage.cpp b/indra/llui/lluiimage.cpp index f941f391eb..1dfc281d93 100644 --- a/indra/llui/lluiimage.cpp +++ b/indra/llui/lluiimage.cpp @@ -161,22 +161,32 @@ void LLUIImage::onImageLoaded() namespace LLInitParam { - LLUIImage* TypedParam::getValueFromBlock() const + void TypedParam::setValueFromBlock() const { // The keyword "none" is specifically requesting a null image // do not default to current value. Used to overwrite template images. if (name() == "none") { - return NULL; + mData.mValue = NULL; } LLUIImage* imagep = LLUI::getUIImage(name()); - if (!imagep) + if (imagep) { - // default to current value - imagep = mData.mValue; + mData.mValue = imagep; + } + } + + void TypedParam::setBlockFromValue() + { + if (mData.mValue == NULL) + { + name = "none"; + } + else + { + name = mData.mValue->getName(); } - return imagep; } -- cgit v1.2.3 From e8fe81c4fcbec173606b5ad635e0b774e4d8b24b Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 16 Dec 2009 16:04:09 -0800 Subject: Backed out changeset: cfa60aef8061, added setBlockFromValue so setting a LLRect param in code will set the individua --- indra/llui/lluiimage.cpp | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'indra/llui/lluiimage.cpp') diff --git a/indra/llui/lluiimage.cpp b/indra/llui/lluiimage.cpp index 1dfc281d93..f941f391eb 100644 --- a/indra/llui/lluiimage.cpp +++ b/indra/llui/lluiimage.cpp @@ -161,32 +161,22 @@ void LLUIImage::onImageLoaded() namespace LLInitParam { - void TypedParam::setValueFromBlock() const + LLUIImage* TypedParam::getValueFromBlock() const { // The keyword "none" is specifically requesting a null image // do not default to current value. Used to overwrite template images. if (name() == "none") { - mData.mValue = NULL; + return NULL; } LLUIImage* imagep = LLUI::getUIImage(name()); - if (imagep) + if (!imagep) { - mData.mValue = imagep; - } - } - - void TypedParam::setBlockFromValue() - { - if (mData.mValue == NULL) - { - name = "none"; - } - else - { - name = mData.mValue->getName(); + // default to current value + imagep = mData.mValue; } + return imagep; } -- cgit v1.2.3 From 9ff869a6b287a2b4b8c94219584d1c7b66ebb399 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 17 Dec 2009 10:01:55 -0800 Subject: Backed out changeset: 4d482c1ed041 --- indra/llui/lluiimage.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'indra/llui/lluiimage.cpp') diff --git a/indra/llui/lluiimage.cpp b/indra/llui/lluiimage.cpp index f941f391eb..1dfc281d93 100644 --- a/indra/llui/lluiimage.cpp +++ b/indra/llui/lluiimage.cpp @@ -161,22 +161,32 @@ void LLUIImage::onImageLoaded() namespace LLInitParam { - LLUIImage* TypedParam::getValueFromBlock() const + void TypedParam::setValueFromBlock() const { // The keyword "none" is specifically requesting a null image // do not default to current value. Used to overwrite template images. if (name() == "none") { - return NULL; + mData.mValue = NULL; } LLUIImage* imagep = LLUI::getUIImage(name()); - if (!imagep) + if (imagep) { - // default to current value - imagep = mData.mValue; + mData.mValue = imagep; + } + } + + void TypedParam::setBlockFromValue() + { + if (mData.mValue == NULL) + { + name = "none"; + } + else + { + name = mData.mValue->getName(); } - return imagep; } -- cgit v1.2.3 From 298c829bb7d36e0acbc4844ee8b94e685c3d4c2b Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 18 Dec 2009 14:39:45 -0800 Subject: Fix 3D object tooltip backgrounds appearing gray Image "none" wasn't being properly converted to a NULL pointer, so was drawing the default gray image. Reviewed with Richard --- indra/llui/lluiimage.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llui/lluiimage.cpp') diff --git a/indra/llui/lluiimage.cpp b/indra/llui/lluiimage.cpp index 1dfc281d93..966d919dc7 100644 --- a/indra/llui/lluiimage.cpp +++ b/indra/llui/lluiimage.cpp @@ -168,6 +168,7 @@ namespace LLInitParam if (name() == "none") { mData.mValue = NULL; + return; } LLUIImage* imagep = LLUI::getUIImage(name()); -- cgit v1.2.3