private float CalcPopupWidth(string[] options, GUIStyle style) { float width = 0; for (int i = 0; i < options.Length; ++i) { width = Mathf.Max(width, CSharedStyles.MeasureWidth(style, options[i])); } return(width); }
public override void OnGUI() { if (m_title != null) { EditorGUILayout.BeginHorizontal(); { GUIStyle style = EditorStyles.miniLabel; if (m_titleWith == 0) { m_titleWith = CSharedStyles.MeasureWidth(style, m_title); } GUILayout.Label(m_title, style, GUILayout.Width(m_titleWith)); DrawPopup(); } EditorGUILayout.EndHorizontal(); } else { DrawPopup(); } }
public float CalcHeight(string text, float width) { return(CSharedStyles.MeasureHeight(m_style, text, width)); }
public Vector2 CalcSize(string text) { return(CSharedStyles.MeasureText(m_style, text)); }
public CToolBarCheckbox(string title, CToggleButtonDelegate buttonDelegate) : base(title, buttonDelegate) { Width = CSharedStyles.MeasureWidth(GUI.skin.toggle, title); }
public CToolBarToggle(string title, CToggleButtonDelegate buttonDelegate) : base(title, buttonDelegate) { Width = CSharedStyles.MeasureWidth(CSharedStyles.toolbarButton, title); }