DrawFixedWidthTip() public static method

public static DrawFixedWidthTip ( Control control, Graphics graphics, ICSharpCode.TextEditor.Util.TipSection tipData ) : Size
control System.Windows.Forms.Control
graphics System.Drawing.Graphics
tipData ICSharpCode.TextEditor.Util.TipSection
return System.Drawing.Size
Exemplo n.º 1
0
        public static Size DrawFixedWidthHelpTip(Control control, Graphics graphics, Font font, string countMessage, string basicDescription, string documentation)
        {
            if (IsVisibleText(countMessage) || IsVisibleText(basicDescription) || IsVisibleText(documentation))
            {
                // Create all the TipSection objects.
                CountTipText countMessageTip = new CountTipText(graphics, font, countMessage);

                TipSpacer countSpacer = new TipSpacer(graphics, new SizeF(IsVisibleText(countMessage) ? 4 : 0, 0));

                TipText descriptionTip = new TipText(graphics, font, basicDescription);

                TipSpacer docSpacer = new TipSpacer(graphics, new SizeF(0, IsVisibleText(documentation) ? 4 : 0));

                TipText docTip = new TipText(graphics, font, documentation);

                // Now put them together.
                TipSplitter descSplitter = new TipSplitter(graphics, false, descriptionTip, docSpacer);

                TipSplitter mainSplitter = new TipSplitter(graphics, true, countMessageTip, countSpacer, descSplitter);

                TipSplitter mainSplitter2 = new TipSplitter(graphics, false, mainSplitter, docTip);

                // Show it.
                Size size = TipPainter.DrawFixedWidthTip(control, graphics, mainSplitter2);
                DrawingRectangle1 = countMessageTip.DrawingRectangle1;
                DrawingRectangle2 = countMessageTip.DrawingRectangle2;
                return(size);
            }

            return(Size.Empty);
        }
Exemplo n.º 2
0
        public static Size DrawFixedWidthHelpTip(
            Control control,
            Graphics graphics, Font font,
            string countMessage,
            string basicDescription,
            string documentation)
        {
            if (!string.IsNullOrEmpty(countMessage) ||
                !string.IsNullOrEmpty(basicDescription) ||
                !string.IsNullOrEmpty(documentation))
            {
                // Create all the TipSection objects.
                var countMessageTip = new CountTipText(graphics, font, countMessage);

                var countSpacer = new TipSpacer(graphics, new SizeF(!string.IsNullOrEmpty(countMessage) ? 4 : 0, height: 0));

                var descriptionTip = new TipText(graphics, font, basicDescription);

                var docSpacer = new TipSpacer(graphics, new SizeF(width: 0, !string.IsNullOrEmpty(documentation) ? 4 : 0));

                var docTip = new TipText(graphics, font, documentation);

                // Now put them together.
                var descSplitter = new TipSplitter(
                    graphics, horizontal: false,
                    descriptionTip,
                    docSpacer
                    );

                var mainSplitter = new TipSplitter(
                    graphics, horizontal: true,
                    countMessageTip,
                    countSpacer,
                    descSplitter);

                var mainSplitter2 = new TipSplitter(
                    graphics, horizontal: false,
                    mainSplitter,
                    docTip);

                // Show it.
                var size = TipPainter.DrawFixedWidthTip(control, graphics, mainSplitter2);
                DrawingRectangle1 = countMessageTip.DrawingRectangle1;
                DrawingRectangle2 = countMessageTip.DrawingRectangle2;
                return(size);
            }

            return(Size.Empty);
        }
Exemplo n.º 3
0
        public static Size DrawFixedWidthHelpTip(Control control, Graphics graphics, Font font, string countMessage, string basicDescription, string documentation)
        {
            object obj;
            object obj1;

            if (!TipPainterTools.IsVisibleText(countMessage) && !TipPainterTools.IsVisibleText(basicDescription) && !TipPainterTools.IsVisibleText(documentation))
            {
                return(Size.Empty);
            }
            CountTipText countTipText = new CountTipText(graphics, font, countMessage);
            Graphics     graphic      = graphics;

            if (TipPainterTools.IsVisibleText(countMessage))
            {
                obj = 4;
            }
            else
            {
                obj = null;
            }
            TipSpacer tipSpacer = new TipSpacer(graphic, new SizeF((float)obj, 0f));
            TipText   tipText   = new TipText(graphics, font, basicDescription);
            Graphics  graphic1  = graphics;

            if (TipPainterTools.IsVisibleText(documentation))
            {
                obj1 = 4;
            }
            else
            {
                obj1 = null;
            }
            TipSpacer tipSpacer1 = new TipSpacer(graphic1, new SizeF(0f, (float)obj1));
            TipText   tipText1   = new TipText(graphics, font, documentation);

            TipSection[] tipSectionArray = new TipSection[] { tipText, tipSpacer1 };
            TipSplitter  tipSplitter     = new TipSplitter(graphics, false, tipSectionArray);

            TipSection[] tipSectionArray1 = new TipSection[] { countTipText, tipSpacer, tipSplitter };
            TipSplitter  tipSplitter1     = new TipSplitter(graphics, true, tipSectionArray1);

            TipSection[] tipSectionArray2 = new TipSection[] { tipSplitter1, tipText1 };
            TipSplitter  tipSplitter2     = new TipSplitter(graphics, false, tipSectionArray2);
            Size         size             = TipPainter.DrawFixedWidthTip(control, graphics, tipSplitter2);

            TipPainterTools.DrawingRectangle1 = countTipText.DrawingRectangle1;
            TipPainterTools.DrawingRectangle2 = countTipText.DrawingRectangle2;
            return(size);
        }