public override void Init(MyObjectBuilder_GuiControlBase objectBuilder)
        {
            base.Init(objectBuilder);

            var ob = (MyObjectBuilder_GuiControlCompositePanel)objectBuilder;
            InnerHeight = ob.InnerHeight;
        }
Exemplo n.º 2
0
 public override void Init(MyObjectBuilder_GuiControlBase builder)
 {
     base.Init(builder);
     
     MyDebug.AssertDebug(builder is MyObjectBuilder_GuiControlParent);
     var ob = builder as MyObjectBuilder_GuiControlParent;
     if (ob.Controls != null)
         m_controls.Init(ob.Controls);
 }
        public override void Init(MyObjectBuilder_GuiControlBase objectBuilder)
        {
            base.Init(objectBuilder);

            var ob = objectBuilder as MyObjectBuilder_GuiControlProgressBar;
            Debug.Assert(ob != null);

            MyGuiControlBase.ReadIfHasValue(ref ProgressColor, ob.ProgressColor);
        }
        public override void Init(MyObjectBuilder_GuiControlBase builder)
        {
            base.Init(builder);

            var ob = builder as MyObjectBuilder_GuiControlTabPage;
            MyDebug.AssertDebug(ob != null);

            m_pageKey = ob.PageKey;
            TextEnum  = MyStringId.GetOrCompute(ob.TextEnum);
            TextScale = ob.TextScale;
        }
        public override void Init(MyObjectBuilder_GuiControlBase builder)
        {
            base.Init(builder);

            Size = new Vector2(m_onButton.Size.X + m_offButton.Size.X,
                               Math.Max(m_onButton.Size.Y, m_offButton.Size.Y));
            Debug.Assert(m_onButton != null);
            Debug.Assert(m_offButton != null);
            Debug.Assert(Elements.Contains(m_onButton));
            Debug.Assert(Elements.Contains(m_offButton));
            Debug.Assert(m_onButton.Owner == this);
            Debug.Assert(m_offButton.Owner == this);
            UpdateButtonState();
        }
        public override void Init(MyObjectBuilder_GuiControlBase builder)
        {
            base.Init(builder);

            var ob = (MyObjectBuilder_GuiControlSeparatorList)builder;
            m_separators.Clear();
            m_separators.Capacity = ob.Separators.Count;
            foreach (var separator in ob.Separators)
            {
                m_separators.Add(new Separator()
                {
                    Start = new Vector2(separator.StartX, separator.StartY),
                    Size  = new Vector2(separator.SizeX, separator.SizeY),
                });
            }
        }
Exemplo n.º 7
0
        public override void Init(MyObjectBuilder_GuiControlBase objectBuilder)
        {
            base.Init(objectBuilder);

            var controlBuilder = (MyObjectBuilder_GuiControlCheckbox)objectBuilder;
            m_isChecked = controlBuilder.IsChecked;
            VisualStyle = controlBuilder.VisualStyle;
        }
        public override void Init(MyObjectBuilder_GuiControlBase builder)
        {
            base.Init(builder);

            var ob = builder as MyObjectBuilder_GuiControlList;
            MyDebug.AssertDebug(ob != null);
            VisualStyle = ob.VisualStyle;
        }
Exemplo n.º 9
0
        public override void Init(MyObjectBuilder_GuiControlBase objectBuilder)
        {
            base.Init(objectBuilder);

            m_slidingWindowOffset = 0f;
            m_carriagePositionIndex = 0;
        }
