protected override void LayoutCore(IGraphicContext graphicContext) { base.LayoutCore(graphicContext); Size = graphicContext.MeasureText(m_Name, Style.Common.Font, Style.Lifeline.NameFontSize); if (Size.Width < MinWidth) { Size = new Size(MinWidth, Height); } m_Column.Allocate(Size.Width); m_Row.Body.Allocate(Size.Height); }
protected override void LayoutCore(IGraphicContext graphicContext) { base.LayoutCore(graphicContext); m_TextSize = graphicContext.MeasureText(m_Fragment.Title, Style.Common.Font, Style.Fragment.FontSize); m_InnerPadding = m_PaddingDepth * Style.Fragment.FramePadding; Width = m_TextSize.Width + Style.Fragment.FramePadding; var firstChild = Children.FirstOrDefault() as OperandVisualBase; var firstChildBottomOffset = firstChild != null ? firstChild.BottomOffset : 0; BottomOffset = firstChildBottomOffset + m_TextSize.Height; TopRow.TopGap.Allocate(BottomOffset + 4); BottomRow.BottomGap.Allocate(m_InnerPadding.Bottom); LeftColumn.LeftGap.Allocate(m_InnerPadding.Left); RightColumn.RightGap.Allocate(m_InnerPadding.Right); }
protected override void LayoutCore(IGraphicContext graphicContext) { base.LayoutCore(graphicContext); Size = string.IsNullOrEmpty(m_GuardExpressionText) ? Size.Empty : graphicContext.MeasureText(m_GuardExpressionText, Style.Common.Font, Style.GuardExpression.FontSize); float childBottomOffset = Children .Where(visual => visual is FragmentVisual) .Cast <FragmentVisual>() .Where(fragment => fragment.TopRow == m_TopRow) .Select(fragment => fragment.BottomOffset) .DefaultIfEmpty() .Max(); BottomOffset = childBottomOffset + Size.Height + 8; m_TopRow.TopGap.Allocate(BottomOffset); this.GridLayout.AllocateBetween(m_LeftColumn, m_RightColumn, this.Size.Width); }
protected override void LayoutCore(IGraphicContext graphicContext) { Size = graphicContext.MeasureText(_text.DisplayText, Font.Handwritten, 12); }
public string MeasureText(string text, int size, int width) { return(_nativeInstance.MeasureText(text, size, width)); }
protected override void LayoutCore(IGraphicContext graphicContext) { base.LayoutCore(graphicContext); m_TextSize = graphicContext.MeasureText(m_Signal.Name, Style.Common.Font, Style.Signal.FontSize); }