Exemplo n.º 1
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.º 2
0
        private void scriptedit_KeyUp(object sender, KeyEventArgs e)
        {
            bool showcalltip    = false;
            int  highlightstart = 0;
            int  highlightend   = 0;

            UpdatePositionInfo();

            // Call tip shown
            if (scriptedit.CallTipActive)
            {
                // Should we hide the call tip?
                if (curfunctionname.Length == 0)
                {
                    // Hide the call tip
                    scriptedit.CallTipCancel();
                }
                else
                {
                    // Update the call tip
                    showcalltip = true;
                }
            }
            // No call tip
            else
            {
                // Should we show a call tip?
                showcalltip = (curfunctionname.Length > 0) && !scriptedit.AutoCActive;
            }

            // Show or update call tip
            if (showcalltip)
            {
                string functiondef = scriptconfig.GetFunctionDefinition(curfunctionname);
                if (functiondef != null)
                {
                    // Determine the range to highlight
                    int argsopenpos  = functiondef.IndexOf(scriptconfig.FunctionOpen, StringComparison.Ordinal);
                    int argsclosepos = functiondef.LastIndexOf(scriptconfig.FunctionClose, StringComparison.Ordinal);
                    if ((argsopenpos > -1) && (argsclosepos > -1))
                    {
                        string   argsstr = functiondef.Substring(argsopenpos + 1, argsclosepos - argsopenpos - 1);
                        string[] args    = argsstr.Split(scriptconfig.ArgumentDelimiter[0]);
                        if ((curargumentindex >= 0) && (curargumentindex < args.Length))
                        {
                            int argoffset = 0;
                            for (int i = 0; i < curargumentindex; i++)
                            {
                                argoffset += args[i].Length + 1;
                            }
                            highlightstart = argsopenpos + argoffset + 1;
                            highlightend   = highlightstart + args[curargumentindex].Length;
                        }
                    }

                    // Determine callip position
                    int tippos   = curfunctionstartpos;
                    int funcline = scriptedit.LineFromPosition(curfunctionstartpos);

                    //mxd. If the tip obscures the view, move it down
                    if (scriptedit.CurrentLine > funcline)
                    {
                        int offset = curfunctionstartpos - scriptedit.Lines[funcline].Position;
                        tippos = scriptedit.Lines[scriptedit.CurrentLine].Position + offset;
                    }

                    //mxd. Take line wrapping into account
                    if (scriptedit.Lines[scriptedit.CurrentLine].WrapCount > 0)
                    {
                        int x         = scriptedit.PointXFromPosition(tippos);
                        int y         = scriptedit.PointYFromPosition(scriptedit.CurrentPosition);
                        int newtippos = scriptedit.CharPositionFromPointClose(x, y);
                        if (newtippos != -1)
                        {
                            tippos = newtippos;
                        }
                    }

                    // Show tip
                    scriptedit.CallTipShow(tippos, functiondef);
                    scriptedit.CallTipSetHlt(highlightstart, highlightend);
                }
            }
        }
Exemplo n.º 3
0
 private void OnDwellEnd(object sender, DwellEventArgs e)
 {
     textArea.CallTipCancel();
 }
Exemplo n.º 4
0
 private void ScintillaSrc_DwellEnd(object sender, ScintillaNET.DwellEventArgs e)
 {
     scintilla.CallTipCancel();
 }
 private void _textForm_DwellEnd(object sender, DwellEventArgs e)
 {
     _textForm.CallTipCancel();
 }