public VisualTipWindow()
 {
     Buffer = new Skybound.Windows.Forms.BufferedGraphics();
     SetStyle(System.Windows.Forms.ControlStyles.UserPaint | System.Windows.Forms.ControlStyles.AllPaintingInWmPaint | System.Windows.Forms.ControlStyles.DoubleBuffer, true);
     StartPosition                = System.Windows.Forms.FormStartPosition.Manual;
     FormBorderStyle              = System.Windows.Forms.FormBorderStyle.None;
     ShowInTaskbar                = false;
     Animator                     = new Skybound.Windows.Forms.Animator(Skybound.Windows.Forms.Motion.Decelerate, 200);
     Animator.NextFrame          += new System.EventHandler(Animator_NextFrame);
     Animator.SynchronizingObject = this;
 }
 public VisualTipEditor()
 {
     Buffer = new Skybound.Windows.Forms.BufferedGraphics();
 }
Esempio n. 3
0
 public VisualTipEditor()
 {
     Buffer = new Skybound.Windows.Forms.BufferedGraphics();
 }
 public VisualTipWindow()
 {
     Buffer = new Skybound.Windows.Forms.BufferedGraphics();
     SetStyle(System.Windows.Forms.ControlStyles.UserPaint | System.Windows.Forms.ControlStyles.AllPaintingInWmPaint | System.Windows.Forms.ControlStyles.DoubleBuffer, true);
     StartPosition = System.Windows.Forms.FormStartPosition.Manual;
     FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
     ShowInTaskbar = false;
     Animator = new Skybound.Windows.Forms.Animator(Skybound.Windows.Forms.Motion.Decelerate, 200);
     Animator.NextFrame += new System.EventHandler(Animator_NextFrame);
     Animator.SynchronizingObject = this;
 }
        protected virtual void OnDrawElement(System.Windows.Forms.PaintEventArgs e, Skybound.VisualTips.VisualTip tip, Skybound.VisualTips.Rendering.VisualTipLayout layout, Skybound.VisualTips.Rendering.VisualTipRenderElement element)
        {
            System.Drawing.Rectangle rectangle1 = layout.GetElementBounds(element);
            string s = "";
            System.Drawing.Image image = null;
            System.Drawing.Size size = rectangle1.Size;
            if (size.IsEmpty)
                return;
            switch (element)
            {
                case Skybound.VisualTips.Rendering.VisualTipRenderElement.DisabledMessage:
                    s = tip.DisabledMessage;
                    break;

                case Skybound.VisualTips.Rendering.VisualTipRenderElement.FooterText:
                    s = tip.FooterText;
                    break;

                case Skybound.VisualTips.Rendering.VisualTipRenderElement.Text:
                    s = GetBodyText(tip);
                    break;

                case Skybound.VisualTips.Rendering.VisualTipRenderElement.Title:
                    s = GetTitleText(tip);
                    break;

                case Skybound.VisualTips.Rendering.VisualTipRenderElement.TitleImage:
                    image = tip.TitleImage;
                    break;

                case Skybound.VisualTips.Rendering.VisualTipRenderElement.Image:
                    image = tip.Image;
                    break;

                case Skybound.VisualTips.Rendering.VisualTipRenderElement.FooterImage:
                    image = tip.FooterImage;
                    break;
            }
            if (s.Length > 0)
            {
                using (Skybound.Windows.Forms.BufferedGraphics bufferedGraphics = new Skybound.Windows.Forms.BufferedGraphics())
                {
                    bufferedGraphics.SetTarget(e.Graphics, rectangle1);
                    System.Drawing.Rectangle rectangle2 = new System.Drawing.Rectangle(0, 0, rectangle1.Width, rectangle1.Height);
                    layout.Offset(-rectangle1.X, -rectangle1.Y);
                    OnDrawWindow(new System.Windows.Forms.PaintEventArgs(bufferedGraphics.Graphics, rectangle2), tip, layout);
                    layout.Offset(rectangle1.X, rectangle1.Y);
                    Skybound.Windows.Forms.TextFormatFlags textFormatFlags = Skybound.Windows.Forms.TextFormatFlags.NoPrefix | Skybound.Windows.Forms.TextFormatFlags.WordBreak;
                    if (tip.RightToLeft == System.Windows.Forms.RightToLeft.Yes)
                        textFormatFlags = (Skybound.Windows.Forms.TextFormatFlags)(textFormatFlags | (Skybound.Windows.Forms.TextFormatFlags.Right | Skybound.Windows.Forms.TextFormatFlags.RightToLeft));
                    Skybound.Windows.Forms.TextRenderer.DrawText(bufferedGraphics.Graphics, s, GetElementFont(tip, element), GetElementTextColor(tip, element), System.Drawing.Color.Transparent, rectangle2, textFormatFlags);
                    bufferedGraphics.Render();
                    return;
                }
            }
            if (image != null)
                e.Graphics.DrawImage(image, rectangle1);
        }
