diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index ee16d3de7c33ff9e536f02767670cfdf8ad48c63..c4664d6fe0befd80ddf79f15e2700f4ec200c4ca 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -923,7 +923,6 @@ void LLTextBase::createDefaultSegment() // ensures that there is always at least one segment if (mSegments.empty()) { - LLStyleConstSP sp(new LLStyle(getStyleParams())); LLTextSegmentPtr default_segment = new LLNormalTextSegment( sp, 0, getLength() + 1, *this); mSegments.insert(default_segment); diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index df8d37e3aaded2f4c3f3e241ec21ca75178d7c5a..8120f3f9a1dcf21b7bb90a74b1426097f7211693 100755 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -2529,14 +2529,6 @@ void LLTextEditor::loadKeywords() } } -void LLTextEditor::clearSegments() -{ - if (!mSegments.empty()) - { - mSegments.clear(); - } -} - void LLTextEditor::updateSegments() { if (mReflowIndex < S32_MAX && mKeywords.isLoaded() && mParseOnTheFly) diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 698153587f2adeaacbe374f3943459d937884fa4..09c56fca5a83692c6f3e7170e165290ec2e583ea 100755 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -208,7 +208,6 @@ class LLTextEditor : const LLTextSegmentPtr getPreviousSegment() const; void getSelectedSegments(segment_vec_t& segments) const; - void clearSegments(); void setShowContextMenu(bool show) { mShowContextMenu = show; } bool getShowContextMenu() const { return mShowContextMenu; } diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 34eab9fa334cf25d8eb867e159e358926a69ea94..f4c1d0b151ce438cb190d4e5a6618800beb0d4c7 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -494,6 +494,7 @@ set(viewer_SOURCE_FILES llsaveoutfitcombobtn.cpp llsceneview.cpp llscreenchannel.cpp + llscripteditor.cpp llscriptfloater.cpp llscrollingpanelparam.cpp llscrollingpanelparambase.cpp @@ -1074,6 +1075,7 @@ set(viewer_HEADER_FILES llsaveoutfitcombobtn.h llsceneview.h llscreenchannel.h + llscripteditor.h llscriptfloater.h llscrollingpanelparam.h llscrollingpanelparambase.h diff --git a/indra/newview/llfloatergotoline.cpp b/indra/newview/llfloatergotoline.cpp index d66e418926caa5aaaa6db6eedc3ca83d0d0d11f9..3b34f035321cccc95c95cb6cb965f5067e61ae41 100644 --- a/indra/newview/llfloatergotoline.cpp +++ b/indra/newview/llfloatergotoline.cpp @@ -30,7 +30,7 @@ #include "llpreviewscript.h" #include "llfloaterreg.h" #include "lllineeditor.h" -#include "llviewertexteditor.h" +#include "llscripteditor.h" #include "llviewerwindow.h" LLFloaterGotoLine* LLFloaterGotoLine::sInstance = NULL; diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 84e7a1650dc9ac44c75690c656866929d063f1a7..0d95874406c263c93d5df787248fe6d1824cc224 100755 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -69,6 +69,7 @@ #include "llkeyboard.h" #include "llscrollcontainer.h" #include "llcheckboxctrl.h" +#include "llscripteditor.h" #include "llselectmgr.h" #include "lltooldraganddrop.h" #include "llscrolllistctrl.h" @@ -77,7 +78,6 @@ #include "lldir.h" #include "llcombobox.h" #include "llviewerstats.h" -#include "llviewertexteditor.h" #include "llviewerwindow.h" #include "lluictrlfactory.h" #include "llmediactrl.h" @@ -399,7 +399,7 @@ BOOL LLScriptEdCore::postBuild() childSetCommitCallback("Insert...", &LLScriptEdCore::onBtnInsertFunction, this); - mEditor = getChild<LLViewerTextEditor>("Script Editor"); + mEditor = getChild<LLScriptEditor>("Script Editor"); childSetCommitCallback("lsl errors", &LLScriptEdCore::onErrorList, this); childSetAction("Save_btn", boost::bind(&LLScriptEdCore::doSave,this,FALSE)); diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index dc4f828cf160b14a120a4d027cd610b5f738ba1f..913303d57d57690866151fd39423e1aa94d024ff 100755 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -39,7 +39,7 @@ class LLLiveLSLFile; class LLMessageSystem; -class LLTextEditor; +class LLScriptEditor; class LLButton; class LLCheckBoxCtrl; class LLScrollListCtrl; @@ -140,7 +140,7 @@ class LLScriptEdCore : public LLPanel private: std::string mSampleText; - LLTextEditor* mEditor; + LLScriptEditor* mEditor; void (*mLoadCallback)(void* userdata); void (*mSaveCallback)(void* userdata, BOOL close_after_save); void (*mSearchReplaceCallback) (void* userdata); diff --git a/indra/newview/llscripteditor.cpp b/indra/newview/llscripteditor.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7067f49fba1b70553ee283dd20dfc5b0af3d9f65 --- /dev/null +++ b/indra/newview/llscripteditor.cpp @@ -0,0 +1,51 @@ +/** + * @file llecripteditor.cpp + * @author Cinder Roxley + * @brief Text editor widget used for viewing and editing scripts + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "linden_common.h" +#include "llscripteditor.h" + +static LLDefaultChildRegistry::Register<LLScriptEditor> r("script_editor"); + +LLScriptEditor::LLScriptEditor::Params::Params() +{ + +} + + +LLScriptEditor::LLScriptEditor(const Params& p) +: LLTextEditor(p) +{ + +} + +void LLScriptEditor::clearSegments() +{ + if (!mSegments.empty()) + { + mSegments.clear(); + } +} diff --git a/indra/newview/llscripteditor.h b/indra/newview/llscripteditor.h new file mode 100644 index 0000000000000000000000000000000000000000..1e05e337c59a0d66ad118b89159f29cc41e98b47 --- /dev/null +++ b/indra/newview/llscripteditor.h @@ -0,0 +1,51 @@ +/** + * @file llecripteditor.h + * @author Cinder Roxley + * @brief Text editor widget used for viewing and editing scripts + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_SCRIPTEDITOR_H +#define LL_SCRIPTEDITOR_H + +#include "lltexteditor.h" + +class LLScriptEditor : public LLTextEditor +{ + friend class LLUICtrlFactory; +public: + + struct Params : public LLInitParam::Block<Params, LLTextEditor::Params> + { + Params(); + }; + + virtual ~LLScriptEditor() {}; + void clearSegments(); + +protected: + LLScriptEditor(const Params& p); + +}; + +#endif // LL_SCRIPTEDITOR_H diff --git a/indra/newview/skins/default/xui/en/panel_script_ed.xml b/indra/newview/skins/default/xui/en/panel_script_ed.xml index d1b35dce9dc72de3fdf6a2937ab7685b5d4e4d81..3e88e2dc04fe24b44c90052ba00c9dc37d3c4af8 100755 --- a/indra/newview/skins/default/xui/en/panel_script_ed.xml +++ b/indra/newview/skins/default/xui/en/panel_script_ed.xml @@ -148,7 +148,7 @@ name="Keyword Help..." /> </menu> </menu_bar> - <text_editor + <script_editor left="0" type="string" length="1" @@ -165,7 +165,7 @@ enable_tooltip_paste="true" word_wrap="true"> Loading... - </text_editor> + </script_editor> <scroll_list top_pad="10" left="0" diff --git a/indra/newview/skins/default/xui/en/script_editor.xml b/indra/newview/skins/default/xui/en/script_editor.xml new file mode 100644 index 0000000000000000000000000000000000000000..d24833e85c9c97bcd76e1e901d1d543bc2cc98a2 --- /dev/null +++ b/indra/newview/skins/default/xui/en/script_editor.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<script_editor + name="script_editor" + parse_urls="false"> +</script_editor>