protected MyGuiControlBase(
            Vector2?position  = null,
            Vector2?size      = null,
            Vector4?colorMask = null,
            String toolTip    = null,
            MyGuiCompositeTexture backgroundTexture = null,
            bool isActiveControl       = true,
            bool canHaveFocus          = false,
            bool allowFocusingElements = false,
            MyGuiControlHighlightType highlightType = MyGuiControlHighlightType.WHEN_ACTIVE,
            MyGuiDrawAlignEnum originAlign          = MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER)
        {
            Name                  = GetType().Name;
            Visible               = true;
            m_enabled             = true;
            m_position            = position ?? Vector2.Zero;
            m_canHaveFocus        = canHaveFocus;
            m_size                = size ?? Vector2.One;
            m_colorMask           = colorMask ?? Vector4.One;
            BackgroundTexture     = backgroundTexture;
            IsActiveControl       = isActiveControl;
            HighlightType         = highlightType;
            m_originAlign         = originAlign;
            BorderSize            = 1;
            BorderColor           = Vector4.One;
            BorderEnabled         = false;
            DrawWhilePaused       = true;
            Elements              = new MyGuiControls(this);
            AllowFocusingElements = allowFocusingElements;

            if (toolTip != null)
            {
                m_toolTip = new MyToolTips(toolTip);
            }
        }
 /// <summary>
 /// Do not construct directly. Use AddItem on listbox for that.
 /// </summary>
 public Item(StringBuilder text = null, String toolTip = null, string icon = null, object userData = null, MyFontEnum?fontOverride = null)
 {
     Text         = new StringBuilder((text != null) ? text.ToString() : "");
     ToolTip      = (toolTip != null) ? new MyToolTips(toolTip) : null;
     Icon         = icon;
     UserData     = userData;
     FontOverride = fontOverride;
     Visible      = true;
 }
 //same as above, but designed to have realtime updates of text inside. So no copy of text :-)
 public Item(ref StringBuilder text, String toolTip = null, string icon = null, object userData = null, MyFontEnum?fontOverride = null)
 {
     Text         = text;
     ToolTip      = (toolTip != null) ? new MyToolTips(toolTip) : null;
     Icon         = icon;
     UserData     = userData;
     FontOverride = fontOverride;
     Visible      = true;
 }
示例#4
0
 public override void ShowToolTip()
 {
     MyToolTips tempTooltip = m_toolTip;
     if (m_isOpen && IsMouseOverOnOpenedArea() && m_preselectedMouseOver != null && m_preselectedMouseOver.ToolTip != null)
     {
         m_toolTip = m_preselectedMouseOver.ToolTip;
     }            
     base.ShowToolTip();
     m_toolTip = tempTooltip;
 }
 public void SetEmptyItemToolTip(String toolTip)
 {
     if (toolTip == null)
     {
         m_emptyItemToolTip = null;
     }
     else
     {
         m_emptyItemToolTip = new MyToolTips(toolTip);
     }
 }
示例#6
0
            public Item(long key, String value, int sortOrder, String toolTip = null)
            {
                Debug.Assert(value != null);

                Key = key;
                SortOrder = sortOrder;

                if (value != null)
                    Value = new StringBuilder(value.Length).Append(value);
                else
                    Value = new StringBuilder();

                if (toolTip != null)
                    ToolTip = new MyToolTips(toolTip);
            }
 public Cell(StringBuilder text, object userData = null, String toolTip                     = null, Color?textColor = null,
             MyGuiHighlightTexture?icon          = null, MyGuiDrawAlignEnum iconOriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP)
 {
     if (text != null)
     {
         Text = new StringBuilder().AppendStringBuilder(text);
     }
     if (toolTip != null)
     {
         ToolTip = new MyToolTips(toolTip);
     }
     UserData        = userData;
     Icon            = icon;
     IconOriginAlign = iconOriginAlign;
     TextColor       = textColor;
 }
 public Item(
     string[] icons      = null,
     string subicon      = null,
     MyToolTips toolTips = null,
     object userData     = null,
     bool enabled        = true)
 {
     TextsByAlign     = new Dictionary <MyGuiDrawAlignEnum, StringBuilder>();
     IconsByAlign     = new Dictionary <MyGuiDrawAlignEnum, ColoredIcon>();
     Icons            = icons;
     SubIcon          = subicon;
     ToolTip          = toolTips;
     UserData         = userData;
     Enabled          = enabled;
     IconColorMask    = Vector4.One;
     OverlayColorMask = Vector4.One;
     blinkCount       = 0;
 }
 public Item(
     string[] icons = null,
     string subicon = null,
     MyToolTips toolTips = null,
     object userData = null,
     bool enabled = true)
 {
     TextsByAlign = new Dictionary<MyGuiDrawAlignEnum, StringBuilder>();
     IconsByAlign = new Dictionary<MyGuiDrawAlignEnum, ColoredIcon>();
     Icons = icons;
     SubIcon = subicon;
     ToolTip = toolTips;
     UserData = userData;
     Enabled = enabled;
     IconColorMask = Vector4.One;
     OverlayColorMask = Vector4.One;
     blinkCount = 0;
 }
 public void SetToolTip(MyToolTips toolTip)
 {
     m_toolTip = toolTip;
 }
 public Cell(StringBuilder text, object userData = null, String toolTip = null, Color? textColor = null,
             MyGuiHighlightTexture? icon = null, MyGuiDrawAlignEnum iconOriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP)
 {
     if (text != null)
         Text = new StringBuilder().AppendStringBuilder(text);
     if (toolTip != null)
         ToolTip = new MyToolTips(toolTip);
     UserData = userData;
     Icon = icon;
     IconOriginAlign = iconOriginAlign;
     TextColor = textColor;
 }
 public void ShowToolTip(MyToolTips tooltip)
 {
     m_showToolTip = false;
     m_toolTip     = tooltip;
     ShowToolTip();
 }
 //same as above, but designed to have realtime updates of text inside. So no copy of text :-)
 public Item(ref StringBuilder text, String toolTip = null, string icon = null, object userData = null, MyFontEnum? fontOverride = null)
 {
     Text = text;
     ToolTip = (toolTip != null) ? new MyToolTips(toolTip) : null;
     Icon = icon;
     UserData = userData;
     FontOverride = fontOverride;
     Visible = true;
 }
 /// <summary>
 /// Do not construct directly. Use AddItem on listbox for that.
 /// </summary>
 public Item(StringBuilder text = null, String toolTip = null, string icon = null, object userData = null, MyFontEnum? fontOverride = null)
 {
     Text         = new StringBuilder((text != null) ? text.ToString() : "");
     ToolTip      = (toolTip != null) ? new MyToolTips(toolTip) : null;
     Icon         = icon;
     UserData     = userData;
     FontOverride = fontOverride;
     Visible      = true;
 }
 public void SetEmptyItemToolTip(String toolTip)
 {
     if (toolTip == null)
         m_emptyItemToolTip = null;
     else
         m_emptyItemToolTip = new MyToolTips(toolTip);
 }
            public Item(long key, String value, int sortOrder, String toolTip = null)
            {
                Debug.Assert(value != null);

                Key = key;
                SortOrder = sortOrder;

                if (value != null)
                    Value = new StringBuilder(value.Length).Append(value);
                else
                    Value = new StringBuilder();

                if (toolTip != null)
                    ToolTip = new MyToolTips(toolTip);
            }
 public void ShowToolTip(MyToolTips tooltip)
 {
     m_showToolTip = false;
     m_toolTip = tooltip;
     ShowToolTip();
 }