From ad332810078a0bbb8fa08fcbfdf3d756de6914f6 Mon Sep 17 00:00:00 2001
From: Steven Bennetts <steve@lindenlab.com>
Date: Fri, 6 Jun 2008 22:43:38 +0000
Subject: QAR-650 - Viewer RC 9 merge -> release (post cmake) merge
 release@88802 Branch_1-20-Viewer-2-merge-1@89178 -> release

---
 indra/llui/llbutton.cpp          | 10 +++++-----
 indra/llui/llcombobox.cpp        | 12 +++++++++++-
 indra/llui/llmenugl.cpp          |  2 +-
 indra/llui/llscrollbar.cpp       |  6 +++---
 indra/llui/llscrollcontainer.cpp |  2 +-
 indra/llui/llscrolllistctrl.cpp  |  4 +++-
 indra/llui/llstyle.cpp           |  2 +-
 indra/llui/lltabcontainer.cpp    |  2 +-
 indra/llui/lltexteditor.cpp      |  2 +-
 indra/llui/llui.cpp              | 18 ++++--------------
 indra/llui/llview.cpp            |  2 +-
 indra/llui/llviewborder.cpp      |  2 +-
 12 files changed, 33 insertions(+), 31 deletions(-)

(limited to 'indra/llui')

diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index 4fa2a3de92..b8cf8f7984 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -45,7 +45,7 @@
 #include "llcriticaldamp.h"
 #include "llfocusmgr.h"
 #include "llwindow.h"
-#include "llglimmediate.h"
+#include "llrender.h"
 
 static LLRegisterWidget<LLButton> r("button");
 
@@ -571,9 +571,9 @@ void LLButton::draw()
 			mImagep->draw(getLocalRect(), getEnabled() ? mImageColor : mDisabledImageColor  );
 			if (mCurGlowStrength > 0.01f)
 			{
-				glBlendFunc(GL_SRC_ALPHA, GL_ONE);
+				gGL.setSceneBlendType(LLRender::BT_ADD_WITH_ALPHA);
 				mImagep->drawSolid(0, 0, getRect().getWidth(), getRect().getHeight(), LLColor4(1.f, 1.f, 1.f, mCurGlowStrength));
-				glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+				gGL.setSceneBlendType(LLRender::BT_ALPHA);
 			}
 		}
 		else
@@ -581,9 +581,9 @@ void LLButton::draw()
 			mImagep->draw(0, 0, getEnabled() ? mImageColor : mDisabledImageColor );
 			if (mCurGlowStrength > 0.01f)
 			{
-				glBlendFunc(GL_SRC_ALPHA, GL_ONE);
+				gGL.setSceneBlendType(LLRender::BT_ADD_WITH_ALPHA);
 				mImagep->drawSolid(0, 0, LLColor4(1.f, 1.f, 1.f, mCurGlowStrength));
-				glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+				gGL.setSceneBlendType(LLRender::BT_ALPHA);
 			}
 		}
 	}
diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp
index 538641d060..98a79fa650 100644
--- a/indra/llui/llcombobox.cpp
+++ b/indra/llui/llcombobox.cpp
@@ -783,8 +783,18 @@ BOOL LLComboBox::handleKeyHere(KEY key, MASK mask)
 			mList->highlightNthItem(mList->getItemIndex(last_selected_item));
 		}
 		result = mList->handleKeyHere(key, mask);
+
+		// will only see return key if it is originating from line editor
+		// since the dropdown button eats the key
+		if (key == KEY_RETURN)
+		{
+			// don't show list and don't eat key input when committing
+			// free-form text entry with RETURN since user already knows
+            // what they are trying to select
+			return FALSE;
+		}
 		// if selection has changed, pop open list
-		if (mList->getLastSelectedItem() != last_selected_item)
+		else if (mList->getLastSelectedItem() != last_selected_item)
 		{
 			showList();
 		}
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index c2b2e08755..62b86a6ad7 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -46,7 +46,7 @@
 #include "llmenugl.h"
 
 #include "llmath.h"
-#include "llglimmediate.h"
+#include "llrender.h"
 #include "llfocusmgr.h"
 #include "llfont.h"
 #include "llcoord.h"
diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp
index 3536e6bb03..5bc2c5cf85 100644
--- a/indra/llui/llscrollbar.cpp
+++ b/indra/llui/llscrollbar.cpp
@@ -44,7 +44,7 @@
 #include "llfocusmgr.h"
 #include "llwindow.h"
 #include "llcontrol.h"
-#include "llglimmediate.h"
+#include "llrender.h"
 
 LLScrollbar::LLScrollbar(
 		const LLString& name, LLRect rect,
@@ -518,9 +518,9 @@ void LLScrollbar::draw()
 		rounded_rect_imagep->draw(mThumbRect, mThumbColor);
 		if (mCurGlowStrength > 0.01f)
 		{
-			glBlendFunc(GL_SRC_ALPHA, GL_ONE);
+			gGL.setSceneBlendType(LLRender::BT_ADD_WITH_ALPHA);
 			rounded_rect_imagep->drawSolid(mThumbRect, LLColor4(1.f, 1.f, 1.f, mCurGlowStrength));
-			glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+			gGL.setSceneBlendType(LLRender::BT_ALPHA);
 		}
 
 	}
diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp
index 72fe2040af..3cb4ecc172 100644
--- a/indra/llui/llscrollcontainer.cpp
+++ b/indra/llui/llscrollcontainer.cpp
@@ -32,7 +32,7 @@
 
 #include "linden_common.h"
 
-#include "llglimmediate.h"
+#include "llrender.h"
 #include "llscrollcontainer.h"
 #include "llscrollbar.h"
 #include "llui.h"
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index c923f6b116..b4a2ed874a 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -42,7 +42,7 @@
 #include "llcheckboxctrl.h"
 #include "llclipboard.h"
 #include "llfocusmgr.h"
-#include "llglimmediate.h"
+#include "llrender.h"
 #include "llresmgr.h"
 #include "llscrollbar.h"
 #include "llstring.h"
@@ -1110,6 +1110,8 @@ BOOL LLScrollListCtrl::selectItemRange( S32 first_index, S32 last_index )
 	for (item_list::iterator iter = mItemList.begin(); iter != mItemList.end(); iter++)
 	{
 		LLScrollListItem *itemp = *iter;
+	
+		llassert_always(itemp) ;
 		if( index >= first_index && index <= last_index )
 		{
 			if( itemp->getEnabled() )
diff --git a/indra/llui/llstyle.cpp b/indra/llui/llstyle.cpp
index 336fdfe2c3..38608745c1 100644
--- a/indra/llui/llstyle.cpp
+++ b/indra/llui/llstyle.cpp
@@ -102,7 +102,7 @@ LLStyle &LLStyle::operator=(const LLStyle &rhs)
 		mItalic = rhs.mItalic;
 		mBold = rhs.mBold;
 		mUnderline = rhs.mUnderline;
-		mDropShadow = rhs.mUnderline;
+		mDropShadow = rhs.mDropShadow;
 		mIsEmbeddedItem = rhs.mIsEmbeddedItem;
 	}
 	
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index fabdbd6860..ccf6e90161 100644
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -40,7 +40,7 @@
 #include "llcriticaldamp.h"
 #include "lluictrlfactory.h"
 #include "lltabcontainervertical.h"
-#include "llglimmediate.h"
+#include "llrender.h"
 
 const F32 SCROLL_STEP_TIME = 0.4f;
 const F32 SCROLL_DELAY_TIME = 0.5f;
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 8264f0cf87..06df996088 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -36,7 +36,7 @@
 #include "lltexteditor.h"
 
 #include "llfontgl.h"
-#include "llglimmediate.h"
+#include "llrender.h"
 #include "llui.h"
 #include "lluictrlfactory.h"
 #include "llrect.h"
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index 1a238ce7fa..6ef485d82c 100644
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -41,7 +41,7 @@
 #include "audioengine.h"
 #include "v2math.h"
 #include "v4color.h"
-#include "llglimmediate.h"
+#include "llrender.h"
 #include "llrect.h"
 #include "llimagegl.h"
 #include "lldir.h"
@@ -487,18 +487,8 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLIma
 	
 	if (solid_color)
 	{
-		glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE,		GL_COMBINE_ARB);
-		glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB,		GL_REPLACE);
-		glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_ARB,		GL_MODULATE);
-
-		glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB,		GL_PREVIOUS);
-		glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_ARB,		GL_SRC_COLOR);
-
-		glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB,		GL_TEXTURE);
-		glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB,	GL_SRC_ALPHA);
-
-		glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_ARB,		GL_PRIMARY_COLOR_ARB);
-		glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_ARB,	GL_SRC_ALPHA);
+		gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR);
+		gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_ALPHA, LLTexUnit::TBS_VERT_ALPHA);
 	}
 
 	gGL.pushMatrix();
@@ -634,7 +624,7 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLIma
 
 	if (solid_color)
 	{
-		glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+		gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
 	}
 }
 
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index fa78534a83..a239968e5d 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -37,7 +37,7 @@
 #include <cassert>
 #include <boost/tokenizer.hpp>
 
-#include "llglimmediate.h"
+#include "llrender.h"
 #include "llevent.h"
 #include "llfontgl.h"
 #include "llfocusmgr.h"
diff --git a/indra/llui/llviewborder.cpp b/indra/llui/llviewborder.cpp
index d3559baec6..2148957ce3 100644
--- a/indra/llui/llviewborder.cpp
+++ b/indra/llui/llviewborder.cpp
@@ -30,7 +30,7 @@
 
 #include "linden_common.h"
 #include "llviewborder.h"
-#include "llglimmediate.h"
+#include "llrender.h"
 #include "llfocusmgr.h"
 
 static LLRegisterWidget<LLViewBorder> r("view_border");
-- 
cgit v1.2.3