Esempio n. 6
0
        protected virtual void OnDrawElement(System.Windows.Forms.PaintEventArgs e, Skybound.VisualTips.VisualTip tip, Skybound.VisualTips.Rendering.VisualTipLayout layout, Skybound.VisualTips.Rendering.VisualTipRenderElement element)
        {
            System.Drawing.Rectangle rectangle1 = layout.GetElementBounds(element);
            string s = "";

            System.Drawing.Image image = null;
            System.Drawing.Size  size  = rectangle1.Size;
            if (size.IsEmpty)
            {
                return;
            }
            switch (element)
            {
            case Skybound.VisualTips.Rendering.VisualTipRenderElement.DisabledMessage:
                s = tip.DisabledMessage;
                break;

            case Skybound.VisualTips.Rendering.VisualTipRenderElement.FooterText:
                s = tip.FooterText;
                break;

            case Skybound.VisualTips.Rendering.VisualTipRenderElement.Text:
                s = GetBodyText(tip);
                break;

            case Skybound.VisualTips.Rendering.VisualTipRenderElement.Title:
                s = GetTitleText(tip);
                break;

            case Skybound.VisualTips.Rendering.VisualTipRenderElement.TitleImage:
                image = tip.TitleImage;
                break;

            case Skybound.VisualTips.Rendering.VisualTipRenderElement.Image:
                image = tip.Image;
                break;

            case Skybound.VisualTips.Rendering.VisualTipRenderElement.FooterImage:
                image = tip.FooterImage;
                break;
            }
            if (s.Length > 0)
            {
                using (Skybound.Windows.Forms.BufferedGraphics bufferedGraphics = new Skybound.Windows.Forms.BufferedGraphics())
                {
                    bufferedGraphics.SetTarget(e.Graphics, rectangle1);
                    System.Drawing.Rectangle rectangle2 = new System.Drawing.Rectangle(0, 0, rectangle1.Width, rectangle1.Height);
                    layout.Offset(-rectangle1.X, -rectangle1.Y);
                    OnDrawWindow(new System.Windows.Forms.PaintEventArgs(bufferedGraphics.Graphics, rectangle2), tip, layout);
                    layout.Offset(rectangle1.X, rectangle1.Y);
                    Skybound.Windows.Forms.TextFormatFlags textFormatFlags = Skybound.Windows.Forms.TextFormatFlags.NoPrefix | Skybound.Windows.Forms.TextFormatFlags.WordBreak;
                    if (tip.RightToLeft == System.Windows.Forms.RightToLeft.Yes)
                    {
                        textFormatFlags = (Skybound.Windows.Forms.TextFormatFlags)(textFormatFlags | (Skybound.Windows.Forms.TextFormatFlags.Right | Skybound.Windows.Forms.TextFormatFlags.RightToLeft));
                    }
                    Skybound.Windows.Forms.TextRenderer.DrawText(bufferedGraphics.Graphics, s, GetElementFont(tip, element), GetElementTextColor(tip, element), System.Drawing.Color.Transparent, rectangle2, textFormatFlags);
                    bufferedGraphics.Render();
                    return;
                }
            }
            if (image != null)
            {
                e.Graphics.DrawImage(image, rectangle1);
            }
        }