Esempio n. 1
0
        public void UpdateHitState(GroupObjectInfoArgs info, Point pt)
        {
            info.ButtonState = ObjectState.Normal;

            info.StateIndex = 1;
            Cursor          = Cursors.Default;
            if (info.CaptionBounds.Contains(pt) && IsCaptionClickable)
            {
                info.StateIndex = 0;
                Cursor          = CaptionCursor;
            }
            if (lastStateIndex != info.StateIndex)
            {
                Invalidate(info.CaptionBounds);
            }
            lastStateIndex = info.StateIndex;

            if (info.ButtonBounds.Contains(pt))
            {
                info.ButtonState = ObjectState.Hot;
            }
            else
            {
                buttonPressed = null;
            }
            if (info.ButtonState == ObjectState.Hot && buttonPressed != null)
            {
                if ((MouseButtons)buttonPressed == MouseButtons.Left)
                {
                    info.ButtonState = ObjectState.Pressed;
                }
            }
        }
        protected override Rectangle GetBorderBounds(GroupObjectInfoArgs info)
        {
            Rectangle result = info.Bounds;

            if (info.CaptionBounds.IsEmpty)
            {
                return(result);
            }
            if (this.IsVerticalCaption(info))
            {
                int width = info.CaptionBounds.Width / 2;
                if (this.GetCaptionLocation(info) == Locations.Left)
                {
                    result.X += width;
                }
                result.Width -= width;
            }
            else
            {
                int height = info.CaptionBounds.Height / 2;
                if (this.GetCaptionLocation(info) == Locations.Top)
                {
                    result.Y += height;
                }
                result.Height -= height;
            }
            return(result);
        }
        protected override ObjectPainter GetBorderPainter(ObjectInfoArgs e)
        {
            GroupObjectInfoArgs args = (GroupObjectInfoArgs)e;

            if (args.BorderStyle == BorderStyles.NoBorder && !args.ShowCaption)
            {
                return(new SkinGroupEmptyBorderPainter(this.Provider));
            }
            return(new SimpleGroupBorderPainter(this, this.Provider));
        }
Esempio n. 4
0
        // Latest code from Stan @ DX.
        //protected override void DrawCaption(GroupObjectInfoArgs info)
        //{
        //   if (info.CaptionBounds.IsEmpty) return;
        //   info.Cache.FillRectangle(info.Cache.GetSolidBrush(Color.Aqua), info.CaptionBounds);
        //   info.Cache.DrawRectangle(info.Cache.GetPen(Color.Red), info.CaptionBounds);
        //   DrawButton(info);
        //   DrawVString(info.Cache, info.AppearanceCaption, info.Caption, info.TextBounds, GetRotateAngle(info));
        //}

        protected override void DrawCaption(GroupObjectInfoArgs info)
        {
            if (info.CaptionBounds.IsEmpty)
            {
                return;
            }
            info.Cache.FillRectangle(info.Cache.GetSolidBrush(info.Appearance.BackColor), info.CaptionBounds);
            DrawButton(info);
            DrawVString(info.Cache, info.AppearanceCaption, info.Caption, info.TextBounds, GetRotateAngle(info));
        }
 protected override void DrawBorder(GroupObjectInfoArgs info)
 {
     if (Owner.BorderStyle == BorderStyles.NoBorder)
     {
         Rectangle border = GetBorderBounds(info);
         _fBorderPainter.DrawObject(new BorderObjectInfoArgs(info.Cache, info.Appearance, border));
     }
     else
     {
         base.DrawBorder(info);
     }
 }
Esempio n. 6
0
        protected override void CalcCaptionElementsNormal(GroupObjectInfoArgs info, Rectangle caption)
        {
            int left, top, right, bottom;

            CalcContentMargins(info, out left, out top, out right, out bottom);
            base.CalcCaptionElementsNormal(info, caption);
            Rectangle rect       = info.TextBounds;
            int       textOffset = (caption.Height - (top + info.TextBounds.Height + bottom)) / 2;

            rect.Y         -= textOffset;
            rect.Size       = CalcCaptionTextSize(info);
            info.TextBounds = rect;
        }
