diff options
author | McCabe Maxsted | 2009-09-11 20:20:13 -0700 |
---|---|---|
committer | McCabe Maxsted | 2009-09-11 20:20:13 -0700 |
commit | 23eb89d76a254235872b530e047c1f39df1d122a (patch) | |
tree | 95c843ae96607d2c1221dcb49b266d154eae213a /linden/indra/llui | |
parent | Fixed profile account info spacing (diff) | |
parent | Backported clickable object names from 1.23 (diff) | |
download | meta-impy-23eb89d76a254235872b530e047c1f39df1d122a.zip meta-impy-23eb89d76a254235872b530e047c1f39df1d122a.tar.gz meta-impy-23eb89d76a254235872b530e047c1f39df1d122a.tar.bz2 meta-impy-23eb89d76a254235872b530e047c1f39df1d122a.tar.xz |
Merged in 1.2.0-objectnames
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llui/llpanel.cpp | 4 | ||||
-rw-r--r-- | linden/indra/llui/llpanel.h | 2 | ||||
-rw-r--r-- | linden/indra/llui/lltextbox.cpp | 7 | ||||
-rw-r--r-- | linden/indra/llui/lltextbox.h | 3 | ||||
-rw-r--r-- | linden/indra/llui/lltexteditor.cpp | 16 | ||||
-rw-r--r-- | linden/indra/llui/lltexteditor.h | 8 | ||||
-rw-r--r-- | linden/indra/llui/llview.cpp | 20 | ||||
-rw-r--r-- | linden/indra/llui/llview.h | 5 |
8 files changed, 40 insertions, 25 deletions
diff --git a/linden/indra/llui/llpanel.cpp b/linden/indra/llui/llpanel.cpp index d37517f..05103dc 100644 --- a/linden/indra/llui/llpanel.cpp +++ b/linden/indra/llui/llpanel.cpp | |||
@@ -982,12 +982,12 @@ void LLPanel::childSetAction(const std::string& id, void(*function)(void*), void | |||
982 | } | 982 | } |
983 | } | 983 | } |
984 | 984 | ||
985 | void LLPanel::childSetActionTextbox(const std::string& id, void(*function)(void*)) | 985 | void LLPanel::childSetActionTextbox(const std::string& id, void(*function)(void*), void* value) |
986 | { | 986 | { |
987 | LLTextBox* textbox = getChild<LLTextBox>(id); | 987 | LLTextBox* textbox = getChild<LLTextBox>(id); |
988 | if (textbox) | 988 | if (textbox) |
989 | { | 989 | { |
990 | textbox->setClickedCallback(function); | 990 | textbox->setClickedCallback(function, value); |
991 | } | 991 | } |
992 | } | 992 | } |
993 | 993 | ||
diff --git a/linden/indra/llui/llpanel.h b/linden/indra/llui/llpanel.h index 46022e5..8dea9b1 100644 --- a/linden/indra/llui/llpanel.h +++ b/linden/indra/llui/llpanel.h | |||
@@ -220,7 +220,7 @@ public: | |||
220 | 220 | ||
221 | // LLButton | 221 | // LLButton |
222 | void childSetAction(const std::string& id, void(*function)(void*), void* value); | 222 | void childSetAction(const std::string& id, void(*function)(void*), void* value); |
223 | void childSetActionTextbox(const std::string& id, void(*function)(void*)); | 223 | void childSetActionTextbox(const std::string& id, void(*function)(void*), void* value = NULL); |
224 | void childSetControlName(const std::string& id, const std::string& control_name); | 224 | void childSetControlName(const std::string& id, const std::string& control_name); |
225 | 225 | ||
226 | // Error reporting | 226 | // Error reporting |
diff --git a/linden/indra/llui/lltextbox.cpp b/linden/indra/llui/lltextbox.cpp index f43b7d2..e45f97b 100644 --- a/linden/indra/llui/lltextbox.cpp +++ b/linden/indra/llui/lltextbox.cpp | |||
@@ -33,6 +33,7 @@ | |||
33 | #include "lltextbox.h" | 33 | #include "lltextbox.h" |
34 | #include "lluictrlfactory.h" | 34 | #include "lluictrlfactory.h" |
35 | #include "llfocusmgr.h" | 35 | #include "llfocusmgr.h" |
36 | #include "llwindow.h" | ||
36 | 37 | ||
37 | static LLRegisterWidget<LLTextBox> r("text"); | 38 | static LLRegisterWidget<LLTextBox> r("text"); |
38 | 39 | ||
@@ -193,12 +194,14 @@ BOOL LLTextBox::handleMouseUp(S32 x, S32 y, MASK mask) | |||
193 | 194 | ||
194 | BOOL LLTextBox::handleHover(S32 x, S32 y, MASK mask) | 195 | BOOL LLTextBox::handleHover(S32 x, S32 y, MASK mask) |
195 | { | 196 | { |
197 | BOOL handled = LLView::handleHover(x,y,mask); | ||
196 | if(mHoverActive) | 198 | if(mHoverActive) |
197 | { | 199 | { |
198 | mHasHover = TRUE; // This should be set every frame during a hover. | 200 | mHasHover = TRUE; // This should be set every frame during a hover. |
199 | return TRUE; | 201 | getWindow()->setCursor(UI_CURSOR_ARROW); |
200 | } | 202 | } |
201 | return LLView::handleHover(x,y,mask); | 203 | |
204 | return (handled || mHasHover); | ||
202 | } | 205 | } |
203 | 206 | ||
204 | void LLTextBox::setText(const LLStringExplicit& text) | 207 | void LLTextBox::setText(const LLStringExplicit& text) |
diff --git a/linden/indra/llui/lltextbox.h b/linden/indra/llui/lltextbox.h index 83e4a9b..aac5344 100644 --- a/linden/indra/llui/lltextbox.h +++ b/linden/indra/llui/lltextbox.h | |||
@@ -88,8 +88,7 @@ public: | |||
88 | void setVPad(S32 pixels) { mVPad = pixels; } | 88 | void setVPad(S32 pixels) { mVPad = pixels; } |
89 | void setRightAlign() { mHAlign = LLFontGL::RIGHT; } | 89 | void setRightAlign() { mHAlign = LLFontGL::RIGHT; } |
90 | void setHAlign( LLFontGL::HAlign align ) { mHAlign = align; } | 90 | void setHAlign( LLFontGL::HAlign align ) { mHAlign = align; } |
91 | void setClickedCallback( void (*cb)(void *data) ){ mClickedCallback = cb; } // mouse down and up within button | 91 | void setClickedCallback( void (*cb)(void *data), void* data = NULL ){ mClickedCallback = cb; mCallbackUserData = data; } // mouse down and up within button |
92 | void setCallbackUserData( void* data ) { mCallbackUserData = data; } | ||
93 | 92 | ||
94 | const LLFontGL* getFont() const { return mFontGL; } | 93 | const LLFontGL* getFont() const { return mFontGL; } |
95 | 94 | ||
diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp index 95cce60..8fa253a 100644 --- a/linden/indra/llui/lltexteditor.cpp +++ b/linden/indra/llui/lltexteditor.cpp | |||
@@ -3605,13 +3605,13 @@ void LLTextEditor::appendColoredText(const std::string &new_text, | |||
3605 | style->setVisible(true); | 3605 | style->setVisible(true); |
3606 | style->setColor(color); | 3606 | style->setColor(color); |
3607 | style->setFontName(font_name); | 3607 | style->setFontName(font_name); |
3608 | appendStyledText(new_text, allow_undo, prepend_newline, &style); | 3608 | appendStyledText(new_text, allow_undo, prepend_newline, style); |
3609 | } | 3609 | } |
3610 | 3610 | ||
3611 | void LLTextEditor::appendStyledText(const std::string &new_text, | 3611 | void LLTextEditor::appendStyledText(const std::string &new_text, |
3612 | bool allow_undo, | 3612 | bool allow_undo, |
3613 | bool prepend_newline, | 3613 | bool prepend_newline, |
3614 | const LLStyleSP *stylep) | 3614 | const LLStyleSP stylep) |
3615 | { | 3615 | { |
3616 | if(mParseHTML) | 3616 | if(mParseHTML) |
3617 | { | 3617 | { |
@@ -3626,14 +3626,14 @@ void LLTextEditor::appendStyledText(const std::string &new_text, | |||
3626 | html->setColor(mLinkColor); | 3626 | html->setColor(mLinkColor); |
3627 | if (stylep) | 3627 | if (stylep) |
3628 | { | 3628 | { |
3629 | html->setFontName((*stylep)->getFontString()); | 3629 | html->setFontName(stylep->getFontString()); |
3630 | } | 3630 | } |
3631 | html->mUnderline = TRUE; | 3631 | html->mUnderline = TRUE; |
3632 | 3632 | ||
3633 | if (start > 0) appendText(text.substr(0,start),allow_undo, prepend_newline, stylep); | 3633 | if (start > 0) appendText(text.substr(0,start),allow_undo, prepend_newline, stylep); |
3634 | html->setLinkHREF(text.substr(start,end-start)); | 3634 | html->setLinkHREF(text.substr(start,end-start)); |
3635 | appendText(text.substr(start, end-start),allow_undo, prepend_newline, &html); | 3635 | appendText(text.substr(start, end-start),allow_undo, prepend_newline, html); |
3636 | if (end < (S32)text.length()) | 3636 | if (end < (S32)text.length()) |
3637 | { | 3637 | { |
3638 | text = text.substr(end,text.length() - end); | 3638 | text = text.substr(end,text.length() - end); |
3639 | end=0; | 3639 | end=0; |
@@ -3653,7 +3653,7 @@ void LLTextEditor::appendStyledText(const std::string &new_text, | |||
3653 | 3653 | ||
3654 | // Appends new text to end of document | 3654 | // Appends new text to end of document |
3655 | void LLTextEditor::appendText(const std::string &new_text, bool allow_undo, bool prepend_newline, | 3655 | void LLTextEditor::appendText(const std::string &new_text, bool allow_undo, bool prepend_newline, |
3656 | const LLStyleSP *stylep) | 3656 | const LLStyleSP stylep) |
3657 | { | 3657 | { |
3658 | // Save old state | 3658 | // Save old state |
3659 | BOOL was_scrolled_to_bottom = (mScrollbar->getDocPos() == mScrollbar->getDocPosMax()); | 3659 | BOOL was_scrolled_to_bottom = (mScrollbar->getDocPos() == mScrollbar->getDocPosMax()); |
@@ -3685,7 +3685,7 @@ void LLTextEditor::appendText(const std::string &new_text, bool allow_undo, bool | |||
3685 | { | 3685 | { |
3686 | S32 segment_start = old_length; | 3686 | S32 segment_start = old_length; |
3687 | S32 segment_end = getLength(); | 3687 | S32 segment_end = getLength(); |
3688 | LLTextSegment* segment = new LLTextSegment(*stylep, segment_start, segment_end ); | 3688 | LLTextSegment* segment = new LLTextSegment(stylep, segment_start, segment_end ); |
3689 | mSegments.push_back(segment); | 3689 | mSegments.push_back(segment); |
3690 | } | 3690 | } |
3691 | 3691 | ||
diff --git a/linden/indra/llui/lltexteditor.h b/linden/indra/llui/lltexteditor.h index 0777e5f..7e93de1 100644 --- a/linden/indra/llui/lltexteditor.h +++ b/linden/indra/llui/lltexteditor.h | |||
@@ -146,16 +146,16 @@ public: | |||
146 | void insertText(const std::string &text); | 146 | void insertText(const std::string &text); |
147 | // appends text at end | 147 | // appends text at end |
148 | void appendText(const std::string &wtext, bool allow_undo, bool prepend_newline, | 148 | void appendText(const std::string &wtext, bool allow_undo, bool prepend_newline, |
149 | const LLStyleSP *stylep = NULL); | 149 | const LLStyleSP stylep = NULL); |
150 | 150 | ||
151 | void appendColoredText(const std::string &wtext, bool allow_undo, | 151 | void appendColoredText(const std::string &wtext, bool allow_undo, |
152 | bool prepend_newline, | 152 | bool prepend_newline, |
153 | const LLColor4 &color, | 153 | const LLColor4 &color, |
154 | const std::string& font_name = LLStringUtil::null); | 154 | const std::string& font_name = LLStringUtil::null); |
155 | // if styled text starts a line, you need to prepend a newline. | 155 | // if styled text starts a line, you need to prepend a newline. |
156 | void appendStyledText(const std::string &new_text, bool allow_undo, | 156 | void appendStyledText(const std::string &new_text, bool allow_undo, |
157 | bool prepend_newline, | 157 | bool prepend_newline, |
158 | const LLStyleSP *stylep = NULL); | 158 | const LLStyleSP stylep = NULL); |
159 | 159 | ||
160 | // Removes text from the end of document | 160 | // Removes text from the end of document |
161 | // Does not change highlight or cursor position. | 161 | // Does not change highlight or cursor position. |
diff --git a/linden/indra/llui/llview.cpp b/linden/indra/llui/llview.cpp index 78bf168..e3652b7 100644 --- a/linden/indra/llui/llview.cpp +++ b/linden/indra/llui/llview.cpp | |||
@@ -85,7 +85,8 @@ LLView::LLView() : | |||
85 | mLastVisible(TRUE), | 85 | mLastVisible(TRUE), |
86 | mUseBoundingRect(FALSE), | 86 | mUseBoundingRect(FALSE), |
87 | mVisible(TRUE), | 87 | mVisible(TRUE), |
88 | mNextInsertionOrdinal(0) | 88 | mNextInsertionOrdinal(0), |
89 | mHoverCursor(UI_CURSOR_ARROW) | ||
89 | { | 90 | { |
90 | } | 91 | } |
91 | 92 | ||
@@ -102,7 +103,8 @@ LLView::LLView(const std::string& name, BOOL mouse_opaque) : | |||
102 | mLastVisible(TRUE), | 103 | mLastVisible(TRUE), |
103 | mUseBoundingRect(FALSE), | 104 | mUseBoundingRect(FALSE), |
104 | mVisible(TRUE), | 105 | mVisible(TRUE), |
105 | mNextInsertionOrdinal(0) | 106 | mNextInsertionOrdinal(0), |
107 | mHoverCursor(UI_CURSOR_ARROW) | ||
106 | { | 108 | { |
107 | } | 109 | } |
108 | 110 | ||
@@ -123,7 +125,8 @@ LLView::LLView( | |||
123 | mLastVisible(TRUE), | 125 | mLastVisible(TRUE), |
124 | mUseBoundingRect(FALSE), | 126 | mUseBoundingRect(FALSE), |
125 | mVisible(TRUE), | 127 | mVisible(TRUE), |
126 | mNextInsertionOrdinal(0) | 128 | mNextInsertionOrdinal(0), |
129 | mHoverCursor(UI_CURSOR_ARROW) | ||
127 | { | 130 | { |
128 | } | 131 | } |
129 | 132 | ||
@@ -657,7 +660,7 @@ BOOL LLView::handleHover(S32 x, S32 y, MASK mask) | |||
657 | if( !handled | 660 | if( !handled |
658 | && blockMouseEvent(x, y) ) | 661 | && blockMouseEvent(x, y) ) |
659 | { | 662 | { |
660 | LLUI::sWindow->setCursor(UI_CURSOR_ARROW); | 663 | LLUI::sWindow->setCursor(mHoverCursor); |
661 | lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << llendl; | 664 | lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << llendl; |
662 | handled = TRUE; | 665 | handled = TRUE; |
663 | } | 666 | } |
@@ -2622,7 +2625,14 @@ void LLView::initFromXML(LLXMLNodePtr node, LLView* parent) | |||
2622 | node->getAttributeBOOL("visible", visible); | 2625 | node->getAttributeBOOL("visible", visible); |
2623 | setVisible(visible); | 2626 | setVisible(visible); |
2624 | } | 2627 | } |
2625 | 2628 | ||
2629 | if (node->hasAttribute("hover_cursor")) | ||
2630 | { | ||
2631 | std::string cursor_string; | ||
2632 | node->getAttributeString("hover_cursor", cursor_string); | ||
2633 | mHoverCursor = getCursorFromString(cursor_string); | ||
2634 | } | ||
2635 | |||
2626 | node->getAttributeBOOL("use_bounding_rect", mUseBoundingRect); | 2636 | node->getAttributeBOOL("use_bounding_rect", mUseBoundingRect); |
2627 | node->getAttributeBOOL("mouse_opaque", mMouseOpaque); | 2637 | node->getAttributeBOOL("mouse_opaque", mMouseOpaque); |
2628 | 2638 | ||
diff --git a/linden/indra/llui/llview.h b/linden/indra/llui/llview.h index da7f164..df34a3e 100644 --- a/linden/indra/llui/llview.h +++ b/linden/indra/llui/llview.h | |||
@@ -51,6 +51,7 @@ | |||
51 | #include "llxmlnode.h" | 51 | #include "llxmlnode.h" |
52 | #include "stdenums.h" | 52 | #include "stdenums.h" |
53 | #include "lluistring.h" | 53 | #include "lluistring.h" |
54 | #include "llcursortypes.h" | ||
54 | 55 | ||
55 | const U32 FOLLOWS_NONE = 0x00; | 56 | const U32 FOLLOWS_NONE = 0x00; |
56 | const U32 FOLLOWS_LEFT = 0x01; | 57 | const U32 FOLLOWS_LEFT = 0x01; |
@@ -653,7 +654,9 @@ private: | |||
653 | mutable dummy_widget_map_t mDummyWidgets; | 654 | mutable dummy_widget_map_t mDummyWidgets; |
654 | 655 | ||
655 | boost::signals::connection mControlConnection; | 656 | boost::signals::connection mControlConnection; |
656 | 657 | ||
658 | ECursorType mHoverCursor; | ||
659 | |||
657 | public: | 660 | public: |
658 | static BOOL sDebugRects; // Draw debug rects behind everything. | 661 | static BOOL sDebugRects; // Draw debug rects behind everything. |
659 | static BOOL sDebugKeys; | 662 | static BOOL sDebugKeys; |