protected override void UpdateCheckProperties(BaseCheckObjectInfoArgs e)
        {
            base.UpdateCheckProperties(e);
            MyCheckObjectInfoArgs ee = e as MyCheckObjectInfoArgs;

            if (ee == null)
            {
                return;
            }
            ee.VerticalGlyphAlignment = Item.VerticalGlyphAlignment;
        }
        protected override bool CanDrawCaption(BaseCheckObjectInfoArgs e)
        {
            MyCheckObjectInfoArgs ee = e as MyCheckObjectInfoArgs;

            if (ee == null)
            {
                return(base.CanDrawCaption(e));
            }
            else
            {
                return(MyFlatCheckObjectPainter.CanDrawCaptionEx(ee));
            }
        }
Пример #3
0
        protected Rectangle CalcCheckBoxRect(GraphicsCache cache, Rectangle bounds)
        {
            RepositoryItemCheckEdit checkBox = new RepositoryItemCheckEdit();
            CheckEditViewInfo       viewInfo = (CheckEditViewInfo)checkBox.CreateViewInfo();

            viewInfo.Bounds = bounds;
            viewInfo.CalcViewInfo(cache.Graphics);
            ControlGraphicsInfoArgs args = new ControlGraphicsInfoArgs(viewInfo, cache, bounds);
            BaseCheckObjectInfoArgs ci   = ((CheckEditViewInfo)args.ViewInfo).CheckInfo;

            Rectangle retValue = new Rectangle(bounds.X, ci.GlyphRect.Y, ci.GlyphRect.Width, ci.GlyphRect.Height);

            return(retValue);
        }
        //calculation of the thumb's backing image size
        protected override Size CalcImageSize(BaseCheckObjectInfoArgs e)
        {
            ToggleObjectInfoArgs args = e as ToggleObjectInfoArgs;

            if (args == null)
            {
                return(Size.Empty);
            }
            int heigth = args.Appearance.GetFontHeight(e.Cache) + 2 * args.TextMargin;
            int width  = (int)Math.Floor(heigth / PercentRatio);
            int delta  = 50;

            return(new Size(width > args.MinSize.Width ? width + delta : args.MinSize.Width + delta, heigth > args.MinSize.Height ? heigth : args.MinSize.Height));
            //original code
            //return new Size(width > args.MinSize.Width ? width : args.MinSize.Width , heigth > args.MinSize.Height ? heigth : args.MinSize.Height);
        }
 Rectangle ICaptionCalculationMethodsProvider.CalcCaptionRect(BaseCheckObjectInfoArgs e, Rectangle bounds, Rectangle caption, Rectangle glyph)
 {
     return(CalcCaptionRect(e, bounds, caption, glyph));
 }
        protected override Size CalcCheckSize(BaseCheckObjectInfoArgs e)
        {
            Size checkSize = base.CalcCheckSize(e);

            return(checkSize);
        }
 protected override Size CalcSimpleCaptionSize(BaseCheckObjectInfoArgs e, int textWidth)
 {
     return(base.CalcSimpleCaptionSize(e, textWidth));
 }
 protected override Size CalcCaptionSize(BaseCheckObjectInfoArgs e, int widthText)
 {
     return(base.CalcCaptionSize(e, widthText));
 }