Esempio n. 7
0
        protected override Size CalcCaptionTextSize(GroupObjectInfoArgs info)
        {
            int left, top, right, bottom;

            CalcContentMargins(info, out left, out top, out right, out bottom);
            int  width  = info.Bounds.Width - left - right;
            int  height = info.Bounds.Height - top - bottom;
            Size size   = info.AppearanceCaption.CalcTextSize(info.Cache,
                                                              info.AppearanceCaption.GetStringFormat(GetTextOptions()), info.Caption,
                                                              IsVerticalCaption(info) ? height : width).ToSize();

            return(size);
        }
        protected override Color GetActualCaptionTextBackColor(GroupObjectInfoArgs info)
        {
            Color result = base.GetActualCaptionTextBackColor(info);

            return(result.IsEmpty ? info.Appearance.BackColor : result);
        }
 protected override void DrawCaptionText(GroupObjectInfoArgs info)
 {
     base.DrawCaptionText(info);
 }
 protected override void DrawCaptionSkinElement(GroupObjectInfoArgs info)
 {
 }
Esempio n. 11
0
 protected override void CalcCaptionNew(GroupObjectInfoArgs info)
 {
     info.CaptionBounds = info.Bounds;
     CalcCaptionElements(info, info.Bounds);
 }
Esempio n. 12
0
 protected override int CalcCaptionContentHeight(GroupObjectInfoArgs info)
 {
     return(info.Bounds.Height);
 }
Esempio n. 13
0
        protected Rectangle CalcGroupCaptionButtonBounds(GroupObjectInfoArgs info)
        {
            Rectangle result        = Rectangle.Empty;
            Rectangle captionClient = info.CaptionBounds;

            if (Painter is SkinGroupObjectPainter)
            {
                SkinElementInfo buttonInfo = new SkinElementInfo(Skin[CommonSkins.SkinGroupPanelExpandButton]);
                Size            buttonSize =
                    ObjectPainter.CalcObjectMinBounds(info.Graphics, SkinElementPainter.Default, buttonInfo).Size;
                if (buttonSize.IsEmpty)
                {
                    return(Rectangle.Empty);
                }
                if (!IsCaptionHorizontal)
                {
                    int saveWidth = captionClient.Width;
                    captionClient.Width  = captionClient.Height;
                    captionClient.Height = saveWidth;
                    saveWidth            = captionClient.X;
                    captionClient.X      = captionClient.Y;
                    captionClient.Y      = saveWidth;
                }
                captionClient.Width -= 4;
                result = Skin[CommonSkins.SkinGroupPanelExpandButton].Offset.GetBounds(captionClient, buttonSize, SkinOffsetKind.Far);
                if (!IsCaptionHorizontal)
                {
                    int saveX = result.X;
                    if (CaptionLocation == Locations.Left)
                    {
                        result.X = result.Y;
                        result.Y = captionClient.Width - saveX;
                    }
                    else
                    {
                        result.X = captionClient.Y;
                        result.Y = saveX;
                    }
                }
            }
            else
            {
                Size btnSize = new ExplorerBarOpenCloseButtonObjectPainter().CalcObjectMinBounds(new ExplorerBarOpenCloseButtonInfoArgs(info.Cache, Rectangle.Empty, info.Appearance, ObjectState.Normal, true)).Size;
                result      = captionClient;
                result.Size = btnSize;
                if (IsCaptionHorizontal)
                {
                    result.X  = (captionClient.Right - result.Width) - 4;
                    result.Y += (captionClient.Height - result.Height) / 2;
                }
                else if (CaptionLocation == Locations.Left)
                {
                    result.X  = (captionClient.Width - result.Width) / 2;
                    result.Y += captionClient.Top + 4;
                }
                else
                {
                    result.X  = captionClient.X + (captionClient.Width - result.Width) / 2;
                    result.Y += (captionClient.Bottom - result.Width) - 4;
                }
            }
            return(result);
        }
Esempio n. 14
0
 protected override void CheckInfoCore(GroupObjectInfoArgs info, bool performLayout)
 {
     base.CheckInfoCore(info, performLayout);
     info.StateIndex   = 1;
     info.ButtonBounds = CalcGroupCaptionButtonBounds(info);
 }
 protected override SkinElement GetPanelSkinElement(GroupObjectInfoArgs info)
 {
     return(CommonSkins.GetSkin(this.Provider)[CommonSkins.SkinGroupPanel]);
 }