diff options
| author | Ima Mechanique <ima.mechanique@secondlife.com> | 2013-10-04 20:47:54 +0100 |
|---|---|---|
| committer | Ima Mechanique <ima.mechanique@secondlife.com> | 2013-10-04 20:47:54 +0100 |
| commit | 0c1d6d7d9e89a6d3169621157bcba335ead477a9 (patch) | |
| tree | c5523eeb99bcd8ee77cf28a1d6f5e5cef8b52f2c /indra/newview/llpreviewscript.cpp | |
| parent | 02097397e06a6cf45c639823c7f633dffe3684e8 (diff) | |
| parent | f7158bc5afcec1da8b9d2d5a4ed86921e62d4959 (diff) | |
Merge v3.6.7 in
Diffstat (limited to 'indra/newview/llpreviewscript.cpp')
| -rwxr-xr-x | indra/newview/llpreviewscript.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index eac4a752d4..2e9907fcd2 100755 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -84,6 +84,7 @@ #include "lltrans.h" #include "llviewercontrol.h" #include "llappviewer.h" +#include "llfloatergotoline.h" const std::string HELLO_LSL = "default\n" @@ -191,12 +192,17 @@ private: LLScriptEdCore* mEditorCore; static LLFloaterScriptSearch* sInstance; + +protected: + LLLineEditor* mSearchBox; + void onSearchBoxCommit(); }; LLFloaterScriptSearch* LLFloaterScriptSearch::sInstance = NULL; LLFloaterScriptSearch::LLFloaterScriptSearch(LLScriptEdCore* editor_core) : LLFloater(LLSD()), + mSearchBox(NULL), mEditorCore(editor_core) { buildFromFile("floater_script_search.xml"); @@ -219,6 +225,9 @@ LLFloaterScriptSearch::LLFloaterScriptSearch(LLScriptEdCore* editor_core) BOOL LLFloaterScriptSearch::postBuild() { + mSearchBox = getChild<LLLineEditor>("search_text"); + mSearchBox->setCommitCallback(boost::bind(&LLFloaterScriptSearch::onSearchBoxCommit, this)); + mSearchBox->setCommitOnFocusLost(FALSE); childSetAction("search_btn", onBtnSearch,this); childSetAction("replace_btn", onBtnReplace,this); childSetAction("replace_all_btn", onBtnReplaceAll,this); @@ -313,6 +322,15 @@ BOOL LLFloaterScriptSearch::handleKeyHere(KEY key, MASK mask) return FALSE; } +void LLFloaterScriptSearch::onSearchBoxCommit() +{ + if (mEditorCore && mEditorCore->mEditor) + { + LLCheckBoxCtrl* caseChk = getChild<LLCheckBoxCtrl>("case_text"); + mEditorCore->mEditor->selectNext(getChild<LLUICtrl>("search_text")->getValue().asString(), caseChk->get()); + } +} + /// --------------------------------------------------------------------------- /// LLScriptEdCore /// --------------------------------------------------------------------------- @@ -474,6 +492,9 @@ void LLScriptEdCore::initMenu() menuItem = getChild<LLMenuItemCallGL>("Search / Replace..."); menuItem->setClickCallback(boost::bind(&LLFloaterScriptSearch::show, this)); + menuItem = getChild<LLMenuItemCallGL>("Go to line..."); + menuItem->setClickCallback(boost::bind(&LLFloaterGotoLine::show, this)); + menuItem = getChild<LLMenuItemCallGL>("Help..."); menuItem->setClickCallback(boost::bind(&LLScriptEdCore::onBtnHelp, this)); |
