diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llui/lltexteditor.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp index 552a9c9..12ad339 100644 --- a/linden/indra/llui/lltexteditor.cpp +++ b/linden/indra/llui/lltexteditor.cpp | |||
@@ -2,6 +2,8 @@ | |||
2 | * @file lltexteditor.cpp | 2 | * @file lltexteditor.cpp |
3 | * @brief LLTextEditor base class | 3 | * @brief LLTextEditor base class |
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | ||
6 | * | ||
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 7 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 8 | * |
7 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
@@ -24,6 +26,7 @@ | |||
24 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | 26 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO |
25 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 27 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
26 | * COMPLETENESS OR PERFORMANCE. | 28 | * COMPLETENESS OR PERFORMANCE. |
29 | * $/LicenseInfo$ | ||
27 | */ | 30 | */ |
28 | 31 | ||
29 | // Text editor widget to let users enter a a multi-line ASCII document. | 32 | // Text editor widget to let users enter a a multi-line ASCII document. |
@@ -78,7 +81,8 @@ const S32 SPACES_PER_TAB = 4; | |||
78 | 81 | ||
79 | LLColor4 LLTextEditor::mLinkColor = LLColor4::blue; | 82 | LLColor4 LLTextEditor::mLinkColor = LLColor4::blue; |
80 | void (* LLTextEditor::mURLcallback)(const char*) = NULL; | 83 | void (* LLTextEditor::mURLcallback)(const char*) = NULL; |
81 | BOOL (* LLTextEditor::mSecondlifeURLcallback)(LLString) = NULL; | 84 | bool (* LLTextEditor::mSecondlifeURLcallback)(const std::string&) = NULL; |
85 | bool (* LLTextEditor::mSecondlifeURLcallbackRightClick)(const std::string&) = NULL; | ||
82 | 86 | ||
83 | /////////////////////////////////////////////////////////////////// | 87 | /////////////////////////////////////////////////////////////////// |
84 | //virtuals | 88 | //virtuals |
@@ -306,7 +310,8 @@ LLTextEditor::LLTextEditor( | |||
306 | mMouseDownX(0), | 310 | mMouseDownX(0), |
307 | mMouseDownY(0), | 311 | mMouseDownY(0), |
308 | mLastSelectionX(-1), | 312 | mLastSelectionX(-1), |
309 | mLastSelectionY(-1) | 313 | mLastSelectionY(-1), |
314 | mLastIMEPosition(-1,-1) | ||
310 | { | 315 | { |
311 | mSourceID.generate(); | 316 | mSourceID.generate(); |
312 | 317 | ||
@@ -515,7 +520,7 @@ void LLTextEditor::truncate() | |||
515 | } | 520 | } |
516 | } | 521 | } |
517 | 522 | ||
518 | void LLTextEditor::setText(const LLString &utf8str) | 523 | void LLTextEditor::setText(const LLStringExplicit &utf8str) |
519 | { | 524 | { |
520 | // LLString::removeCRLF(utf8str); | 525 | // LLString::removeCRLF(utf8str); |
521 | mUTF8Text = utf8str_removeCRLF(utf8str); | 526 | mUTF8Text = utf8str_removeCRLF(utf8str); |
@@ -2819,7 +2824,15 @@ void LLTextEditor::drawCursor() | |||
2819 | 1); | 2824 | 1); |
2820 | } | 2825 | } |
2821 | 2826 | ||
2822 | 2827 | // Make sure the IME is in the right place | |
2828 | LLRect screen_pos = getScreenRect(); | ||
2829 | LLCoordGL ime_pos( screen_pos.mLeft + llfloor(cursor_left), screen_pos.mBottom + llfloor(cursor_top) ); | ||
2830 | if ( ime_pos.mX != mLastIMEPosition.mX || ime_pos.mY != mLastIMEPosition.mY ) | ||
2831 | { | ||
2832 | mLastIMEPosition.mX = ime_pos.mX; | ||
2833 | mLastIMEPosition.mY = ime_pos.mY; | ||
2834 | getWindow()->setLanguageTextInput( ime_pos ); | ||
2835 | } | ||
2823 | } | 2836 | } |
2824 | } | 2837 | } |
2825 | } | 2838 | } |
@@ -3055,7 +3068,7 @@ void LLTextEditor::onTabInto() | |||
3055 | 3068 | ||
3056 | void LLTextEditor::clear() | 3069 | void LLTextEditor::clear() |
3057 | { | 3070 | { |
3058 | setText(""); | 3071 | setText(LLString::null); |
3059 | } | 3072 | } |
3060 | 3073 | ||
3061 | // Start or stop the editor from accepting text-editing keystrokes | 3074 | // Start or stop the editor from accepting text-editing keystrokes |
@@ -3936,7 +3949,7 @@ BOOL LLTextEditor::importBuffer(const LLString& buffer ) | |||
3936 | if( success ) | 3949 | if( success ) |
3937 | { | 3950 | { |
3938 | // Actually set the text | 3951 | // Actually set the text |
3939 | setText( text ); | 3952 | setText( LLStringExplicit(text) ); |
3940 | } | 3953 | } |
3941 | 3954 | ||
3942 | delete[] text; | 3955 | delete[] text; |