コード例 #1
0
        protected override void OnPaint(PaintEventArgs pe)
        {
            htmlLabel.Text = description;

            SizeF sizeF = pe.Graphics.MeasureString(description, new Font("Microsoft Sans Serif", 10, FontStyle.Regular, GraphicsUnit.Pixel));


            //HtmlRenderer.Render(pe.Graphics, description, (RectangleF)pe.ClipRectangle, false);
            sizeF.Width -= 50;
            this.Size    = Size.Ceiling(sizeF);
            //Console.WriteLine(sizeF.Width);



            if (description != null && description.Length > 0)
            {
                if (fixedWidth)
                {
                    TipPainterTools.DrawFixedWidthHelpTipFromCombinedDescription(this, pe.Graphics, Font, null, description);
                }
                else
                {
                    TipPainterTools.DrawHelpTipFromCombinedDescription(this, pe.Graphics, Font, null, description);
                }
            }
        }
コード例 #2
0
        protected override void OnPaint(PaintEventArgs pe)
        {
            string countMessage = null;
            string description;

            if (this.DataProvider == null || this.DataProvider.InsightDataCount < 1)
            {
                description = "Unknown Method";
            }
            else
            {
                if (this.DataProvider.InsightDataCount > 1)
                {
                    countMessage = this.control.GetRangeDescription(this.CurrentData + 1, this.DataProvider.InsightDataCount);
                }
                description = this.DataProvider.GetInsightData(this.CurrentData);
            }
            this.drawingSize = TipPainterTools.GetDrawingSizeHelpTipFromCombinedDescription(this, pe.Graphics, this.Font, countMessage, description);
            if (this.drawingSize != base.Size)
            {
                this.SetLocation();
                return;
            }
            TipPainterTools.DrawHelpTipFromCombinedDescription(this, pe.Graphics, this.Font, countMessage, description);
        }
コード例 #3
0
ファイル: InsightWindow.cs プロジェクト: sizzles/ecsharp
        protected override void OnPaint(PaintEventArgs pe)
        {
            string methodCountMessage = null, description;

            if (DataProvider == null || DataProvider.InsightDataCount < 1)
            {
                description = "Unknown Method";
            }
            else
            {
                if (DataProvider.InsightDataCount > 1)
                {
                    methodCountMessage = control.GetRangeDescription(CurrentData + 1, DataProvider.InsightDataCount);
                }
                description = DataProvider.GetInsightData(CurrentData);
            }

            drawingSize = TipPainterTools.GetDrawingSizeHelpTipFromCombinedDescription(this,
                                                                                       pe.Graphics,
                                                                                       Font,
                                                                                       methodCountMessage,
                                                                                       description);
            if (drawingSize != Size)
            {
                SetLocation();
            }
            else
            {
                TipPainterTools.DrawHelpTipFromCombinedDescription(this, pe.Graphics, Font, methodCountMessage, description);
            }
        }
コード例 #4
0
 protected override void OnPaint(PaintEventArgs pe)
 {
     if (description != null && description.Length > 0)
     {
         TipPainterTools.DrawHelpTipFromCombinedDescription(this, pe.Graphics, Font, null, description);
     }
 }
コード例 #5
0
        protected override void OnPaint(PaintEventArgs pe)
        {
            string methodCountMessage = null, description;

            if (DataProvider == null || DataProvider.InsightDataCount < 1)
            {
                description = "Unknown Method";
            }
            else
            {
                if (DataProvider.InsightDataCount > 1)
                {
                    methodCountMessage = VisualPascalABC.Tools.GetRangeDescription(CurrentData + 1, DataProvider.InsightDataCount);
                }
                description = DataProvider.GetInsightData(CurrentData);
            }
            //pe.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit;
            int num_param = (DataProvider as VisualPascalABC.DefaultInsightDataProvider).num_param;

            drawingSize = TipPainterTools.GetDrawingSizeHelpTipFromCombinedDescription(this,
                                                                                       pe.Graphics,
                                                                                       Font,
                                                                                       methodCountMessage,
                                                                                       description, num_param, true);
            if (drawingSize != Size)
            {
                SetLocation();
            }
            else
            {
                TipPainterTools.DrawHelpTipFromCombinedDescription(this, pe.Graphics, Font, methodCountMessage, description, num_param, true);
            }
            lastCursorScreenPosition = control.ActiveTextAreaControl.TextArea.Caret.ScreenPosition;
        }
コード例 #6
0
 public int GetRequiredLeftHandSideWidth(Point p)
 {
     if (description != null && description.Length > 0)
     {
         using (Graphics g = CreateGraphics()) {
             Size s = TipPainterTools.GetLeftHandSideDrawingSizeHelpTipFromCombinedDescription(this, g, Font, null, description, p);
             return(s.Width);
         }
     }
     return(0);
 }
コード例 #7
0
 /// <summary>
 /// Gets the required width for the declaration window when should be shown on the left.
 /// </summary>
 /// <param name="p">The position of the declaration window.</param>
 /// <returns>The required width.</returns>
 public int GetRequiredLeftHandSideWidth(Point p)
 {
     if (!String.IsNullOrEmpty(_description))
     {
         using (Graphics g = CreateGraphics())
         {
             Size s = TipPainterTools.GetLeftHandSideDrawingSizeHelpTipFromCombinedDescription(this, g, Font, null, _description, p);
             return(s.Width);
         }
     }
     return(0);
 }
コード例 #8
0
 protected override void OnPaint(PaintEventArgs pe)
 {
     if (this.description != null && this.description.Length > 0)
     {
         if (this.fixedWidth)
         {
             TipPainterTools.DrawFixedWidthHelpTipFromCombinedDescription(this, pe.Graphics, this.Font, null, this.description);
             return;
         }
         TipPainterTools.DrawHelpTipFromCombinedDescription(this, pe.Graphics, this.Font, null, this.description);
     }
 }
コード例 #9
0
 protected override void OnPaint(PaintEventArgs pe)
 {
     if (!string.IsNullOrEmpty(description))
     {
         if (fixedWidth)
         {
             TipPainterTools.DrawFixedWidthHelpTipFromCombinedDescription(this, pe.Graphics, Font, null, description);
         }
         else
         {
             TipPainterTools.DrawHelpTipFromCombinedDescription(this, pe.Graphics, Font, null, description);
         }
     }
 }
コード例 #10
0
 protected override void OnPaint(PaintEventArgs pe)
 {
     TipPainterTools.DrawHelpTipFromCombinedDescription(this, pe.Graphics, this.Font, null, this.description);
 }
コード例 #11
0
        public int GetRequiredLeftHandSideWidth(Point p)
        {
            int width;

            if (this.description == null || this.description.Length <= 0)
            {
                return(0);
            }
            using (Graphics graphic = base.CreateGraphics())
            {
                System.Drawing.Size leftHandSideDrawingSizeHelpTipFromCombinedDescription = TipPainterTools.GetLeftHandSideDrawingSizeHelpTipFromCombinedDescription(this, graphic, this.Font, null, this.description, p);
                width = leftHandSideDrawingSizeHelpTipFromCombinedDescription.Width;
            }
            return(width);
        }