diff options
author | Jacek Antonelli | 2008-08-15 23:45:50 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:50 -0500 |
commit | 2a4dea528f670b9bb1f77ef27a8a1dd16603d114 (patch) | |
tree | 95c68e362703c9099d571ecbdc6142b1cda1e005 /linden/indra/llui | |
parent | Second Life viewer sources 1.20.6 (diff) | |
download | meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.zip meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.gz meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.bz2 meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.xz |
Second Life viewer sources 1.20.7
Diffstat (limited to 'linden/indra/llui')
-rw-r--r-- | linden/indra/llui/llbutton.cpp | 10 | ||||
-rw-r--r-- | linden/indra/llui/llcombobox.cpp | 14 | ||||
-rw-r--r-- | linden/indra/llui/llfloater.cpp | 20 | ||||
-rw-r--r-- | linden/indra/llui/lllineeditor.cpp | 9 | ||||
-rw-r--r-- | linden/indra/llui/lllineeditor.h | 4 | ||||
-rw-r--r-- | linden/indra/llui/llmenugl.cpp | 2 | ||||
-rw-r--r-- | linden/indra/llui/llresizebar.cpp | 11 | ||||
-rw-r--r-- | linden/indra/llui/llresizebar.h | 2 | ||||
-rw-r--r-- | linden/indra/llui/llscrollbar.cpp | 6 | ||||
-rw-r--r-- | linden/indra/llui/llscrollcontainer.cpp | 2 | ||||
-rw-r--r-- | linden/indra/llui/llscrolllistctrl.cpp | 8 | ||||
-rw-r--r-- | linden/indra/llui/llspinctrl.cpp | 12 | ||||
-rw-r--r-- | linden/indra/llui/llspinctrl.h | 2 | ||||
-rw-r--r-- | linden/indra/llui/llstyle.h | 9 | ||||
-rw-r--r-- | linden/indra/llui/lltabcontainer.cpp | 2 | ||||
-rw-r--r-- | linden/indra/llui/lltexteditor.cpp | 92 | ||||
-rw-r--r-- | linden/indra/llui/lltexteditor.h | 18 | ||||
-rw-r--r-- | linden/indra/llui/llui.cpp | 18 | ||||
-rw-r--r-- | linden/indra/llui/lluictrlfactory.cpp | 17 | ||||
-rw-r--r-- | linden/indra/llui/lluictrlfactory.h | 4 | ||||
-rw-r--r-- | linden/indra/llui/llview.cpp | 2 | ||||
-rw-r--r-- | linden/indra/llui/llviewborder.cpp | 2 |
22 files changed, 161 insertions, 105 deletions
diff --git a/linden/indra/llui/llbutton.cpp b/linden/indra/llui/llbutton.cpp index 3ada389..3eead67 100644 --- a/linden/indra/llui/llbutton.cpp +++ b/linden/indra/llui/llbutton.cpp | |||
@@ -48,7 +48,7 @@ | |||
48 | #include "llglheaders.h" | 48 | #include "llglheaders.h" |
49 | #include "llfocusmgr.h" | 49 | #include "llfocusmgr.h" |
50 | #include "llwindow.h" | 50 | #include "llwindow.h" |
51 | #include "llglimmediate.h" | 51 | #include "llrender.h" |
52 | 52 | ||
53 | static LLRegisterWidget<LLButton> r("button"); | 53 | static LLRegisterWidget<LLButton> r("button"); |
54 | 54 | ||
@@ -574,9 +574,9 @@ void LLButton::draw() | |||
574 | mImagep->draw(getLocalRect(), getEnabled() ? mImageColor : mDisabledImageColor ); | 574 | mImagep->draw(getLocalRect(), getEnabled() ? mImageColor : mDisabledImageColor ); |
575 | if (mCurGlowStrength > 0.01f) | 575 | if (mCurGlowStrength > 0.01f) |
576 | { | 576 | { |
577 | glBlendFunc(GL_SRC_ALPHA, GL_ONE); | 577 | gGL.setSceneBlendType(LLRender::BT_ADD_WITH_ALPHA); |
578 | mImagep->drawSolid(0, 0, getRect().getWidth(), getRect().getHeight(), LLColor4(1.f, 1.f, 1.f, mCurGlowStrength)); | 578 | mImagep->drawSolid(0, 0, getRect().getWidth(), getRect().getHeight(), LLColor4(1.f, 1.f, 1.f, mCurGlowStrength)); |
579 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | 579 | gGL.setSceneBlendType(LLRender::BT_ALPHA); |
580 | } | 580 | } |
581 | } | 581 | } |
582 | else | 582 | else |
@@ -584,9 +584,9 @@ void LLButton::draw() | |||
584 | mImagep->draw(0, 0, getEnabled() ? mImageColor : mDisabledImageColor ); | 584 | mImagep->draw(0, 0, getEnabled() ? mImageColor : mDisabledImageColor ); |
585 | if (mCurGlowStrength > 0.01f) | 585 | if (mCurGlowStrength > 0.01f) |
586 | { | 586 | { |
587 | glBlendFunc(GL_SRC_ALPHA, GL_ONE); | 587 | gGL.setSceneBlendType(LLRender::BT_ADD_WITH_ALPHA); |
588 | mImagep->drawSolid(0, 0, LLColor4(1.f, 1.f, 1.f, mCurGlowStrength)); | 588 | mImagep->drawSolid(0, 0, LLColor4(1.f, 1.f, 1.f, mCurGlowStrength)); |
589 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | 589 | gGL.setSceneBlendType(LLRender::BT_ALPHA); |
590 | } | 590 | } |
591 | } | 591 | } |
592 | } | 592 | } |
diff --git a/linden/indra/llui/llcombobox.cpp b/linden/indra/llui/llcombobox.cpp index 0523a11..d5edba7 100644 --- a/linden/indra/llui/llcombobox.cpp +++ b/linden/indra/llui/llcombobox.cpp | |||
@@ -565,6 +565,8 @@ void LLComboBox::showList() | |||
565 | 565 | ||
566 | S32 min_width = getRect().getWidth(); | 566 | S32 min_width = getRect().getWidth(); |
567 | S32 max_width = llmax(min_width, MAX_COMBO_WIDTH); | 567 | S32 max_width = llmax(min_width, MAX_COMBO_WIDTH); |
568 | // make sure we have up to date content width metrics | ||
569 | mList->calcColumnWidths(); | ||
568 | S32 list_width = llclamp(mList->getMaxContentWidth(), min_width, max_width); | 570 | S32 list_width = llclamp(mList->getMaxContentWidth(), min_width, max_width); |
569 | 571 | ||
570 | if (mListPosition == BELOW) | 572 | if (mListPosition == BELOW) |
@@ -781,8 +783,18 @@ BOOL LLComboBox::handleKeyHere(KEY key, MASK mask) | |||
781 | mList->highlightNthItem(mList->getItemIndex(last_selected_item)); | 783 | mList->highlightNthItem(mList->getItemIndex(last_selected_item)); |
782 | } | 784 | } |
783 | result = mList->handleKeyHere(key, mask); | 785 | result = mList->handleKeyHere(key, mask); |
786 | |||
787 | // will only see return key if it is originating from line editor | ||
788 | // since the dropdown button eats the key | ||
789 | if (key == KEY_RETURN) | ||
790 | { | ||
791 | // don't show list and don't eat key input when committing | ||
792 | // free-form text entry with RETURN since user already knows | ||
793 | // what they are trying to select | ||
794 | return FALSE; | ||
795 | } | ||
784 | // if selection has changed, pop open list | 796 | // if selection has changed, pop open list |
785 | if (mList->getLastSelectedItem() != last_selected_item) | 797 | else if (mList->getLastSelectedItem() != last_selected_item) |
786 | { | 798 | { |
787 | showList(); | 799 | showList(); |
788 | } | 800 | } |
diff --git a/linden/indra/llui/llfloater.cpp b/linden/indra/llui/llfloater.cpp index bf50830..759fae0 100644 --- a/linden/indra/llui/llfloater.cpp +++ b/linden/indra/llui/llfloater.cpp | |||
@@ -832,8 +832,14 @@ void LLFloater::setMinimized(BOOL minimize) | |||
832 | 832 | ||
833 | for (S32 i = 0; i < 4; i++) | 833 | for (S32 i = 0; i < 4; i++) |
834 | { | 834 | { |
835 | if (mResizeBar[i]) mResizeBar[i]->setEnabled(FALSE); | 835 | if (mResizeBar[i] != NULL) |
836 | if (mResizeHandle[i]) mResizeHandle[i]->setEnabled(FALSE); | 836 | { |
837 | mResizeBar[i]->setEnabled(FALSE); | ||
838 | } | ||
839 | if (mResizeHandle[i] != NULL) | ||
840 | { | ||
841 | mResizeHandle[i]->setEnabled(FALSE); | ||
842 | } | ||
837 | } | 843 | } |
838 | 844 | ||
839 | mMinimized = TRUE; | 845 | mMinimized = TRUE; |
@@ -875,8 +881,14 @@ void LLFloater::setMinimized(BOOL minimize) | |||
875 | 881 | ||
876 | for (S32 i = 0; i < 4; i++) | 882 | for (S32 i = 0; i < 4; i++) |
877 | { | 883 | { |
878 | if (mResizeBar[i]) mResizeBar[i]->setEnabled(isResizable()); | 884 | if (mResizeBar[i] != NULL) |
879 | if (mResizeHandle[i]) mResizeHandle[i]->setEnabled(isResizable()); | 885 | { |
886 | mResizeBar[i]->setEnabled(isResizable()); | ||
887 | } | ||
888 | if (mResizeHandle[i] != NULL) | ||
889 | { | ||
890 | mResizeHandle[i]->setEnabled(isResizable()); | ||
891 | } | ||
880 | } | 892 | } |
881 | 893 | ||
882 | mMinimized = FALSE; | 894 | mMinimized = FALSE; |
diff --git a/linden/indra/llui/lllineeditor.cpp b/linden/indra/llui/lllineeditor.cpp index aeb906c..a12c9d8 100644 --- a/linden/indra/llui/lllineeditor.cpp +++ b/linden/indra/llui/lllineeditor.cpp | |||
@@ -132,7 +132,8 @@ LLLineEditor::LLLineEditor(const LLString& name, const LLRect& rect, | |||
132 | mSelectAllonFocusReceived( FALSE ), | 132 | mSelectAllonFocusReceived( FALSE ), |
133 | mPassDelete(FALSE), | 133 | mPassDelete(FALSE), |
134 | mReadOnly(FALSE), | 134 | mReadOnly(FALSE), |
135 | mImage( sImage ) | 135 | mImage( sImage ), |
136 | mReplaceNewlinesWithSpaces( TRUE ) | ||
136 | { | 137 | { |
137 | llassert( max_length_bytes > 0 ); | 138 | llassert( max_length_bytes > 0 ); |
138 | 139 | ||
@@ -961,7 +962,7 @@ void LLLineEditor::paste() | |||
961 | LLWString clean_string(paste); | 962 | LLWString clean_string(paste); |
962 | LLWString::replaceTabsWithSpaces(clean_string, 1); | 963 | LLWString::replaceTabsWithSpaces(clean_string, 1); |
963 | //clean_string = wstring_detabify(paste, 1); | 964 | //clean_string = wstring_detabify(paste, 1); |
964 | LLWString::replaceChar(clean_string, '\n', ' '); | 965 | LLWString::replaceChar(clean_string, '\n', mReplaceNewlinesWithSpaces ? ' ' : 182); // 182 == paragraph character |
965 | 966 | ||
966 | // Insert the string | 967 | // Insert the string |
967 | 968 | ||
@@ -2547,6 +2548,10 @@ S32 LLLineEditor::getPreeditFontSize() const | |||
2547 | return llround(mGLFont->getLineHeight() * LLUI::sGLScaleFactor.mV[VY]); | 2548 | return llround(mGLFont->getLineHeight() * LLUI::sGLScaleFactor.mV[VY]); |
2548 | } | 2549 | } |
2549 | 2550 | ||
2551 | void LLLineEditor::setReplaceNewlinesWithSpaces(BOOL replace) | ||
2552 | { | ||
2553 | mReplaceNewlinesWithSpaces = replace; | ||
2554 | } | ||
2550 | 2555 | ||
2551 | static LLRegisterWidget<LLSearchEditor> r2("search_editor"); | 2556 | static LLRegisterWidget<LLSearchEditor> r2("search_editor"); |
2552 | 2557 | ||
diff --git a/linden/indra/llui/lllineeditor.h b/linden/indra/llui/lllineeditor.h index bf0dcb5..c96e34d 100644 --- a/linden/indra/llui/lllineeditor.h +++ b/linden/indra/llui/lllineeditor.h | |||
@@ -211,6 +211,8 @@ public: | |||
211 | void setEnableLineHistory( BOOL enabled ) { mHaveHistory = enabled; } // switches line history on or off | 211 | void setEnableLineHistory( BOOL enabled ) { mHaveHistory = enabled; } // switches line history on or off |
212 | void updateHistory(); // stores current line in history | 212 | void updateHistory(); // stores current line in history |
213 | 213 | ||
214 | void setReplaceNewlinesWithSpaces(BOOL replace); | ||
215 | |||
214 | private: | 216 | private: |
215 | // private helper methods | 217 | // private helper methods |
216 | void removeChar(); | 218 | void removeChar(); |
@@ -311,6 +313,8 @@ private: | |||
311 | // Instances that by default point to the statics but can be overidden in XML. | 313 | // Instances that by default point to the statics but can be overidden in XML. |
312 | LLPointer<LLUIImage> mImage; | 314 | LLPointer<LLUIImage> mImage; |
313 | 315 | ||
316 | BOOL mReplaceNewlinesWithSpaces; // if false, will replace pasted newlines with paragraph symbol. | ||
317 | |||
314 | // private helper class | 318 | // private helper class |
315 | class LLLineEditorRollback | 319 | class LLLineEditorRollback |
316 | { | 320 | { |
diff --git a/linden/indra/llui/llmenugl.cpp b/linden/indra/llui/llmenugl.cpp index f2486f1..5e46ab7 100644 --- a/linden/indra/llui/llmenugl.cpp +++ b/linden/indra/llui/llmenugl.cpp | |||
@@ -47,7 +47,7 @@ | |||
47 | 47 | ||
48 | #include "llmath.h" | 48 | #include "llmath.h" |
49 | #include "llgl.h" | 49 | #include "llgl.h" |
50 | #include "llglimmediate.h" | 50 | #include "llrender.h" |
51 | #include "llfocusmgr.h" | 51 | #include "llfocusmgr.h" |
52 | #include "llfont.h" | 52 | #include "llfont.h" |
53 | #include "llcoord.h" | 53 | #include "llcoord.h" |
diff --git a/linden/indra/llui/llresizebar.cpp b/linden/indra/llui/llresizebar.cpp index e89bfee..fd571a1 100644 --- a/linden/indra/llui/llresizebar.cpp +++ b/linden/indra/llui/llresizebar.cpp | |||
@@ -50,6 +50,7 @@ LLResizeBar::LLResizeBar( const LLString& name, LLView* resizing_view, const LLR | |||
50 | mMaxSize( max_size ), | 50 | mMaxSize( max_size ), |
51 | mSide( side ), | 51 | mSide( side ), |
52 | mSnappingEnabled(TRUE), | 52 | mSnappingEnabled(TRUE), |
53 | mAllowDoubleClickSnapping(TRUE), | ||
53 | mResizingView(resizing_view) | 54 | mResizingView(resizing_view) |
54 | { | 55 | { |
55 | // set up some generically good follow code. | 56 | // set up some generically good follow code. |
@@ -260,27 +261,31 @@ BOOL LLResizeBar::handleDoubleClick(S32 x, S32 y, MASK mask) | |||
260 | LLRect orig_rect = mResizingView->getRect(); | 261 | LLRect orig_rect = mResizingView->getRect(); |
261 | LLRect scaled_rect = orig_rect; | 262 | LLRect scaled_rect = orig_rect; |
262 | 263 | ||
263 | if (mSnappingEnabled) | 264 | if (mSnappingEnabled && mAllowDoubleClickSnapping) |
264 | { | 265 | { |
265 | switch( mSide ) | 266 | switch( mSide ) |
266 | { | 267 | { |
267 | case LEFT: | 268 | case LEFT: |
268 | mResizingView->findSnapEdge(scaled_rect.mLeft, LLCoordGL(0, 0), SNAP_LEFT, SNAP_PARENT_AND_SIBLINGS, S32_MAX); | 269 | mResizingView->findSnapEdge(scaled_rect.mLeft, LLCoordGL(0, 0), SNAP_LEFT, SNAP_PARENT_AND_SIBLINGS, S32_MAX); |
270 | scaled_rect.mLeft = scaled_rect.mRight - llclamp(scaled_rect.getWidth(), mMinSize, mMaxSize); | ||
269 | break; | 271 | break; |
270 | case TOP: | 272 | case TOP: |
271 | mResizingView->findSnapEdge(scaled_rect.mTop, LLCoordGL(0, 0), SNAP_TOP, SNAP_PARENT_AND_SIBLINGS, S32_MAX); | 273 | mResizingView->findSnapEdge(scaled_rect.mTop, LLCoordGL(0, 0), SNAP_TOP, SNAP_PARENT_AND_SIBLINGS, S32_MAX); |
274 | scaled_rect.mTop = scaled_rect.mBottom + llclamp(scaled_rect.getHeight(), mMinSize, mMaxSize); | ||
272 | break; | 275 | break; |
273 | case RIGHT: | 276 | case RIGHT: |
274 | mResizingView->findSnapEdge(scaled_rect.mRight, LLCoordGL(0, 0), SNAP_RIGHT, SNAP_PARENT_AND_SIBLINGS, S32_MAX); | 277 | mResizingView->findSnapEdge(scaled_rect.mRight, LLCoordGL(0, 0), SNAP_RIGHT, SNAP_PARENT_AND_SIBLINGS, S32_MAX); |
278 | scaled_rect.mRight = scaled_rect.mLeft + llclamp(scaled_rect.getWidth(), mMinSize, mMaxSize); | ||
275 | break; | 279 | break; |
276 | case BOTTOM: | 280 | case BOTTOM: |
277 | mResizingView->findSnapEdge(scaled_rect.mBottom, LLCoordGL(0, 0), SNAP_BOTTOM, SNAP_PARENT_AND_SIBLINGS, S32_MAX); | 281 | mResizingView->findSnapEdge(scaled_rect.mBottom, LLCoordGL(0, 0), SNAP_BOTTOM, SNAP_PARENT_AND_SIBLINGS, S32_MAX); |
282 | scaled_rect.mBottom = scaled_rect.mTop - llclamp(scaled_rect.getHeight(), mMinSize, mMaxSize); | ||
278 | break; | 283 | break; |
279 | } | 284 | } |
285 | |||
286 | mResizingView->userSetShape(scaled_rect); | ||
280 | } | 287 | } |
281 | 288 | ||
282 | mResizingView->reshape(scaled_rect.getWidth(), scaled_rect.getHeight()); | ||
283 | mResizingView->setOrigin(scaled_rect.mLeft, scaled_rect.mBottom); | ||
284 | return TRUE; | 289 | return TRUE; |
285 | } | 290 | } |
286 | 291 | ||
diff --git a/linden/indra/llui/llresizebar.h b/linden/indra/llui/llresizebar.h index d03dafa..f8a7514 100644 --- a/linden/indra/llui/llresizebar.h +++ b/linden/indra/llui/llresizebar.h | |||
@@ -50,6 +50,7 @@ public: | |||
50 | 50 | ||
51 | void setResizeLimits( S32 min_size, S32 max_size ) { mMinSize = min_size; mMaxSize = max_size; } | 51 | void setResizeLimits( S32 min_size, S32 max_size ) { mMinSize = min_size; mMaxSize = max_size; } |
52 | void setEnableSnapping(BOOL enable) { mSnappingEnabled = enable; } | 52 | void setEnableSnapping(BOOL enable) { mSnappingEnabled = enable; } |
53 | void setAllowDoubleClickSnapping(BOOL allow) { mAllowDoubleClickSnapping = allow; } | ||
53 | 54 | ||
54 | private: | 55 | private: |
55 | S32 mDragLastScreenX; | 56 | S32 mDragLastScreenX; |
@@ -61,6 +62,7 @@ private: | |||
61 | S32 mMaxSize; | 62 | S32 mMaxSize; |
62 | const Side mSide; | 63 | const Side mSide; |
63 | BOOL mSnappingEnabled; | 64 | BOOL mSnappingEnabled; |
65 | BOOL mAllowDoubleClickSnapping; | ||
64 | LLView* mResizingView; | 66 | LLView* mResizingView; |
65 | }; | 67 | }; |
66 | 68 | ||
diff --git a/linden/indra/llui/llscrollbar.cpp b/linden/indra/llui/llscrollbar.cpp index 8940b80..3d412c1 100644 --- a/linden/indra/llui/llscrollbar.cpp +++ b/linden/indra/llui/llscrollbar.cpp | |||
@@ -46,7 +46,7 @@ | |||
46 | #include "llwindow.h" | 46 | #include "llwindow.h" |
47 | #include "llglheaders.h" | 47 | #include "llglheaders.h" |
48 | #include "llcontrol.h" | 48 | #include "llcontrol.h" |
49 | #include "llglimmediate.h" | 49 | #include "llrender.h" |
50 | 50 | ||
51 | LLScrollbar::LLScrollbar( | 51 | LLScrollbar::LLScrollbar( |
52 | const LLString& name, LLRect rect, | 52 | const LLString& name, LLRect rect, |
@@ -520,9 +520,9 @@ void LLScrollbar::draw() | |||
520 | rounded_rect_imagep->draw(mThumbRect, mThumbColor); | 520 | rounded_rect_imagep->draw(mThumbRect, mThumbColor); |
521 | if (mCurGlowStrength > 0.01f) | 521 | if (mCurGlowStrength > 0.01f) |
522 | { | 522 | { |
523 | glBlendFunc(GL_SRC_ALPHA, GL_ONE); | 523 | gGL.setSceneBlendType(LLRender::BT_ADD_WITH_ALPHA); |
524 | rounded_rect_imagep->drawSolid(mThumbRect, LLColor4(1.f, 1.f, 1.f, mCurGlowStrength)); | 524 | rounded_rect_imagep->drawSolid(mThumbRect, LLColor4(1.f, 1.f, 1.f, mCurGlowStrength)); |
525 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | 525 | gGL.setSceneBlendType(LLRender::BT_ALPHA); |
526 | } | 526 | } |
527 | 527 | ||
528 | } | 528 | } |
diff --git a/linden/indra/llui/llscrollcontainer.cpp b/linden/indra/llui/llscrollcontainer.cpp index f0b0b81..1217a58 100644 --- a/linden/indra/llui/llscrollcontainer.cpp +++ b/linden/indra/llui/llscrollcontainer.cpp | |||
@@ -33,7 +33,7 @@ | |||
33 | #include "linden_common.h" | 33 | #include "linden_common.h" |
34 | 34 | ||
35 | #include "llgl.h" | 35 | #include "llgl.h" |
36 | #include "llglimmediate.h" | 36 | #include "llrender.h" |
37 | 37 | ||
38 | #include "llscrollcontainer.h" | 38 | #include "llscrollcontainer.h" |
39 | #include "llscrollbar.h" | 39 | #include "llscrollbar.h" |
diff --git a/linden/indra/llui/llscrolllistctrl.cpp b/linden/indra/llui/llscrolllistctrl.cpp index 32c4e82..9693df4 100644 --- a/linden/indra/llui/llscrolllistctrl.cpp +++ b/linden/indra/llui/llscrolllistctrl.cpp | |||
@@ -43,7 +43,7 @@ | |||
43 | #include "llclipboard.h" | 43 | #include "llclipboard.h" |
44 | #include "llfocusmgr.h" | 44 | #include "llfocusmgr.h" |
45 | #include "llgl.h" | 45 | #include "llgl.h" |
46 | #include "llglimmediate.h" | 46 | #include "llrender.h" |
47 | #include "llglheaders.h" | 47 | #include "llglheaders.h" |
48 | #include "llresmgr.h" | 48 | #include "llresmgr.h" |
49 | #include "llscrollbar.h" | 49 | #include "llscrollbar.h" |
@@ -1117,9 +1117,7 @@ BOOL LLScrollListCtrl::selectItemRange( S32 first_index, S32 last_index ) | |||
1117 | if( itemp->getEnabled() ) | 1117 | if( itemp->getEnabled() ) |
1118 | { | 1118 | { |
1119 | selectItem(itemp, FALSE); | 1119 | selectItem(itemp, FALSE); |
1120 | success = TRUE; | 1120 | success = TRUE; |
1121 | if (!success) | ||
1122 | mOriginalSelection = first_index; | ||
1123 | } | 1121 | } |
1124 | } | 1122 | } |
1125 | else | 1123 | else |
@@ -1198,7 +1196,7 @@ void LLScrollListCtrl::deleteItems(const LLSD& sd) | |||
1198 | mLastSelected = NULL; | 1196 | mLastSelected = NULL; |
1199 | } | 1197 | } |
1200 | delete itemp; | 1198 | delete itemp; |
1201 | mItemList.erase(iter++); | 1199 | iter = mItemList.erase(iter); |
1202 | } | 1200 | } |
1203 | else | 1201 | else |
1204 | { | 1202 | { |
diff --git a/linden/indra/llui/llspinctrl.cpp b/linden/indra/llui/llspinctrl.cpp index 9e85b20..f196975 100644 --- a/linden/indra/llui/llspinctrl.cpp +++ b/linden/indra/llui/llspinctrl.cpp | |||
@@ -249,6 +249,18 @@ void LLSpinCtrl::setValue(const LLSD& value ) | |||
249 | } | 249 | } |
250 | } | 250 | } |
251 | 251 | ||
252 | //no matter if Editor has the focus, update the value | ||
253 | void LLSpinCtrl::forceSetValue(const LLSD& value ) | ||
254 | { | ||
255 | F32 v = (F32)value.asReal(); | ||
256 | if (mValue != v || !mbHasBeenSet) | ||
257 | { | ||
258 | mbHasBeenSet = TRUE; | ||
259 | mValue = v; | ||
260 | |||
261 | updateEditor(); | ||
262 | } | ||
263 | } | ||
252 | 264 | ||
253 | void LLSpinCtrl::clear() | 265 | void LLSpinCtrl::clear() |
254 | { | 266 | { |
diff --git a/linden/indra/llui/llspinctrl.h b/linden/indra/llui/llspinctrl.h index 790e216..5d040fd 100644 --- a/linden/indra/llui/llspinctrl.h +++ b/linden/indra/llui/llspinctrl.h | |||
@@ -66,6 +66,7 @@ public: | |||
66 | virtual LLXMLNodePtr getXML(bool save_children = true) const; | 66 | virtual LLXMLNodePtr getXML(bool save_children = true) const; |
67 | static LLView* fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory); | 67 | static LLView* fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory); |
68 | 68 | ||
69 | virtual void forceSetValue(const LLSD& value ) ; | ||
69 | virtual void setValue(const LLSD& value ); | 70 | virtual void setValue(const LLSD& value ); |
70 | virtual LLSD getValue() const { return mValue; } | 71 | virtual LLSD getValue() const { return mValue; } |
71 | F32 get() const { return (F32)getValue().asReal(); } | 72 | F32 get() const { return (F32)getValue().asReal(); } |
@@ -87,6 +88,7 @@ public: | |||
87 | virtual void setIncrement(F32 inc) { mIncrement = inc; } | 88 | virtual void setIncrement(F32 inc) { mIncrement = inc; } |
88 | virtual F32 getMinValue() { return mMinValue ; } | 89 | virtual F32 getMinValue() { return mMinValue ; } |
89 | virtual F32 getMaxValue() { return mMaxValue ; } | 90 | virtual F32 getMaxValue() { return mMaxValue ; } |
91 | virtual F32 getIncrement() { return mIncrement ; } | ||
90 | 92 | ||
91 | void setLabel(const LLStringExplicit& label); | 93 | void setLabel(const LLStringExplicit& label); |
92 | void setLabelColor(const LLColor4& c) { mTextEnabledColor = c; } | 94 | void setLabelColor(const LLColor4& c) { mTextEnabledColor = c; } |
diff --git a/linden/indra/llui/llstyle.h b/linden/indra/llui/llstyle.h index 6f0099c..56f1398 100644 --- a/linden/indra/llui/llstyle.h +++ b/linden/indra/llui/llstyle.h | |||
@@ -37,7 +37,7 @@ | |||
37 | #include "llfont.h" | 37 | #include "llfont.h" |
38 | #include "llui.h" | 38 | #include "llui.h" |
39 | 39 | ||
40 | class LLStyle | 40 | class LLStyle : public LLRefCount |
41 | { | 41 | { |
42 | public: | 42 | public: |
43 | LLStyle(); | 43 | LLStyle(); |
@@ -46,8 +46,6 @@ public: | |||
46 | 46 | ||
47 | LLStyle &operator=(const LLStyle &rhs); | 47 | LLStyle &operator=(const LLStyle &rhs); |
48 | 48 | ||
49 | virtual ~LLStyle() { } | ||
50 | |||
51 | virtual void init (BOOL is_visible, const LLColor4 &color, const LLString& font_name); | 49 | virtual void init (BOOL is_visible, const LLColor4 &color, const LLString& font_name); |
52 | 50 | ||
53 | virtual const LLColor4& getColor() const { return mColor; } | 51 | virtual const LLColor4& getColor() const { return mColor; } |
@@ -101,6 +99,9 @@ public: | |||
101 | S32 mImageWidth; | 99 | S32 mImageWidth; |
102 | S32 mImageHeight; | 100 | S32 mImageHeight; |
103 | 101 | ||
102 | protected: | ||
103 | virtual ~LLStyle() { } | ||
104 | |||
104 | private: | 105 | private: |
105 | BOOL mVisible; | 106 | BOOL mVisible; |
106 | LLColor4 mColor; | 107 | LLColor4 mColor; |
@@ -111,4 +112,6 @@ private: | |||
111 | BOOL mIsEmbeddedItem; | 112 | BOOL mIsEmbeddedItem; |
112 | }; | 113 | }; |
113 | 114 | ||
115 | typedef LLPointer<LLStyle> LLStyleSP; | ||
116 | |||
114 | #endif // LL_LLSTYLE_H | 117 | #endif // LL_LLSTYLE_H |
diff --git a/linden/indra/llui/lltabcontainer.cpp b/linden/indra/llui/lltabcontainer.cpp index 44f1f20..827d4fb 100644 --- a/linden/indra/llui/lltabcontainer.cpp +++ b/linden/indra/llui/lltabcontainer.cpp | |||
@@ -40,7 +40,7 @@ | |||
40 | #include "llcriticaldamp.h" | 40 | #include "llcriticaldamp.h" |
41 | #include "lluictrlfactory.h" | 41 | #include "lluictrlfactory.h" |
42 | #include "lltabcontainervertical.h" | 42 | #include "lltabcontainervertical.h" |
43 | #include "llglimmediate.h" | 43 | #include "llrender.h" |
44 | 44 | ||
45 | 45 | ||
46 | const F32 SCROLL_STEP_TIME = 0.4f; | 46 | const F32 SCROLL_STEP_TIME = 0.4f; |
diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp index 4ed936f..71522e5 100644 --- a/linden/indra/llui/lltexteditor.cpp +++ b/linden/indra/llui/lltexteditor.cpp | |||
@@ -37,7 +37,7 @@ | |||
37 | 37 | ||
38 | #include "llfontgl.h" | 38 | #include "llfontgl.h" |
39 | #include "llgl.h" | 39 | #include "llgl.h" |
40 | #include "llglimmediate.h" | 40 | #include "llrender.h" |
41 | #include "llui.h" | 41 | #include "llui.h" |
42 | #include "lluictrlfactory.h" | 42 | #include "lluictrlfactory.h" |
43 | #include "llrect.h" | 43 | #include "llrect.h" |
@@ -1244,14 +1244,14 @@ BOOL LLTextEditor::handleHover(S32 x, S32 y, MASK mask) | |||
1244 | const LLTextSegment* cur_segment = getSegmentAtLocalPos( x, y ); | 1244 | const LLTextSegment* cur_segment = getSegmentAtLocalPos( x, y ); |
1245 | if( cur_segment ) | 1245 | if( cur_segment ) |
1246 | { | 1246 | { |
1247 | if(cur_segment->getStyle().isLink()) | 1247 | if(cur_segment->getStyle()->isLink()) |
1248 | { | 1248 | { |
1249 | lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (over link, inactive)" << llendl; | 1249 | lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (over link, inactive)" << llendl; |
1250 | getWindow()->setCursor(UI_CURSOR_HAND); | 1250 | getWindow()->setCursor(UI_CURSOR_HAND); |
1251 | handled = TRUE; | 1251 | handled = TRUE; |
1252 | } | 1252 | } |
1253 | else | 1253 | else |
1254 | if(cur_segment->getStyle().getIsEmbeddedItem()) | 1254 | if(cur_segment->getStyle()->getIsEmbeddedItem()) |
1255 | { | 1255 | { |
1256 | lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (over embedded item, inactive)" << llendl; | 1256 | lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (over embedded item, inactive)" << llendl; |
1257 | getWindow()->setCursor(UI_CURSOR_HAND); | 1257 | getWindow()->setCursor(UI_CURSOR_HAND); |
@@ -2928,23 +2928,26 @@ void LLTextEditor::drawText() | |||
2928 | S32 clipped_len = clipped_end - seg_start; | 2928 | S32 clipped_len = clipped_end - seg_start; |
2929 | if( clipped_len > 0 ) | 2929 | if( clipped_len > 0 ) |
2930 | { | 2930 | { |
2931 | LLStyle style = cur_segment->getStyle(); | 2931 | LLStyleSP style = cur_segment->getStyle(); |
2932 | if ( style.isImage() && (cur_segment->getStart() >= seg_start) && (cur_segment->getStart() <= clipped_end)) | 2932 | if ( style->isImage() && (cur_segment->getStart() >= seg_start) && (cur_segment->getStart() <= clipped_end)) |
2933 | { | 2933 | { |
2934 | LLUIImagePtr image = style.getImage(); | 2934 | S32 style_image_height = style->mImageHeight; |
2935 | image->draw(llround(text_x), llround(text_y)+line_height-style.mImageHeight, style.mImageWidth, style.mImageHeight); | 2935 | S32 style_image_width = style->mImageWidth; |
2936 | LLUIImagePtr image = style->getImage(); | ||
2937 | image->draw(llround(text_x), llround(text_y)+line_height-style_image_height, | ||
2938 | style_image_width, style_image_height); | ||
2936 | } | 2939 | } |
2937 | 2940 | ||
2938 | if (cur_segment == mHoverSegment && style.getIsEmbeddedItem()) | 2941 | if (cur_segment == mHoverSegment && style->getIsEmbeddedItem()) |
2939 | { | 2942 | { |
2940 | style.mUnderline = TRUE; | 2943 | style->mUnderline = TRUE; |
2941 | } | 2944 | } |
2942 | 2945 | ||
2943 | S32 left_pos = llmin( mSelectionStart, mSelectionEnd ); | 2946 | S32 left_pos = llmin( mSelectionStart, mSelectionEnd ); |
2944 | 2947 | ||
2945 | if ( (mParseHTML) && (left_pos > seg_start) && (left_pos < clipped_end) && mIsSelecting && (mSelectionStart == mSelectionEnd) ) | 2948 | if ( (mParseHTML) && (left_pos > seg_start) && (left_pos < clipped_end) && mIsSelecting && (mSelectionStart == mSelectionEnd) ) |
2946 | { | 2949 | { |
2947 | mHTML = style.getLinkHREF(); | 2950 | mHTML = style->getLinkHREF(); |
2948 | } | 2951 | } |
2949 | 2952 | ||
2950 | drawClippedSegment( text, seg_start, clipped_end, text_x, text_y, selection_left, selection_right, style, &text_x ); | 2953 | drawClippedSegment( text, seg_start, clipped_end, text_x, text_y, selection_left, selection_right, style, &text_x ); |
@@ -2963,38 +2966,38 @@ void LLTextEditor::drawText() | |||
2963 | } | 2966 | } |
2964 | 2967 | ||
2965 | // Draws a single text segment, reversing the color for selection if needed. | 2968 | // Draws a single text segment, reversing the color for selection if needed. |
2966 | void LLTextEditor::drawClippedSegment(const LLWString &text, S32 seg_start, S32 seg_end, F32 x, F32 y, S32 selection_left, S32 selection_right, const LLStyle& style, F32* right_x ) | 2969 | void LLTextEditor::drawClippedSegment(const LLWString &text, S32 seg_start, S32 seg_end, F32 x, F32 y, S32 selection_left, S32 selection_right, const LLStyleSP& style, F32* right_x ) |
2967 | { | 2970 | { |
2968 | if (!style.isVisible()) | 2971 | if (!style->isVisible()) |
2969 | { | 2972 | { |
2970 | return; | 2973 | return; |
2971 | } | 2974 | } |
2972 | 2975 | ||
2973 | const LLFontGL* font = mGLFont; | 2976 | const LLFontGL* font = mGLFont; |
2974 | 2977 | ||
2975 | LLColor4 color = style.getColor(); | 2978 | LLColor4 color = style->getColor(); |
2976 | 2979 | ||
2977 | if ( style.getFontString()[0] ) | 2980 | if ( style->getFontString()[0] ) |
2978 | { | 2981 | { |
2979 | font = LLResMgr::getInstance()->getRes(style.getFontID()); | 2982 | font = LLResMgr::getInstance()->getRes(style->getFontID()); |
2980 | } | 2983 | } |
2981 | 2984 | ||
2982 | U8 font_flags = LLFontGL::NORMAL; | 2985 | U8 font_flags = LLFontGL::NORMAL; |
2983 | 2986 | ||
2984 | if (style.mBold) | 2987 | if (style->mBold) |
2985 | { | 2988 | { |
2986 | font_flags |= LLFontGL::BOLD; | 2989 | font_flags |= LLFontGL::BOLD; |
2987 | } | 2990 | } |
2988 | if (style.mItalic) | 2991 | if (style->mItalic) |
2989 | { | 2992 | { |
2990 | font_flags |= LLFontGL::ITALIC; | 2993 | font_flags |= LLFontGL::ITALIC; |
2991 | } | 2994 | } |
2992 | if (style.mUnderline) | 2995 | if (style->mUnderline) |
2993 | { | 2996 | { |
2994 | font_flags |= LLFontGL::UNDERLINE; | 2997 | font_flags |= LLFontGL::UNDERLINE; |
2995 | } | 2998 | } |
2996 | 2999 | ||
2997 | if (style.getIsEmbeddedItem()) | 3000 | if (style->getIsEmbeddedItem()) |
2998 | { | 3001 | { |
2999 | if (mReadOnly) | 3002 | if (mReadOnly) |
3000 | { | 3003 | { |
@@ -3434,17 +3437,17 @@ void LLTextEditor::appendColoredText(const LLString &new_text, | |||
3434 | const LLColor4 &color, | 3437 | const LLColor4 &color, |
3435 | const LLString& font_name) | 3438 | const LLString& font_name) |
3436 | { | 3439 | { |
3437 | LLStyle style; | 3440 | LLStyleSP style(new LLStyle); |
3438 | style.setVisible(true); | 3441 | style->setVisible(true); |
3439 | style.setColor(color); | 3442 | style->setColor(color); |
3440 | style.setFontName(font_name); | 3443 | style->setFontName(font_name); |
3441 | appendStyledText(new_text, allow_undo, prepend_newline, &style); | 3444 | appendStyledText(new_text, allow_undo, prepend_newline, &style); |
3442 | } | 3445 | } |
3443 | 3446 | ||
3444 | void LLTextEditor::appendStyledText(const LLString &new_text, | 3447 | void LLTextEditor::appendStyledText(const LLString &new_text, |
3445 | bool allow_undo, | 3448 | bool allow_undo, |
3446 | bool prepend_newline, | 3449 | bool prepend_newline, |
3447 | const LLStyle* style) | 3450 | const LLStyleSP *stylep) |
3448 | { | 3451 | { |
3449 | if(mParseHTML) | 3452 | if(mParseHTML) |
3450 | { | 3453 | { |
@@ -3453,17 +3456,17 @@ void LLTextEditor::appendStyledText(const LLString &new_text, | |||
3453 | LLString text = new_text; | 3456 | LLString text = new_text; |
3454 | while ( findHTML(text, &start, &end) ) | 3457 | while ( findHTML(text, &start, &end) ) |
3455 | { | 3458 | { |
3456 | LLStyle html; | 3459 | LLStyleSP html(new LLStyle); |
3457 | html.setVisible(true); | 3460 | html->setVisible(true); |
3458 | html.setColor(mLinkColor); | 3461 | html->setColor(mLinkColor); |
3459 | if (style) | 3462 | if (stylep) |
3460 | { | 3463 | { |
3461 | html.setFontName(style->getFontString()); | 3464 | html->setFontName((*stylep)->getFontString()); |
3462 | } | 3465 | } |
3463 | html.mUnderline = TRUE; | 3466 | html->mUnderline = TRUE; |
3464 | 3467 | ||
3465 | if (start > 0) appendText(text.substr(0,start),allow_undo, prepend_newline, style); | 3468 | if (start > 0) appendText(text.substr(0,start),allow_undo, prepend_newline, stylep); |
3466 | html.setLinkHREF(text.substr(start,end-start)); | 3469 | html->setLinkHREF(text.substr(start,end-start)); |
3467 | appendText(text.substr(start, end-start),allow_undo, prepend_newline, &html); | 3470 | appendText(text.substr(start, end-start),allow_undo, prepend_newline, &html); |
3468 | if (end < (S32)text.length()) | 3471 | if (end < (S32)text.length()) |
3469 | { | 3472 | { |
@@ -3475,17 +3478,17 @@ void LLTextEditor::appendStyledText(const LLString &new_text, | |||
3475 | break; | 3478 | break; |
3476 | } | 3479 | } |
3477 | } | 3480 | } |
3478 | if (end < (S32)text.length()) appendText(text,allow_undo, prepend_newline, style); | 3481 | if (end < (S32)text.length()) appendText(text,allow_undo, prepend_newline, stylep); |
3479 | } | 3482 | } |
3480 | else | 3483 | else |
3481 | { | 3484 | { |
3482 | appendText(new_text, allow_undo, prepend_newline, style); | 3485 | appendText(new_text, allow_undo, prepend_newline, stylep); |
3483 | } | 3486 | } |
3484 | } | 3487 | } |
3485 | 3488 | ||
3486 | // Appends new text to end of document | 3489 | // Appends new text to end of document |
3487 | void LLTextEditor::appendText(const LLString &new_text, bool allow_undo, bool prepend_newline, | 3490 | void LLTextEditor::appendText(const LLString &new_text, bool allow_undo, bool prepend_newline, |
3488 | const LLStyle* segment_style) | 3491 | const LLStyleSP *stylep) |
3489 | { | 3492 | { |
3490 | // Save old state | 3493 | // Save old state |
3491 | BOOL was_scrolled_to_bottom = (mScrollbar->getDocPos() == mScrollbar->getDocPosMax()); | 3494 | BOOL was_scrolled_to_bottom = (mScrollbar->getDocPos() == mScrollbar->getDocPosMax()); |
@@ -3513,11 +3516,11 @@ void LLTextEditor::appendText(const LLString &new_text, bool allow_undo, bool pr | |||
3513 | append(utf8str_to_wstring(new_text), TRUE ); | 3516 | append(utf8str_to_wstring(new_text), TRUE ); |
3514 | } | 3517 | } |
3515 | 3518 | ||
3516 | if (segment_style) | 3519 | if (stylep) |
3517 | { | 3520 | { |
3518 | S32 segment_start = old_length; | 3521 | S32 segment_start = old_length; |
3519 | S32 segment_end = getLength(); | 3522 | S32 segment_end = getLength(); |
3520 | LLTextSegment* segment = new LLTextSegment(*segment_style, segment_start, segment_end ); | 3523 | LLTextSegment* segment = new LLTextSegment(*stylep, segment_start, segment_end ); |
3521 | mSegments.push_back(segment); | 3524 | mSegments.push_back(segment); |
3522 | } | 3525 | } |
3523 | 3526 | ||
@@ -3803,8 +3806,8 @@ void LLTextEditor::findEmbeddedItemSegments() | |||
3803 | in_text = TRUE; | 3806 | in_text = TRUE; |
3804 | } | 3807 | } |
3805 | 3808 | ||
3806 | LLStyle embedded_style; | 3809 | LLStyleSP embedded_style(new LLStyle); |
3807 | embedded_style.setIsEmbeddedItem( TRUE ); | 3810 | embedded_style->setIsEmbeddedItem( TRUE ); |
3808 | 3811 | ||
3809 | // Start with i just after the first embedded item | 3812 | // Start with i just after the first embedded item |
3810 | while ( text[idx] ) | 3813 | while ( text[idx] ) |
@@ -4003,7 +4006,7 @@ BOOL LLTextEditor::exportBuffer(LLString &buffer ) | |||
4003 | LLTextSegment::LLTextSegment(S32 start) : mStart(start) | 4006 | LLTextSegment::LLTextSegment(S32 start) : mStart(start) |
4004 | { | 4007 | { |
4005 | } | 4008 | } |
4006 | LLTextSegment::LLTextSegment( const LLStyle& style, S32 start, S32 end ) : | 4009 | LLTextSegment::LLTextSegment( const LLStyleSP& style, S32 start, S32 end ) : |
4007 | mStyle( style ), | 4010 | mStyle( style ), |
4008 | mStart( start), | 4011 | mStart( start), |
4009 | mEnd( end ), | 4012 | mEnd( end ), |
@@ -4011,9 +4014,8 @@ LLTextSegment::LLTextSegment( const LLStyle& style, S32 start, S32 end ) : | |||
4011 | mIsDefault(FALSE) | 4014 | mIsDefault(FALSE) |
4012 | { | 4015 | { |
4013 | } | 4016 | } |
4014 | LLTextSegment::LLTextSegment( | 4017 | LLTextSegment::LLTextSegment( const LLColor4& color, S32 start, S32 end, BOOL is_visible) : |
4015 | const LLColor4& color, S32 start, S32 end, BOOL is_visible) : | 4018 | mStyle(new LLStyle(is_visible,color,"")), |
4016 | mStyle( is_visible, color,"" ), | ||
4017 | mStart( start), | 4019 | mStart( start), |
4018 | mEnd( end ), | 4020 | mEnd( end ), |
4019 | mToken(NULL), | 4021 | mToken(NULL), |
@@ -4021,7 +4023,7 @@ LLTextSegment::LLTextSegment( | |||
4021 | { | 4023 | { |
4022 | } | 4024 | } |
4023 | LLTextSegment::LLTextSegment( const LLColor4& color, S32 start, S32 end ) : | 4025 | LLTextSegment::LLTextSegment( const LLColor4& color, S32 start, S32 end ) : |
4024 | mStyle( TRUE, color,"" ), | 4026 | mStyle(new LLStyle(TRUE, color,"" )), |
4025 | mStart( start), | 4027 | mStart( start), |
4026 | mEnd( end ), | 4028 | mEnd( end ), |
4027 | mToken(NULL), | 4029 | mToken(NULL), |
@@ -4029,7 +4031,7 @@ LLTextSegment::LLTextSegment( const LLColor4& color, S32 start, S32 end ) : | |||
4029 | { | 4031 | { |
4030 | } | 4032 | } |
4031 | LLTextSegment::LLTextSegment( const LLColor3& color, S32 start, S32 end ) : | 4033 | LLTextSegment::LLTextSegment( const LLColor3& color, S32 start, S32 end ) : |
4032 | mStyle( TRUE, color,"" ), | 4034 | mStyle(new LLStyle(TRUE, color,"" )), |
4033 | mStart( start), | 4035 | mStart( start), |
4034 | mEnd( end ), | 4036 | mEnd( end ), |
4035 | mToken(NULL), | 4037 | mToken(NULL), |
diff --git a/linden/indra/llui/lltexteditor.h b/linden/indra/llui/lltexteditor.h index 54a34cc..d5a68ca 100644 --- a/linden/indra/llui/lltexteditor.h +++ b/linden/indra/llui/lltexteditor.h | |||
@@ -139,7 +139,7 @@ public: | |||
139 | void insertText(const LLString &text); | 139 | void insertText(const LLString &text); |
140 | // appends text at end | 140 | // appends text at end |
141 | void appendText(const LLString &wtext, bool allow_undo, bool prepend_newline, | 141 | void appendText(const LLString &wtext, bool allow_undo, bool prepend_newline, |
142 | const LLStyle* segment_style = NULL); | 142 | const LLStyleSP *stylep = NULL); |
143 | 143 | ||
144 | void appendColoredText(const LLString &wtext, bool allow_undo, | 144 | void appendColoredText(const LLString &wtext, bool allow_undo, |
145 | bool prepend_newline, | 145 | bool prepend_newline, |
@@ -148,7 +148,7 @@ public: | |||
148 | // if styled text starts a line, you need to prepend a newline. | 148 | // if styled text starts a line, you need to prepend a newline. |
149 | void appendStyledText(const LLString &new_text, bool allow_undo, | 149 | void appendStyledText(const LLString &new_text, bool allow_undo, |
150 | bool prepend_newline, | 150 | bool prepend_newline, |
151 | const LLStyle* style); | 151 | const LLStyleSP *stylep = NULL); |
152 | 152 | ||
153 | // Removes text from the end of document | 153 | // Removes text from the end of document |
154 | // Does not change highlight or cursor position. | 154 | // Does not change highlight or cursor position. |
@@ -429,7 +429,7 @@ private: | |||
429 | void drawSelectionBackground(); | 429 | void drawSelectionBackground(); |
430 | void drawCursor(); | 430 | void drawCursor(); |
431 | void drawText(); | 431 | void drawText(); |
432 | void drawClippedSegment(const LLWString &wtext, S32 seg_start, S32 seg_end, F32 x, F32 y, S32 selection_left, S32 selection_right, const LLStyle& color, F32* right_x); | 432 | void drawClippedSegment(const LLWString &wtext, S32 seg_start, S32 seg_end, F32 x, F32 y, S32 selection_left, S32 selection_right, const LLStyleSP& color, F32* right_x); |
433 | 433 | ||
434 | // | 434 | // |
435 | // Data | 435 | // Data |
@@ -528,7 +528,7 @@ class LLTextSegment | |||
528 | public: | 528 | public: |
529 | // for creating a compare value | 529 | // for creating a compare value |
530 | LLTextSegment(S32 start); | 530 | LLTextSegment(S32 start); |
531 | LLTextSegment( const LLStyle& style, S32 start, S32 end ); | 531 | LLTextSegment( const LLStyleSP& style, S32 start, S32 end ); |
532 | LLTextSegment( const LLColor4& color, S32 start, S32 end, BOOL is_visible); | 532 | LLTextSegment( const LLColor4& color, S32 start, S32 end, BOOL is_visible); |
533 | LLTextSegment( const LLColor4& color, S32 start, S32 end ); | 533 | LLTextSegment( const LLColor4& color, S32 start, S32 end ); |
534 | LLTextSegment( const LLColor3& color, S32 start, S32 end ); | 534 | LLTextSegment( const LLColor3& color, S32 start, S32 end ); |
@@ -536,10 +536,10 @@ public: | |||
536 | S32 getStart() const { return mStart; } | 536 | S32 getStart() const { return mStart; } |
537 | S32 getEnd() const { return mEnd; } | 537 | S32 getEnd() const { return mEnd; } |
538 | void setEnd( S32 end ) { mEnd = end; } | 538 | void setEnd( S32 end ) { mEnd = end; } |
539 | const LLColor4& getColor() const { return mStyle.getColor(); } | 539 | const LLColor4& getColor() const { return mStyle->getColor(); } |
540 | void setColor(const LLColor4 &color) { mStyle.setColor(color); } | 540 | void setColor(const LLColor4 &color) { mStyle->setColor(color); } |
541 | const LLStyle& getStyle() const { return mStyle; } | 541 | const LLStyleSP& getStyle() const { return mStyle; } |
542 | void setStyle(const LLStyle &style) { mStyle = style; } | 542 | void setStyle(const LLStyleSP &style) { mStyle = style; } |
543 | void setIsDefault(BOOL b) { mIsDefault = b; } | 543 | void setIsDefault(BOOL b) { mIsDefault = b; } |
544 | BOOL getIsDefault() const { return mIsDefault; } | 544 | BOOL getIsDefault() const { return mIsDefault; } |
545 | void setToken( LLKeywordToken* token ) { mToken = token; } | 545 | void setToken( LLKeywordToken* token ) { mToken = token; } |
@@ -557,7 +557,7 @@ public: | |||
557 | }; | 557 | }; |
558 | 558 | ||
559 | private: | 559 | private: |
560 | LLStyle mStyle; | 560 | LLStyleSP mStyle; |
561 | S32 mStart; | 561 | S32 mStart; |
562 | S32 mEnd; | 562 | S32 mEnd; |
563 | LLKeywordToken* mToken; | 563 | LLKeywordToken* mToken; |
diff --git a/linden/indra/llui/llui.cpp b/linden/indra/llui/llui.cpp index 45b1175..d2084e3 100644 --- a/linden/indra/llui/llui.cpp +++ b/linden/indra/llui/llui.cpp | |||
@@ -42,7 +42,7 @@ | |||
42 | #include "v2math.h" | 42 | #include "v2math.h" |
43 | #include "v4color.h" | 43 | #include "v4color.h" |
44 | #include "llgl.h" | 44 | #include "llgl.h" |
45 | #include "llglimmediate.h" | 45 | #include "llrender.h" |
46 | #include "llrect.h" | 46 | #include "llrect.h" |
47 | #include "llimagegl.h" | 47 | #include "llimagegl.h" |
48 | //#include "llviewerimage.h" | 48 | //#include "llviewerimage.h" |
@@ -493,18 +493,8 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLIma | |||
493 | 493 | ||
494 | if (solid_color) | 494 | if (solid_color) |
495 | { | 495 | { |
496 | glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); | 496 | gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR); |
497 | glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE); | 497 | gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_ALPHA, LLTexUnit::TBS_VERT_ALPHA); |
498 | glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_ARB, GL_MODULATE); | ||
499 | |||
500 | glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_PREVIOUS); | ||
501 | glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_ARB, GL_SRC_COLOR); | ||
502 | |||
503 | glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_TEXTURE); | ||
504 | glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA); | ||
505 | |||
506 | glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_ARB, GL_PRIMARY_COLOR_ARB); | ||
507 | glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_ARB, GL_SRC_ALPHA); | ||
508 | } | 498 | } |
509 | 499 | ||
510 | gGL.pushMatrix(); | 500 | gGL.pushMatrix(); |
@@ -640,7 +630,7 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLIma | |||
640 | 630 | ||
641 | if (solid_color) | 631 | if (solid_color) |
642 | { | 632 | { |
643 | glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); | 633 | gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); |
644 | } | 634 | } |
645 | } | 635 | } |
646 | 636 | ||
diff --git a/linden/indra/llui/lluictrlfactory.cpp b/linden/indra/llui/lluictrlfactory.cpp index cc8135c..7df6ebe 100644 --- a/linden/indra/llui/lluictrlfactory.cpp +++ b/linden/indra/llui/lluictrlfactory.cpp | |||
@@ -104,10 +104,17 @@ static LLRegisterWidget<LLUICtrlLocate> r2("pad"); | |||
104 | // LLUICtrlFactory() | 104 | // LLUICtrlFactory() |
105 | //----------------------------------------------------------------------------- | 105 | //----------------------------------------------------------------------------- |
106 | LLUICtrlFactory::LLUICtrlFactory() | 106 | LLUICtrlFactory::LLUICtrlFactory() |
107 | : mDummyPanel(NULL) | ||
107 | { | 108 | { |
108 | setupPaths(); | 109 | setupPaths(); |
109 | } | 110 | } |
110 | 111 | ||
112 | LLUICtrlFactory::~LLUICtrlFactory() | ||
113 | { | ||
114 | delete mDummyPanel; | ||
115 | mDummyPanel = NULL; | ||
116 | } | ||
117 | |||
111 | void LLUICtrlFactory::setupPaths() | 118 | void LLUICtrlFactory::setupPaths() |
112 | { | 119 | { |
113 | LLString filename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, "paths.xml"); | 120 | LLString filename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, "paths.xml"); |
@@ -428,10 +435,6 @@ void LLUICtrlFactory::rebuild() | |||
428 | 435 | ||
429 | LLView *LLUICtrlFactory::createCtrlWidget(LLPanel *parent, LLXMLNodePtr node) | 436 | LLView *LLUICtrlFactory::createCtrlWidget(LLPanel *parent, LLXMLNodePtr node) |
430 | { | 437 | { |
431 | // panel for holding dummy widgets, so they have a parent for layout purposes, etc. | ||
432 | // does not manage lifetime of child widgets | ||
433 | static LLPanel dummy_panel; | ||
434 | |||
435 | LLString ctrl_type = node->getName()->mString; | 438 | LLString ctrl_type = node->getName()->mString; |
436 | LLString::toLower(ctrl_type); | 439 | LLString::toLower(ctrl_type); |
437 | 440 | ||
@@ -445,7 +448,11 @@ LLView *LLUICtrlFactory::createCtrlWidget(LLPanel *parent, LLXMLNodePtr node) | |||
445 | 448 | ||
446 | if (parent == NULL) | 449 | if (parent == NULL) |
447 | { | 450 | { |
448 | parent = &dummy_panel; | 451 | if (mDummyPanel == NULL) |
452 | { | ||
453 | mDummyPanel = new LLPanel; | ||
454 | } | ||
455 | parent = mDummyPanel; | ||
449 | } | 456 | } |
450 | LLView *ctrl = func(node, parent, this); | 457 | LLView *ctrl = func(node, parent, this); |
451 | 458 | ||
diff --git a/linden/indra/llui/lluictrlfactory.h b/linden/indra/llui/lluictrlfactory.h index b9325a0..0c1d9dd 100644 --- a/linden/indra/llui/lluictrlfactory.h +++ b/linden/indra/llui/lluictrlfactory.h | |||
@@ -46,7 +46,7 @@ class LLUICtrlFactory : public LLSingleton<LLUICtrlFactory> | |||
46 | public: | 46 | public: |
47 | LLUICtrlFactory(); | 47 | LLUICtrlFactory(); |
48 | // do not call! needs to be public so run-time can clean up the singleton | 48 | // do not call! needs to be public so run-time can clean up the singleton |
49 | virtual ~LLUICtrlFactory() {} | 49 | virtual ~LLUICtrlFactory(); |
50 | 50 | ||
51 | void setupPaths(); | 51 | void setupPaths(); |
52 | 52 | ||
@@ -88,6 +88,8 @@ private: | |||
88 | std::deque<const LLCallbackMap::map_t*> mFactoryStack; | 88 | std::deque<const LLCallbackMap::map_t*> mFactoryStack; |
89 | 89 | ||
90 | static std::vector<LLString> mXUIPaths; | 90 | static std::vector<LLString> mXUIPaths; |
91 | |||
92 | LLPanel* mDummyPanel; | ||
91 | }; | 93 | }; |
92 | 94 | ||
93 | 95 | ||
diff --git a/linden/indra/llui/llview.cpp b/linden/indra/llui/llview.cpp index 750821c..91c9564 100644 --- a/linden/indra/llui/llview.cpp +++ b/linden/indra/llui/llview.cpp | |||
@@ -37,7 +37,7 @@ | |||
37 | #include <cassert> | 37 | #include <cassert> |
38 | #include <boost/tokenizer.hpp> | 38 | #include <boost/tokenizer.hpp> |
39 | 39 | ||
40 | #include "llglimmediate.h" | 40 | #include "llrender.h" |
41 | #include "llevent.h" | 41 | #include "llevent.h" |
42 | #include "llfontgl.h" | 42 | #include "llfontgl.h" |
43 | #include "llfocusmgr.h" | 43 | #include "llfocusmgr.h" |
diff --git a/linden/indra/llui/llviewborder.cpp b/linden/indra/llui/llviewborder.cpp index e9b7ca5..c354ac5 100644 --- a/linden/indra/llui/llviewborder.cpp +++ b/linden/indra/llui/llviewborder.cpp | |||
@@ -30,7 +30,7 @@ | |||
30 | 30 | ||
31 | #include "linden_common.h" | 31 | #include "linden_common.h" |
32 | #include "llviewborder.h" | 32 | #include "llviewborder.h" |
33 | #include "llglimmediate.h" | 33 | #include "llrender.h" |
34 | #include "llfocusmgr.h" | 34 | #include "llfocusmgr.h" |
35 | 35 | ||
36 | static LLRegisterWidget<LLViewBorder> r("view_border"); | 36 | static LLRegisterWidget<LLViewBorder> r("view_border"); |