aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/lllineeditor.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:59 -0500
committerJacek Antonelli2008-08-15 23:44:59 -0500
commita408bac29378072fbf36864164149458c978cfcc (patch)
tree67feccf1a5d3816611ba48d6762f86f0f7f4b1f6 /linden/indra/llui/lllineeditor.cpp
parentSecond Life viewer sources 1.17.0.12 (diff)
downloadmeta-impy-a408bac29378072fbf36864164149458c978cfcc.zip
meta-impy-a408bac29378072fbf36864164149458c978cfcc.tar.gz
meta-impy-a408bac29378072fbf36864164149458c978cfcc.tar.bz2
meta-impy-a408bac29378072fbf36864164149458c978cfcc.tar.xz
Second Life viewer sources 1.17.1.0
Diffstat (limited to 'linden/indra/llui/lllineeditor.cpp')
-rw-r--r--linden/indra/llui/lllineeditor.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/linden/indra/llui/lllineeditor.cpp b/linden/indra/llui/lllineeditor.cpp
index 44616b9..98286fa 100644
--- a/linden/indra/llui/lllineeditor.cpp
+++ b/linden/indra/llui/lllineeditor.cpp
@@ -220,6 +220,9 @@ LLString LLLineEditor::getWidgetTag() const
220 220
221void LLLineEditor::onFocusLost() 221void LLLineEditor::onFocusLost()
222{ 222{
223 // Need to notify early when loosing focus.
224 getWindow()->allowLanguageTextInput(FALSE);
225
223 LLUICtrl::onFocusLost(); 226 LLUICtrl::onFocusLost();
224 227
225 if( mCommitOnFocusLost && mText.getString() != mPrevText) 228 if( mCommitOnFocusLost && mText.getString() != mPrevText)
@@ -1130,7 +1133,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask)
1130 1133
1131 // handle ctrl-uparrow if we have a history enabled line editor. 1134 // handle ctrl-uparrow if we have a history enabled line editor.
1132 case KEY_UP: 1135 case KEY_UP:
1133 if( mHaveHistory && ( MASK_CONTROL & mask ) ) 1136 if( mHaveHistory && ( MASK_CONTROL == mask ) )
1134 { 1137 {
1135 if( mCurrentHistoryLine > 0 ) 1138 if( mCurrentHistoryLine > 0 )
1136 { 1139 {
@@ -1147,7 +1150,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask)
1147 1150
1148 // handle ctrl-downarrow if we have a history enabled line editor 1151 // handle ctrl-downarrow if we have a history enabled line editor
1149 case KEY_DOWN: 1152 case KEY_DOWN:
1150 if( mHaveHistory && ( MASK_CONTROL & mask ) ) 1153 if( mHaveHistory && ( MASK_CONTROL == mask ) )
1151 { 1154 {
1152 if( !mLineHistory.empty() && mCurrentHistoryLine < mLineHistory.size() - 1 ) 1155 if( !mLineHistory.empty() && mCurrentHistoryLine < mLineHistory.size() - 1 )
1153 { 1156 {
@@ -1646,6 +1649,12 @@ void LLLineEditor::setFocus( BOOL new_state )
1646{ 1649{
1647 BOOL old_state = hasFocus(); 1650 BOOL old_state = hasFocus();
1648 1651
1652 if (!new_state)
1653 {
1654 getWindow()->allowLanguageTextInput(FALSE);
1655 }
1656
1657
1649 // getting focus when we didn't have it before, and we want to select all 1658 // getting focus when we didn't have it before, and we want to select all
1650 if (!old_state && new_state && mSelectAllonFocusReceived) 1659 if (!old_state && new_state && mSelectAllonFocusReceived)
1651 { 1660 {
@@ -1676,6 +1685,16 @@ void LLLineEditor::setFocus( BOOL new_state )
1676 } 1685 }
1677 1686
1678 LLUICtrl::setFocus( new_state ); 1687 LLUICtrl::setFocus( new_state );
1688
1689 if (new_state)
1690 {
1691 // Allow Language Text Input only when this LineEditor has
1692 // no prevalidate function attached. This criterion works
1693 // fine on 1.15.0.2, since all prevalidate func reject any
1694 // non-ASCII characters. I'm not sure on future versions,
1695 // however.
1696 getWindow()->allowLanguageTextInput(mPrevalidateFunc == NULL);
1697 }
1679} 1698}
1680 1699
1681//virtual 1700//virtual