summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/lllineeditor.cpp10
-rw-r--r--indra/llui/lllineeditor.h3
2 files changed, 11 insertions, 2 deletions
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index d0fbf4b913..1f7843b79d 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -151,7 +151,8 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p)
mHighlightColor(p.highlight_color()),
mPreeditBgColor(p.preedit_bg_color()),
mGLFont(p.font),
- mContextMenuHandle()
+ mContextMenuHandle(),
+ mAutocorrectCallback()
{
llassert( mMaxLengthBytes > 0 );
@@ -195,7 +196,6 @@ LLLineEditor::~LLLineEditor()
gFocusMgr.releaseFocusIfNeeded( this );
}
-
void LLLineEditor::onFocusReceived()
{
gEditMenuHandler = this;
@@ -866,6 +866,12 @@ void LLLineEditor::addChar(const llwchar uni_char)
LLUI::reportBadKeystroke();
}
+ if (!mReadOnly && mAutocorrectCallback != NULL)
+ {
+ // call callback
+ mAutocorrectCallback(mText, mCursorPos);
+ }
+
getWindow()->hideCursorUntilMouseMove();
}
diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h
index 2518dbe3c7..53af9ac996 100644
--- a/indra/llui/lllineeditor.h
+++ b/indra/llui/lllineeditor.h
@@ -169,6 +169,9 @@ public:
virtual BOOL setTextArg( const std::string& key, const LLStringExplicit& text );
virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text );
+ typedef boost::function<void(LLUIString&, S32&)> autocorrect_callback_t;
+ autocorrect_callback_t mAutocorrectCallback;
+ void setAutocorrectCallback(autocorrect_callback_t cb) { mAutocorrectCallback = cb; }
void setLabel(const LLStringExplicit &new_label) { mLabel = new_label; }
const std::string& getLabel() { return mLabel.getString(); }