protected override Rectangle CalcButtons(GraphicsCache cache) { bool autoFit = Item.TextEditStyle == TextEditStyles.HideTextEditor; EditorButtonCollection inpButtons = new EditorButtonCollection(); if (this.OwnerEdit != null) { inpButtons = Item.Buttons; } else { inpButtons = ButtonsFromEditValue(); //LeftButtons.Clear(); } for (int n = 0; n < inpButtons.Count; n++) { EditorButton btn = inpButtons[n]; if (!btn.Visible) { continue; } EditorButtonObjectInfoArgs info = CreateButtonInfo(btn, n); info.FillBackground = FillBackground; CalcButtonState(info, n); info.Cache = cache; LeftButtons.Add(info); } CustomCalc targs = CreateCustomCalcButtonsRectsArgs(ClientRect); targs.UseAutoFit = false; targs.ViewInfo = this; targs.Calc(); RightButtons.SetCache(null); LeftButtons.SetCache(null); return(targs.ClientRect); }
protected virtual CustomCalc CreateCustomCalcButtonsRectsArgs(Rectangle clientBounds) { CustomCalc res = new CustomCalc(LeftButtons, RightButtons, clientBounds); return(res); }