Пример #1
0
        public static Size GetDrawingSizeDrawHelpTip(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.GetTipSize(control, graphics, mainSplitter2);
                DrawingRectangle1 = countMessageTip.DrawingRectangle1;
                DrawingRectangle2 = countMessageTip.DrawingRectangle2;
                return(size);
            }
            return(Size.Empty);
        }
Пример #2
0
		public static Size GetDrawingSizeDrawHelpTip(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.GetTipSize(control, graphics, mainSplitter2);
				DrawingRectangle1 = countMessageTip.DrawingRectangle1;
				DrawingRectangle2 = countMessageTip.DrawingRectangle2;
				return size;
			}
			return Size.Empty;
		}