Exemplo n.º 1
0
        private void ExScintilla_DwellEnd(object sender, DwellEventArgs e)
        {
            // Todo:
            //if (e.Position > 0)
            //{
            //    Line line = this.Lines[this.LineFromPosition(e.Position)];
            //    int sp = e.Position - line.Position;
            //    while (sp > 0)
            //    {
            //        if (line.Text[sp] == '.' || line.Text[sp] == '_' || char.IsLetterOrDigit(line.Text[sp]))
            //            sp--;
            //        else break;
            //    }

            //    int ep = e.Position - line.Position;
            //    while (ep < line.Text.Length)
            //    {
            //        if (line.Text[ep] == '.' || line.Text[ep] == '_' || char.IsLetterOrDigit(line.Text[ep]))
            //            ep++;
            //        else break;
            //    }
            //    if (ep > sp)
            //    {
            //        string w = line.Text.Substring(sp, ep - sp);
            //        Console.WriteLine(w);


            //    }
            //}
        }
Exemplo n.º 2
0
        private void MouseDwell(object sender, DwellEventArgs e)
        {
            var doc = App.Document() as CodeDocument;

            if (doc == null)
            {
                return;
            }

            var sci      = App.Editor().Control as ScintillaControl;
            var messages = doc.Messages;

            if (sci == null)
            {
                return;
            }

            var i = sci.GetIndicatorValue(sci.Indicators.Error, e.Position);

            if (i == 0)
            {
                i = sci.GetIndicatorValue(sci.Indicators.Warning, e.Position);
            }

            if (i > 0 && messages.Count() > i - 1)
            {
                sci.ShowCallTip(e.Position, messages.ElementAt(i - 1).Message);
            }
        }
Exemplo n.º 3
0
        /// -------------------------------------------------------------------------------------------------
        /// <summary> Event handler. Called by Codewindow for dwell end events. </summary>
        ///
        /// <remarks> 10/09/2018. </remarks>
        ///
        /// <param name="sender"> Source of the event. </param>
        /// <param name="e">	  Dwell event information. </param>
        /// -------------------------------------------------------------------------------------------------
        private void Codewindow_DwellEnd(object sender, DwellEventArgs e)
        {
            Scintilla s = (Scintilla)sender;

            if (s.CallTipActive)
            {
                s.CallTipCancel();
            }
        }
Exemplo n.º 4
0
        private void OnMouseDwell(DwellEventArgs e)
        {
            var h = MouseDwell;

            if (h != null)
            {
                h(this, e);
            }
        }
Exemplo n.º 5
0
        private void m_rScintilla_TextArea_DwellStart(object sender, DwellEventArgs e)
        {
            var url = GetUrlAtPosition(e.Position);

            if (url != null)
            {
                var callTip = string.Format("{0}\nCTRL + click to follow link", url);
                m_rScintilla_TextArea.CallTipShow(e.Position, callTip);
            }
        }
Exemplo n.º 6
0
 private void _textForm_DwellStart(object sender, DwellEventArgs e)
 {
     if (!String.IsNullOrEmpty(_lastWord))
     {
         _textForm.CallTipShow(_textForm.CurrentPosition, _lastWord);
     }
     else
     {
         _textForm.CallTipCancel();
     }
 }
Exemplo n.º 7
0
        private void DwellStart(object sender, DwellEventArgs e)
        {
            int    startPos = ValueStartPosition(e.Position);
            int    endPos   = ValueEndPosition(e.Position);
            string text     = scintilla1.GetTextRange(startPos, endPos - startPos);

            if (text.StartsWith("http://") || text.StartsWith("https://"))
            {
                ToolTip toolTip = new ToolTip();
                toolTip.SetToolTip(scintilla1, "STRG+Click to open");
            }
        }
Exemplo n.º 8
0
        /// -------------------------------------------------------------------------------------------------
        /// <summary> Event handler. Called by Codewindow for dwell events. </summary>
        ///
        /// <remarks> 10/09/2018. </remarks>
        ///
        /// <param name="sender"> Source of the event. </param>
        /// <param name="e">	  Dwell event information. </param>
        /// -------------------------------------------------------------------------------------------------
        private void Codewindow_Dwell(object sender, DwellEventArgs e)
        {
            Scintilla s = (Scintilla)sender;

            if (s.CallTipActive)
            {
                return;
            }

            TraceFile tf = TraceFile.FindTraceFile((string)s.Tag);

            if (tf != null)
            {
                //tf.codefile.codewindow.sh
                string word = s.GetWordFromPosition(e.Position);

                DoHoverTip(s, e.Position, word);
            }
        }
Exemplo n.º 9
0
        //Hover tips
        private void editor_DwellStart(object sender, DwellEventArgs e)
        {
            if (!editor.WordChars.Contains("-"))
            {
                editor.WordChars += "?-+=></*.";
            }

            var pos       = e.Position;
            var wordStart = editor.WordStartPosition(pos, false);
            var wordEnd   = editor.WordEndPosition(pos, false);
            var word      = editor.GetTextRange(wordStart, wordEnd - wordStart).Trim().TrimStart('(');

            string tip = "";

            if (!string.IsNullOrEmpty(word) && !string.IsNullOrEmpty(tip = Helptips.GetFor(word)))
            {
                editor.CallTipShow(e.Position, tip);
            }
        }
Exemplo n.º 10
0
        private void OnDwellStart(object sender, DwellEventArgs e)
        {
            int currentPos = e.Position;

            if (currentPos < 0)
            {
                return;
            }
            int    wordStartPos = textArea.WordStartPosition(currentPos, true);
            string currentWord  = textArea.GetWordFromPosition(wordStartPos);
            string lastWord     = "";

            if (textArea.GetCharAt(wordStartPos - 1) == '.')
            {
                lastWord = textArea.GetWordFromPosition(textArea.WordStartPosition(wordStartPos - 2, true));
            }
            if (currentPos > wordStartPos)
            {
                lastObject = textArea.GetWordFromPosition(wordStartPos);
            }
            if (currentWord != "" && sbObjects.GetVariables(currentWord) != "")
            {
                if (null != sbDocument.debug && sbDocument.debug.IsPaused())
                {
                    toolTipPosition = currentPos;
                    sbDocument.debug.GetHover(currentWord);
                }
            }
            if (currentWord != "" && sbObjects.GetObjects(currentWord) != "")
            {
                showObjectData(currentWord, e.Position);
            }
            else if (lastWord != "" && currentWord != "" && sbObjects.GetMembers(lastWord, currentWord) != "")
            {
                showMethodData(lastWord, currentWord, e.Position);
            }
            else if (currentWord != "" && sbObjects.GetKeywords(currentWord) != "")
            {
                showObjectData(currentWord, e.Position);
            }
        }
Exemplo n.º 11
0
 private void OnDwellEnd(object sender, DwellEventArgs e)
 {
     textArea.CallTipCancel();
 }
Exemplo n.º 12
0
 private void m_rScintilla_TextArea_DwellEnd(object sender, DwellEventArgs e)
 {
     m_rScintilla_TextArea.CallTipCancel();
 }
 private void _textForm_DwellEnd(object sender, DwellEventArgs e)
 {
     _textForm.CallTipCancel();
 }
Exemplo n.º 14
0
 private void editor_DwellEnd(object sender, DwellEventArgs e)
 {
     editor.CallTipCancel();
 }
Exemplo n.º 15
0
 private void MouseDwell(object sender, DwellEventArgs e)
 {
     CallTipRequested(e.X, e.Y, e.Position);
 }