public static Rectangle ReCalcObjectMinBounds(ObjectInfoArgs e) { MyCheckObjectInfoArgs ee = e as MyCheckObjectInfoArgs; if (ee != null && ee.VerticalGlyphAlignment != VerticalGlyphAlignment.Center) { ee.Bounds = new Rectangle(ee.Bounds.X, ee.Bounds.Y, ee.Bounds.Width, ee.Bounds.Height * 2 + 2); } return(ee.Bounds); }
protected override void UpdateCheckProperties(BaseCheckObjectInfoArgs e) { base.UpdateCheckProperties(e); MyCheckObjectInfoArgs ee = e as MyCheckObjectInfoArgs; if (ee == null) { return; } ee.VerticalGlyphAlignment = Item.VerticalGlyphAlignment; }
public override void Assign(ObjectInfoArgs info) { base.Assign(info); MyCheckObjectInfoArgs source = info as MyCheckObjectInfoArgs; if (source == null) { return; } VerticalGlyphAlignment = source.VerticalGlyphAlignment; }
protected override bool CanDrawCaption(BaseCheckObjectInfoArgs e) { MyCheckObjectInfoArgs ee = e as MyCheckObjectInfoArgs; if (ee == null) { return(base.CanDrawCaption(e)); } else { return(MyFlatCheckObjectPainter.CanDrawCaptionEx(ee)); } }
public static Rectangle ReCalcObjectBounds(ObjectInfoArgs e, ICaptionCalculationMethodsProvider instance) { MyCheckObjectInfoArgs ee = e as MyCheckObjectInfoArgs; if (ee != null) { Rectangle glyphRect = ee.GlyphRect; Rectangle captionRect = ee.CaptionRect; if (ee.GlyphAlignment == HorzAlignment.Center && ee.VerticalGlyphAlignment != VerticalGlyphAlignment.Center) { Size cSize = instance.CalcCaptionSize(ee, e.Bounds.Width); captionRect = e.Bounds; captionRect.Width = Math.Min(cSize.Width, captionRect.Width); ee.CaptionRect = captionRect; if (ee.AllowHtmlString) { instance.CalcHtmlCaptionBounds(ee); } } captionRect.X = (ee.Bounds.Width - captionRect.Width) / 2; switch (ee.VerticalGlyphAlignment) { case VerticalGlyphAlignment.Top: glyphRect.Y = 2; captionRect.Y = glyphRect.Height - 4; break; case VerticalGlyphAlignment.Bottom: glyphRect.Y = ee.GlyphRect.Height + 2; captionRect.Y = 2; captionRect.Height -= glyphRect.Height + 2; break; default: return(ee.Bounds); } ee.GlyphRect = glyphRect; ee.CaptionRect = captionRect; } return(e.Bounds); }
public static bool CanDrawCaptionEx(MyCheckObjectInfoArgs ee) { return(!(ee.GlyphAlignment == HorzAlignment.Center && ee.VerticalGlyphAlignment == VerticalGlyphAlignment.Center)); }