From 7183cecd14fbdc3cd31e1482248fabec7b23b1fb Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Tue, 5 Feb 2013 16:37:37 +0000 Subject: STORM-1831 merging in previous work --- indra/llui/lltexteditor.h | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'indra/llui/lltexteditor.h') diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 40821ae9fb..070c859e46 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -1,25 +1,25 @@ -/** +/** * @file lltexteditor.h * @brief LLTextEditor base class * * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, 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$ */ @@ -131,7 +131,7 @@ public: virtual BOOL canCopy() const; virtual void paste(); virtual BOOL canPaste() const; - + virtual void updatePrimary(); virtual void copyPrimary(); virtual void pastePrimary(); @@ -147,7 +147,7 @@ public: void selectNext(const std::string& search_text_in, BOOL case_insensitive, BOOL wrap = TRUE); BOOL replaceText(const std::string& search_text, const std::string& replace_text, BOOL case_insensitive, BOOL wrap = TRUE); void replaceTextAll(const std::string& search_text, const std::string& replace_text, BOOL case_insensitive); - + // Undo/redo stack void blockUndo(); @@ -179,6 +179,7 @@ public: void getCurrentLineAndColumn( S32* line, S32* col, BOOL include_wordwrap ); + LLKeywords mKeywords; void loadKeywords(const std::string& filename, const std::vector& funcs, const std::vector& tooltips, @@ -186,6 +187,9 @@ public: LLKeywords::keyword_iterator_t keywordsBegin() { return mKeywords.begin(); } LLKeywords::keyword_iterator_t keywordsEnd() { return mKeywords.end(); } + void loadKeywords(const std::string& filename_keywords, + const std::string& filename_colors); + // Hacky methods to make it into a word-wrapping, potentially scrolling, // read-only text box. void setCommitOnFocusLost(BOOL b) { mCommitOnFocusLost = b; } @@ -207,7 +211,7 @@ protected: void drawPreeditMarker(); void assignEmbedded(const std::string &s); - + void removeCharOrTab(); void indentSelectedLines( S32 spaces ); @@ -226,12 +230,12 @@ protected: S32 nextWordPos(S32 cursorPos) const; void autoIndent(); - + void findEmbeddedItemSegments(S32 start, S32 end); void getSegmentsInRange(segment_vec_t& segments, S32 start, S32 end, bool include_partial) const; virtual llwchar pasteEmbeddedItem(llwchar ext_char) { return ext_char; } - + // Here's the method that takes and applies text commands. S32 execute(TextCmd* cmd); @@ -245,7 +249,7 @@ protected: S32 removeChar(S32 pos); S32 insert(S32 pos, const LLWString &wstr, bool group_with_next_op, LLTextSegmentPtr segment); S32 remove(S32 pos, S32 length, bool group_with_next_op); - + void updateAllowingLanguageInput(); BOOL hasPreeditString() const; @@ -262,14 +266,14 @@ protected: // // Protected data // - // Probably deserves serious thought to hiding as many of these + // Probably deserves serious thought to hiding as many of these // as possible behind protected accessor methods. // // Use these to determine if a click on an embedded item is a drag or not. S32 mMouseDownX; S32 mMouseDownY; - + LLWString mPreeditWString; LLWString mPreeditOverwrittenWString; std::vector mPreeditPositions; @@ -293,11 +297,6 @@ private: void onKeyStroke(); - // - // Data - // - LLKeywords mKeywords; - // Concrete TextCmd sub-classes used by the LLTextEditor base class class TextCmdInsert; class TextCmdAddChar; -- cgit v1.2.3 From 7d5ed4f7477c2c564f0e9dededf7131ed42d55b8 Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Thu, 27 Jun 2013 21:28:52 +0100 Subject: Moving LSL highlighting colour info into .../skins/default/colors.xml where it makes more sense than its own xml file. Changing other functions to read it. --- indra/llui/lltexteditor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui/lltexteditor.h') diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index a6ed39eef8..2a0a0d524f 100755 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -190,7 +190,7 @@ public: void loadKeywords(const std::string& filename, const std::vector& funcs, const std::vector& tooltips, - const LLColor3& func_color); + const LLColor4& func_color); LLKeywords::keyword_iterator_t keywordsBegin() { return mKeywords.begin(); } LLKeywords::keyword_iterator_t keywordsEnd() { return mKeywords.end(); } -- cgit v1.2.3 From dc317ed70ac8b8344a745b4f43116460efdfdbca Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Sun, 10 Nov 2013 21:58:17 +0000 Subject: Refactoring load routines to remove uneeded methods --- indra/llui/lltexteditor.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'indra/llui/lltexteditor.h') diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 8cc0e03712..0b4a22b08b 100755 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -187,10 +187,7 @@ public: void getCurrentLineAndColumn( S32* line, S32* col, BOOL include_wordwrap ); LLKeywords mKeywords; - void loadKeywords(const std::string& filename, - const std::vector& funcs, - const std::vector& tooltips, - const LLColor4& func_color); + void loadKeywords(); LLKeywords::keyword_iterator_t keywordsBegin() { return mKeywords.begin(); } LLKeywords::keyword_iterator_t keywordsEnd() { return mKeywords.end(); } -- cgit v1.2.3 From 00a99d9097131c02c6486112b32e57f534bf61be Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Thu, 6 Feb 2014 16:47:27 +0000 Subject: Adding clear methods to remove any highlighting. --- indra/llui/lltexteditor.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llui/lltexteditor.h') diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index d7f6c7f643..698153587f 100755 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -207,7 +207,8 @@ public: const LLUUID& getSourceID() const { return mSourceID; } const LLTextSegmentPtr getPreviousSegment() const; - void getSelectedSegments(segment_vec_t& segments) const; + void getSelectedSegments(segment_vec_t& segments) const; + void clearSegments(); void setShowContextMenu(bool show) { mShowContextMenu = show; } bool getShowContextMenu() const { return mShowContextMenu; } -- cgit v1.2.3 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/llui/lltexteditor.h | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llui/lltexteditor.h') diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 698153587f..09c56fca5a 100755 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -208,7 +208,6 @@ public: const LLTextSegmentPtr getPreviousSegment() const; void getSelectedSegments(segment_vec_t& segments) const; - void clearSegments(); void setShowContextMenu(bool show) { mShowContextMenu = show; } bool getShowContextMenu() const { return mShowContextMenu; } -- 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/llui/lltexteditor.h | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'indra/llui/lltexteditor.h') diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 09c56fca5a..6c14ad90a5 100755 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -30,7 +30,6 @@ #define LL_LLTEXTEDITOR_H #include "llrect.h" -#include "llkeywords.h" #include "llframetimer.h" #include "lldarray.h" #include "llstyle.h" @@ -45,7 +44,6 @@ class LLFontGL; class LLScrollbar; -class LLKeywordToken; class TextCmd; class LLUICtrlFactory; class LLScrollContainer; @@ -188,14 +186,6 @@ public: void getCurrentLineAndColumn( S32* line, S32* col, BOOL include_wordwrap ); - LLKeywords mKeywords; - void loadKeywords(); - LLKeywords::keyword_iterator_t keywordsBegin() { return mKeywords.begin(); } - LLKeywords::keyword_iterator_t keywordsEnd() { return mKeywords.end(); } - - void loadKeywords(const std::string& filename_keywords, - const std::string& filename_colors); - // Hacky methods to make it into a word-wrapping, potentially scrolling, // read-only text box. void setCommitOnFocusLost(BOOL b) { mCommitOnFocusLost = b; } @@ -293,8 +283,8 @@ protected: BOOL mShowLineNumbers; bool mAutoIndent; + bool mParseOnTheFly; - /*virtual*/ void updateSegments(); void updateLinkSegments(); private: @@ -331,7 +321,6 @@ private: BOOL mAllowEmbeddedItems; bool mShowContextMenu; - bool mParseOnTheFly; bool mEnableTooltipPaste; bool mPassDelete; @@ -351,4 +340,4 @@ extern template class LLTextEditor* LLView::getChild( const std::string& name, BOOL recurse) const; #endif -#endif // LL_TEXTEDITOR_ +#endif // LL_TEXTEDITOR_H -- 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/llui/lltexteditor.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'indra/llui/lltexteditor.h') diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 404275026c..2408613824 100755 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -58,7 +58,6 @@ public: Optional embedded_items, ignore_tab, - show_line_numbers, commit_on_focus_lost, show_context_menu, enable_tooltip_paste, @@ -279,11 +278,11 @@ protected: protected: LLUIColor mDefaultColor; - BOOL mShowLineNumbers; bool mAutoIndent; bool mParseOnTheFly; void updateLinkSegments(); + class LLViewBorder* mBorder; private: // @@ -293,8 +292,6 @@ private: void cleanStringForPaste(LLWString & clean_string); void pasteTextWithLinebreaks(LLWString & clean_string); - void drawLineNumbers(); - void onKeyStroke(); // Concrete TextCmd sub-classes used by the LLTextEditor base class @@ -303,8 +300,6 @@ private: class TextCmdOverwriteChar; class TextCmdRemove; - class LLViewBorder* mBorder; - BOOL mBaseDocIsPristine; TextCmd* mPristineCmd; -- cgit v1.2.3