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 From f9bbf9e30a24bb873252cd5f0dfe7dadeb7b4b22 Mon Sep 17 00:00:00 2001 From: Cinder Date: Tue, 13 May 2014 10:16:03 -0600 Subject: STORM-2028 - Show context menu in script editor --- 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 86c915d6a0..d3e18021f9 100644 --- a/indra/newview/llscripteditor.h +++ b/indra/newview/llscripteditor.h @@ -32,7 +32,6 @@ class LLScriptEditor : public LLTextEditor { - friend class LLUICtrlFactory; public: struct Params : public LLInitParam::Block @@ -48,6 +47,7 @@ public: LLKeywords::keyword_iterator_t keywordsEnd() { return mKeywords.end(); } protected: + friend class LLUICtrlFactory; LLScriptEditor(const Params& p); private: -- cgit v1.2.3 From e776b600b1a76fcbe316041fc6fa8e885464daee Mon Sep 17 00:00:00 2001 From: Cinder Date: Wed, 14 May 2014 14:08:24 -0600 Subject: Refactor more script editor properties away from LLTextEditor to LLScriptEditor --- indra/newview/llscripteditor.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/newview/llscripteditor.h') diff --git a/indra/newview/llscripteditor.h b/indra/newview/llscripteditor.h index d3e18021f9..8c5ab362a3 100644 --- a/indra/newview/llscripteditor.h +++ b/indra/newview/llscripteditor.h @@ -36,10 +36,16 @@ public: struct Params : public LLInitParam::Block { + Optional show_line_numbers; + Params(); }; virtual ~LLScriptEditor() {}; + + // LLView override + virtual void draw(); + void initKeywords(); void loadKeywords(); void clearSegments(); @@ -51,11 +57,13 @@ protected: LLScriptEditor(const Params& p); private: + void drawLineNumbers(); void updateSegments(); void loadKeywords(const std::string& filename_keywords, const std::string& filename_colors); LLKeywords mKeywords; + bool mShowLineNumbers; }; #endif // LL_SCRIPTEDITOR_H -- cgit v1.2.3 From 8d2e0fb3a047e349b88db80afa09fc97a7f4ff74 Mon Sep 17 00:00:00 2001 From: Cinder Date: Fri, 20 Jun 2014 13:43:31 -0600 Subject: STORM-2035 - Invert the background color in script editors for highlighting sections. Since the background color can be changed by the user, this ensures distinctive highlighting --- indra/newview/llscripteditor.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llscripteditor.h') diff --git a/indra/newview/llscripteditor.h b/indra/newview/llscripteditor.h index 8c5ab362a3..f458203a39 100644 --- a/indra/newview/llscripteditor.h +++ b/indra/newview/llscripteditor.h @@ -48,7 +48,7 @@ public: void initKeywords(); void loadKeywords(); - void clearSegments(); + /* virtual */ void clearSegments(); LLKeywords::keyword_iterator_t keywordsBegin() { return mKeywords.begin(); } LLKeywords::keyword_iterator_t keywordsEnd() { return mKeywords.end(); } @@ -58,7 +58,8 @@ protected: private: void drawLineNumbers(); - void updateSegments(); + /* virtual */ void updateSegments(); + /* virtual */ void drawSelectionBackground(); void loadKeywords(const std::string& filename_keywords, const std::string& filename_colors); -- cgit v1.2.3