Ejemplo n.º 1
0
        private void scintilla1_DwellStart(object sender, ScintillaMouseEventArgs e)
        {
            if (scintilla1.CallTip.IsActive)
            {
                return;
            }

            string word        = scintilla1.GetWordFromPosition(e.Position);
            string callTipText = "";

            if (EmuKeywords.Contains(word))
            {
                foreach (EQ2EmuKeywords k in keywords)
                {
                    if (k.Name == word)
                    {
                        // Set the return type and name
                        callTipText = k.ReturnType + " " + k.Name + "(";

                        // loop through the parameters this function has
                        bool i_suck_with_names = false;
                        foreach (Parameter p in k.Parameters)
                        {
                            // if not the first loop add a comma and space
                            if (i_suck_with_names)
                            {
                                callTipText += ", ";
                            }

                            // if the parameter is optional add the [
                            if (p.Optional)
                            {
                                callTipText += "[";
                            }

                            // Add the parameter type and name
                            callTipText += p.Type + " " + p.Name;

                            // if optional add the closing ]
                            if (p.Optional)
                            {
                                callTipText += "]";
                            }

                            // set the flag to true so any other parameters have a comma
                            i_suck_with_names = true;
                        }

                        // Add the closing ) and a line break followed by the function description
                        callTipText += ")\n" + k.Description;
                        break;
                    }
                }
            }

            if (callTipText != "")
            {
                scintilla1.CallTip.Show(callTipText, e.Position);
            }
        }
Ejemplo n.º 2
0
        void DwellStart(object sender, ScintillaMouseEventArgs e)
        {
            if (view.Data == null || hoverPos != null)
            {
                return;
            }

            int txtPos = view.PositionFromPointClose(e.X, e.Y);

            CodeViewData.TextRef?textRef;
            if (txtPos != -1 && (textRef = view.ResolveReference(ref txtPos)) != null && textRef.Value.Reference is IFullName)
            {
                var line = view.Lines.FromPosition(txtPos);

                var text = DisplayNameCreator.CreateFullName((IFullName)textRef.Value.Reference);
                text = Utils.EscapeString(text, false);

                var pt = PointToClient(Cursor.Position);
                pt.X += 16;
                pt.Y += 10;

                toolTip.Show(text, this, pt);
                hoverPos = txtPos;

                view.Capture = true;
            }
        }
Ejemplo n.º 3
0
        protected override void OnDwellStart(ScintillaMouseEventArgs mea)
        {
            base.OnDwellStart(mea);

            int pos = mea.Position;

            List <CodeRuleError> errors = (from e in m_ruleErrors
                                           where pos >= e.range.Start &&
                                           pos < e.range.End
                                           select e).ToList();

            if (errors.Count > 0)
            {
                string message = "";
                bool   first   = true;

                foreach (CodeRuleError error in errors)
                {
                    if (!first)
                    {
                        message += "\r\n";
                    }

                    first    = false;
                    message += error.text;
                }

                CallTip.Show(message, pos);
            }
        }
Ejemplo n.º 4
0
        private void sciEditor_DwellStart(object sender, ScintillaMouseEventArgs e)
        {
            if (IsMouseOnMarker(e.X, e.Y))
            {
                markerTip.Show(lastErrorMessage, sciEditor, e.X - 20, e.Y - 80);
            }
            else if (sciEditor.NativeInterface.IndicatorValueAt(0, e.Position) != 0)
            {
                sciEditor.CallTip.Show(lastErrorMessage, e.Position);
            }
            else
            {
                if (InCommentOrString(e.Position))
                {
                    return;
                }

                string word = sciEditor.GetWordFromPosition(e.Position);
                if (!CallTipProvider.IsDefined(word))
                {
                    return;
                }

                callTipInfo = CallTipProvider.GetCallTipInfo(word);
                sciEditor.CallTip.Show(callTipInfo.Text, e.Position);
            }
        }
Ejemplo n.º 5
0
        protected override void OnDwellEnd(ScintillaMouseEventArgs e)
        {
            base.OnDwellEnd(e);

            if (CallTip.IsActive)
            {
                CallTip.Cancel();
            }
        }
Ejemplo n.º 6
0
 private void scintilla1_DwellEnd(object sender, ScintillaMouseEventArgs e)
 {
     // Hide the call tip
     scintilla1.CallTip.Hide();
 }
Ejemplo n.º 7
0
 private void sciEditor_DwellEnd(object sender, ScintillaMouseEventArgs e)
 {
     markerTip.Hide(sciEditor);
     sciEditor.CallTip.Hide();
     callTipInfo = null;
 }