public ApplySuggestionOnSelectionAction(ScopeAwareRichTextBox txt, Suggestion sug)
            : base(txt, txt.ActiveScope)
        {
            selStart = txt.SelectionStart;
            selLength = txt.SelectionLength;

            Title = sug.Description;
            suggestion = sug;
        }
 public ScopeRenameAction(Scope scope, ScopeAwareRichTextBox text)
     : base(text, scope)
 {
     titlePrefix = "Rename";
     SetTitle();
     highlightFillColor = Color.Yellow;
     highlightFillOpacity = 80;
     highlightBorderColor = Color.Red;
     highlightBorderOpacity = 180;
     highlightBorderWidth = 2;
 }
 public SpecialSelectionMarker(Graphics g, Scope scopeToDraw, ScopeAwareRichTextBox txt)
     : base(g, scopeToDraw, txt)
 {
 }
        void sampleTextInput1_ActiveScopeChanged(object sender, ScopeAwareRichTextBox.ScopeEventArgs e)
        {
            if (e.Scope == null)
            {
                tipsScopeEditor.SetToolTip(txtRegexInput, string.Empty);
                tipsScopeEditor.ToolTipTitle = "No Active Scope";

                results.ShowRects(e.Scope, new List<Rectangle>());

                return;
            }
            tipsScopeEditor.Hide(txtRegexInput);

            if (e.Scope.Name != string.Empty)
            {
                tipsScopeEditor.ToolTipTitle = e.Scope.Name;
            }
            else
            {
                tipsScopeEditor.ToolTipTitle = "Unnamed Scope (right-click to rename)";
            }
            tipsScopeEditor.ReshowDelay = 500;
            tipsScopeEditor.UseAnimation = true;
            tipsScopeEditor.UseFading = false;
            tipsScopeEditor.InitialDelay = 500;

            string explanationText = String.Empty;
            tipsScopeEditor.ToolTipIcon = ToolTipIcon.Info;
            tipsScopeEditor.BackColor = Color.AliceBlue;
            tipsScopeEditor.ForeColor = Color.Black;

            if (e.Scope.IsImplicit)
            {
                explanationText =
                    "Automatic rule was used.\nRight-Click to select your own rule.";
            }
            else
            {
                tipsScopeEditor.ToolTipIcon = ToolTipIcon.Info;

                explanationText =
                    "Custom rule was used.\nRight-Click to select a different rule.";
            }
            if (e.Scope.Suggestions.Count > 0)
            {
                string desc = explanationText + "\n\nTry To Match:\n[" + TrimIfNeeded(e.Scope.Suggestions[0].Description) + "]";
                //                Text = removeNewLines(desc);
                tipsScopeEditor.SetToolTip(txtRegexInput, desc);
                //                tipsScopeEditor.Show(desc,txtRegexInput);
            }
            else
            {
                tipsScopeEditor.SetToolTip(txtRegexInput, explanationText + "\n\nTry To Match:\n[Exactly " + "\"" + TrimIfNeeded(e.Scope.Text) + "\"]");
            }

            Scope s = e.Scope;
            //            results.ShowRects(s, txtRegexInput.GetSurroundingRects(s.StartPosInRootScope, s.Length));
            results.HighlightScope(s);
            txtRegexInput.Focus();
        }
 public UIActionSuggestionProvider(ScopeAwareRichTextBox textBox)
 {
     txt = textBox;
 }
 public SmartContextMenu(Scope targetScope,ScopeAwareRichTextBox TextBox)
 {
     scope = targetScope;
     textBox = TextBox;
 }
 public DefineEncapsulatingScopeAction(ScopeAwareRichTextBox txt, Scope target)
     : base(txt,target)
 {
     root = target;
     Title = "Group these..";
 }