Example #1
0
        protected MyGuiScreenBase(
            Vector2?position           = null,
            Vector4?backgroundColor    = null,
            Vector2?size               = null,
            bool isTopMostScreen       = false,
            string backgroundTexture   = null,
            float backgroundTransition = 0.0f,
            float guiTransition        = 0.0f)
        {
            m_controls            = new MyGuiControls(this);
            m_backgroundFadeColor = Color.White;
            m_backgroundColor     = backgroundColor;
            m_size                      = size;
            m_isTopMostScreen           = isTopMostScreen;
            m_allowUnhidePreviousScreen = true;

            State = MyGuiScreenState.OPENING;
            m_lastTransitionTime = MyGuiManager.TotalTimeInMilliseconds;
            m_position           = position ?? new Vector2(0.5f, 0.5f);

            m_backgroundTexture = backgroundTexture;

            Elements = new MyGuiControls(this);
            m_backgroundTransition = backgroundTransition;
            m_guiTransition        = guiTransition;
            CreateCloseButton();
            SetDefaultCloseButtonOffset();
        }
 public MyGuiControlScrollablePanel(MyGuiControlBase scrolledControl)
 {
     Name            = "ScrollablePanel";
     ScrolledControl = scrolledControl;
     m_controls      = new MyGuiControls(this);
     m_controls.Add(ScrolledControl);
 }
        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);
            }
        }
        public static MyGuiControlBase GetExclusiveInputHandler(MyGuiControls controls)
        {
            foreach (var control in controls.GetVisibleControls())
            {
                var exclusiveInputHandler = control.GetExclusiveInputHandler();
                if (exclusiveInputHandler != null)
                {
                    return(exclusiveInputHandler);
                }
            }

            return(null);
        }
        public MyGuiControlTable() :
            base(canHaveFocus: true)
        {
            m_scrollBar = new MyVScrollbar(this);
            m_scrollBar.ValueChanged += verticalScrollBar_ValueChanged;
            m_rows            = new List <Row>();
            m_columnsMetaData = new List <ColumnMetaData>();
            VisualStyle       = MyGuiControlTableStyleEnum.Default;

            m_controls = new MyGuiControls(null);

            base.Name = "Table";
        }
Example #6
0
 public MyGuiControlParent(
     Vector2?position        = null,
     Vector2?size            = null,
     Vector4?backgroundColor = null,
     String toolTip          = null)
     : base(position : position,
            size : size,
            colorMask : backgroundColor,
            toolTip : toolTip,
            isActiveControl : true,
            canHaveFocus : true)
 {
     m_controls = new MyGuiControls(this);
 }
Example #7
0
 private void OnVisibleControlsChanged(MyGuiControls sender)
 {
     Recalculate();
 }