Exemplo n.º 10
0
        //public MyGuiControlLabel(
        //    Vector2? position = null,
        //    Vector2? size = null,
        //    StringBuilder text = null,
        //    Vector4? colorMask = null,
        //    float textScale = MyGuiConstants.DEFAULT_TEXT_SCALE,
        //    MyFontEnum font = MyFontEnum.Blue,
        //    MyGuiDrawAlignEnum originAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER)
        //    : base(position: position,
        //           size: size,
        //           colorMask: colorMask,
        //           isActiveControl: false)
        //{
        //    Name = "Label";
        //    Font = font;
        //    if (text != null)
        //    {
        //        //  Create COPY of the text (Don't just point to one string builder!!! This was my original mistake!)
        //        m_text = text.ToString();
        //        TextToDraw = new StringBuilder(text.ToString());
        //    }
        //    OriginAlign = originAlign;
        //    TextScale = textScale;
        //}

        public override void Init(MyObjectBuilder_GuiControlBase objectBuilder)
        {
            base.Init(objectBuilder);

            var labelObjectBuilder = (MyObjectBuilder_GuiControlLabel)objectBuilder;
            m_textEnum = MyStringId.GetOrCompute(labelObjectBuilder.TextEnum);
            TextScale = labelObjectBuilder.TextScale;
            m_text = String.IsNullOrWhiteSpace(labelObjectBuilder.Text) ? null : labelObjectBuilder.Text;
            Font = labelObjectBuilder.Font;
            TextToDraw = new StringBuilder();
            UpdateFormatParams(null);
        }
Exemplo n.º 11
0
        public override void Init(MyObjectBuilder_GuiControlBase objectBuilder)
        {
            base.Init(objectBuilder);

            MyObjectBuilder_GuiControlGrid gridOb = (MyObjectBuilder_GuiControlGrid)objectBuilder;

            VisualStyle = gridOb.VisualStyle;
            RowsCount = gridOb.DisplayRowsCount;
            ColumnsCount = gridOb.DisplayColumnsCount;
        }
        public override void Init(MyObjectBuilder_GuiControlBase builder)
        {
            base.Init(builder);

            var ob = (MyObjectBuilder_GuiControlTabControl)builder;

            RecreatePages();

            HideTabs();
            SelectedPage = 0;
        }
        public override void Init(MyObjectBuilder_GuiControlBase objectBuilder)
        {
            base.Init(objectBuilder);

            m_label.MaxLineWidth = ComputeRichLabelWidth();
            var ob = (MyObjectBuilder_GuiControlMultilineLabel)objectBuilder;

            this.TextAlign    = (MyGuiDrawAlignEnum)ob.TextAlign;
            this.TextBoxAlign = (MyGuiDrawAlignEnum)ob.TextBoxAlign;
            this.TextScale    = ob.TextScale;
            this.TextColor    = new Color(ob.TextColor);
            this.Font         = ob.Font;

            MyStringId textEnum;
            if (Enum.TryParse<MyStringId>(ob.Text, out textEnum))
                TextEnum = textEnum;
            else
                Text = new StringBuilder(ob.Text);
        }
Exemplo n.º 14
0
        public override void Init(MyObjectBuilder_GuiControlBase objectBuilder)
        {
            base.Init(objectBuilder);

            var buttonObjectBuilder = (MyObjectBuilder_GuiControlButton)objectBuilder;

            Text                         = buttonObjectBuilder.Text;
            m_textEnum                   = MyStringId.GetOrCompute(buttonObjectBuilder.TextEnum);
            TextScale                    = buttonObjectBuilder.TextScale;
            TextAlignment                = (MyGuiDrawAlignEnum)buttonObjectBuilder.TextAlignment;
            DrawCrossTextureWhenDisabled = buttonObjectBuilder.DrawCrossTextureWhenDisabled;
            VisualStyle                  = buttonObjectBuilder.VisualStyle;

            UpdateText();
        }
        public override void Init(MyObjectBuilder_GuiControlBase objectBuilder)
        {
            base.Init(objectBuilder);

            MyObjectBuilder_GuiControlListbox listboxOb = (MyObjectBuilder_GuiControlListbox)objectBuilder;

            VisibleRowsCount = listboxOb.VisibleRows;
            VisualStyle = listboxOb.VisualStyle;
        }