public override void SetDefaultStyle() { m_Background = UI.Defaults.PopupMenu.Background; m_Border = UI.Defaults.PopupMenu.Border; m_Font = UI.Defaults.PopupMenu.Font; m_MenuPadding = UI.Defaults.PopupMenu.MenuPadding; m_ItemPadding = UI.Defaults.PopupMenu.ItemPadding; m_ItemSpacing = UI.Defaults.PopupMenu.ItemSpacing; m_Separator = UI.Defaults.PopupMenu.Separator; m_ItemStates = UI.Defaults.PopupMenu.ItemStates; }
public void Load(string fileName, DomNode node) { foreach (DomNode child in node) { switch (child.Name.ToLower()) { case "background": Background = UIDefaults.LoadBackground(fileName, child); break; case "border": Border = UIDefaults.LoadBorder(fileName, child); break; } } }
public override void SetDefaultStyle() { if (m_Parent != null && m_Parent is HScrollBar) { m_Background = UI.Defaults.HScroll.BoxBackground; m_Border = UI.Defaults.HScroll.BoxBorder; } else { m_Background = UI.Defaults.VScroll.BoxBackground; m_Border = UI.Defaults.VScroll.BoxBorder; } }
public void Load(string fileName, DomNode node) { foreach (DomNode child in node) { switch (child.Name.ToLower()) { case "menu-background": Background = UIDefaults.LoadBackground(fileName, child); break; case "menu-border": Border = UIDefaults.LoadBorder(fileName, child); break; case "menu-padding": MenuPadding.Load(fileName, child); break; case "item-padding": ItemPadding.Load(fileName, child); break; case "item-spacing": ItemSpacing.Load(fileName, child); break; case "separator": Separator = UIDefaults.LoadBackground(fileName, child); break; case "item-states": ItemStates.Load(fileName, child); break; case "font": Font = UIDefaults.LoadFont(fileName, child); break; } } }
public override void SetDefaultStyle() { m_Background = UI.Defaults.Window.Background; m_Border = UI.Defaults.Window.Border; }
public virtual void Render(UIComponentState state, int x, int y, int width, int height, int paddingTop, int paddingRight, int paddingBottom, int paddingLeft, Font font, Color4 color, ISizedRenderable2D background, ISizedRenderable2D border) { int stt = (int)state; if (TextCache[stt] == null) { TextCache[stt] = new TextBox(Name, font, color, x + paddingLeft, y + paddingTop, width - paddingLeft - paddingRight, height - paddingTop - paddingBottom, UITextAlign.Left, UIVerticalAlign.Center, 0); } TextBox box = TextCache[stt]; if (background != null) { background.Render(x, y, width, height); } if (border != null) { border.Render(x, y, width, height); } box.Render(); }