diff options
author | Kelly Washington <kelly@lindenlab.com> | 2007-06-21 22:40:22 +0000 |
---|---|---|
committer | Kelly Washington <kelly@lindenlab.com> | 2007-06-21 22:40:22 +0000 |
commit | e03bb0606a10f29c8b94909a713a5bb5c69e88b7 (patch) | |
tree | 6d8d07894579438c8cc70e08f5730c3c95dfe768 /indra/llui/lllineeditor.cpp | |
parent | 2638f12f95eea692502836cf6548b4a0b234d009 (diff) |
merge -r62831:64079 branches/maintenance to release
Diffstat (limited to 'indra/llui/lllineeditor.cpp')
-rw-r--r-- | indra/llui/lllineeditor.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 7e7999c9f9..5e043ecea3 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -200,6 +200,9 @@ LLString LLLineEditor::getWidgetTag() const void LLLineEditor::onFocusLost() { + // Need to notify early when loosing focus. + getWindow()->allowLanguageTextInput(FALSE); + LLUICtrl::onFocusLost(); if( mCommitOnFocusLost && mText.getString() != mPrevText) @@ -1110,7 +1113,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) // handle ctrl-uparrow if we have a history enabled line editor. case KEY_UP: - if( mHaveHistory && ( MASK_CONTROL & mask ) ) + if( mHaveHistory && ( MASK_CONTROL == mask ) ) { if( mCurrentHistoryLine > 0 ) { @@ -1127,7 +1130,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) // handle ctrl-downarrow if we have a history enabled line editor case KEY_DOWN: - if( mHaveHistory && ( MASK_CONTROL & mask ) ) + if( mHaveHistory && ( MASK_CONTROL == mask ) ) { if( !mLineHistory.empty() && mCurrentHistoryLine < mLineHistory.size() - 1 ) { @@ -1626,6 +1629,12 @@ void LLLineEditor::setFocus( BOOL new_state ) { BOOL old_state = hasFocus(); + if (!new_state) + { + getWindow()->allowLanguageTextInput(FALSE); + } + + // getting focus when we didn't have it before, and we want to select all if (!old_state && new_state && mSelectAllonFocusReceived) { @@ -1656,6 +1665,16 @@ void LLLineEditor::setFocus( BOOL new_state ) } LLUICtrl::setFocus( new_state ); + + if (new_state) + { + // Allow Language Text Input only when this LineEditor has + // no prevalidate function attached. This criterion works + // fine on 1.15.0.2, since all prevalidate func reject any + // non-ASCII characters. I'm not sure on future versions, + // however. + getWindow()->allowLanguageTextInput(mPrevalidateFunc == NULL); + } } //virtual |