Esempio n. 1
0
        public DynamicTreeDebuggerRow(Process process, AbstractNode content)
        {
            this.process = process;

            DebuggerGridControl.AddColumns(this.ChildColumns);

            this[1].Paint           += OnIconPaint;
            this[3].FinishLabelEdit += OnLabelEdited;
            this[3].MouseDown       += OnMouseDown;

            this.Expanded  += delegate { isExpanded = true; };
            this.Collapsed += delegate { isExpanded = false; };
            this.Shown     += delegate { isShown = true; };
            this.Hidden    += delegate { isShown = false; };

            SetContentRecursive(content);
        }
Esempio n. 2
0
 void CloseOldToolTip()
 {
     if (oldToolTipControl != null)
     {
         Form frm = oldToolTipControl.FindForm();
         if (frm != null) frm.Close();
         oldToolTipControl = null;
     }
     	
 }
Esempio n. 3
0
        public void TextAreaToolTipRequest(object sender, ToolTipRequestEventArgs e)
        {
            DebuggerGridControl toolTipControl = null;
            TextMarker marker = null;
            //RemoveMarker((sender as TextArea).Document);
            if (debuggedProcess == null) return;
            if (debuggedProcess.SelectedFunction == null || !debuggedProcess.IsPaused) return;
            try
            {
                TextArea textArea = (TextArea)sender;
                
                if (textArea != curTextArea) return;
                if (e.ToolTipShown) return;
                if (oldToolTipControl != null && !oldToolTipControl.AllowClose) return;
                if (!IsRunning) return;

                if (e.InDocument)
                {
                    ToolTipInfo ti = null;
                    int num_line = 0;
                    int start_off = 0;
                    int end_off = 0;
                    string var = GetVariable(e,textArea,out num_line, out start_off, out end_off);
                    if (var == null || var == "") return;
                    //if (debuggedProcess.SelectedFunction.LocalVariables.Count > 0)
                    {
                        //NamedValue nv = FindVarByName(var, num_line);
                        ListItem nv = FindVarByName(var, num_line);
                        if (nv != null)
                        {
                        	System.Threading.Thread.Sleep(50);
                        	DebuggerGridControl dgc = new DebuggerGridControl(new DynamicTreeDebuggerRow(nv));
                        	dgc.doc = textArea.Document;
                        	ti = new ToolTipInfo(dgc);
                        	ICSharpCode.TextEditor.TextLocation logicPos = e.LogicalPosition;
            				LineSegment seg = textArea.Document.GetLineSegment(logicPos.Y);
            				marker = new TextMarker(start_off, end_off-start_off+1, TextMarkerType.Cant, Color.Black, Color.White);
                        	textArea.Document.MarkerStrategy.AddMarker(marker);
                        	textArea.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine,seg.LineNumber));
                        	textArea.Document.CommitUpdate();
                        }
                    }
                    if (ti != null)
                    {
                        toolTipControl = ti.ToolTipControl as DebuggerGridControl;
                        if (ti.ToolTipText != null)
                        {
                            e.ShowToolTip(ti.ToolTipText);
                        }
                    }
                    CloseOldToolTip();
                    if (toolTipControl != null)
                    {
                        toolTipControl.ShowForm(textArea, e.LogicalPosition);
                    }
                    oldToolTipControl = toolTipControl;
                    RemoveMarker(textArea.Document);
                    oldMarker = marker;

                }
            }
            catch (System.Exception ex)
            {
                //frm.WriteToOutputBox(ex.Message);// ICSharpCode.Core.MessageService.ShowError(ex);
            }
            finally
            {
                if (toolTipControl == null && CanCloseOldToolTip)
                {
                    CloseOldToolTip();
                    RemoveMarker((sender as TextArea).Document);
                }
            }
        }