From 8c39617c9ac469a8635d511142148ad5a38de836 Mon Sep 17 00:00:00 2001 From: Cinder Date: Fri, 18 Apr 2014 12:52:07 -0600 Subject: Begin moving script editor portions of LLTextEditor to their own derived class. This should fix the run off segment bugs by not overriding LLTextBase::clearSegments() in LLTextEditor TODO: Move the rest of the script stuff out of LLTextEditor for simplicity sake --- indra/newview/llscripteditor.h | 51 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 indra/newview/llscripteditor.h (limited to 'indra/newview/llscripteditor.h') diff --git a/indra/newview/llscripteditor.h b/indra/newview/llscripteditor.h new file mode 100644 index 0000000000..1e05e337c5 --- /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(); + }; + + virtual ~LLScriptEditor() {}; + void clearSegments(); + +protected: + LLScriptEditor(const Params& p); + +}; + +#endif // LL_SCRIPTEDITOR_H -- cgit v1.2.3 From 9ec900c3c440a8d1e25d55667c861d27a95b1297 Mon Sep 17 00:00:00 2001 From: Cinder Date: Fri, 18 Apr 2014 12:53:19 -0600 Subject: Trivial typo fix --- indra/newview/llscripteditor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llscripteditor.h') diff --git a/indra/newview/llscripteditor.h b/indra/newview/llscripteditor.h index 1e05e337c5..a0bee36a25 100644 --- a/indra/newview/llscripteditor.h +++ b/indra/newview/llscripteditor.h @@ -1,5 +1,5 @@ /** - * @file llecripteditor.h + * @file llscripteditor.h * @author Cinder Roxley * @brief Text editor widget used for viewing and editing scripts * -- cgit v1.2.3 From dcffb97518cb2888489c93b90862518f761967dd Mon Sep 17 00:00:00 2001 From: Cinder Date: Fri, 18 Apr 2014 23:13:57 -0600 Subject: Move some more script editor functions from LLTextEditor to LLScriptEditor --- indra/newview/llscripteditor.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'indra/newview/llscripteditor.h') diff --git a/indra/newview/llscripteditor.h b/indra/newview/llscripteditor.h index a0bee36a25..86c915d6a0 100644 --- a/indra/newview/llscripteditor.h +++ b/indra/newview/llscripteditor.h @@ -41,11 +41,21 @@ public: }; virtual ~LLScriptEditor() {}; - void clearSegments(); + void initKeywords(); + void loadKeywords(); + void clearSegments(); + LLKeywords::keyword_iterator_t keywordsBegin() { return mKeywords.begin(); } + LLKeywords::keyword_iterator_t keywordsEnd() { return mKeywords.end(); } protected: LLScriptEditor(const Params& p); - + +private: + void updateSegments(); + void loadKeywords(const std::string& filename_keywords, + const std::string& filename_colors); + + LLKeywords mKeywords; }; #endif // LL_SCRIPTEDITOR_H -- cgit v1.2.3