public MyGuiControlMultilineText(
            IMyGuiControlsParent parent, Vector2 position,
            Vector2 size, Vector4? backgroundColor,
            MyGuiFont font, float textScale, MyGuiDrawAlignEnum textAlign, StringBuilder contents, bool drawBorders = true, bool drawScrollbar = true)
            : base(parent, position, size, backgroundColor, null)
        {
            m_font = font;
            m_textScale = textScale;
            m_textAlign = textAlign;
            m_drawBorders = drawBorders;
            m_drawScrollbar = drawScrollbar;
            TextColor = new Color(MyGuiConstants.LABEL_TEXT_COLOR);

            m_scrollbar = new MyVScrollbar(this);
            m_scrollbar.TopBorder = m_scrollbar.RightBorder = m_scrollbar.BottomBorder = false;
            m_scrollbar.LeftBorder = drawBorders;
            m_scrollbarSize = new Vector2(0.0334f, MyGuiConstants.COMBOBOX_VSCROLLBAR_SIZE.Y);
            m_scrollbarSize = MyGuiConstants.COMBOBOX_VSCROLLBAR_SIZE;
            float minLineHeight = MyGuiManager.MeasureString(m_font,
                                                      MyTextsWrapper.Get(MyTextsWrapperEnum.ServerShutdownNotificationCaption),
                                                      m_parent.GetPositionAbsolute() + m_position, m_textScale,
                                                      m_textAlign).Size.Y;
            m_label = new MyRichLabel(size.X, minLineHeight);
            if (contents != null && contents.Length > 0)
            {
                SetText(contents);
            }
        }                
Ejemplo n.º 2
0
        public MyTreeView(MyGuiControlTreeView control, Vector2 position, Vector2 size)
        {
            m_control = control;

            m_position = position;
            m_size     = size;

            m_body          = new MyTreeViewBody(this, position, size);
            m_vScrollbar    = new MyVScrollbar(control);
            m_hScrollbar    = new MyHScrollbar(control);
            m_scrollbarSize = new Vector2(MyGuiConstants.TREEVIEW_VSCROLLBAR_SIZE.X, MyGuiConstants.TREEVIEW_HSCROLLBAR_SIZE.Y);

            m_vScrollbar.TopBorder  = m_vScrollbar.RightBorder = false;
            m_hScrollbar.LeftBorder = m_hScrollbar.BottomBorder = false;
        }
Ejemplo n.º 3
0
        public MyTreeView(MyGuiControlTreeView control, Vector2 position, Vector2 size)
        {
            m_control = control;

            m_position = position;
            m_size = size;

            m_body = new MyTreeViewBody(this, position, size);
            m_vScrollbar = new MyVScrollbar(control);
            m_hScrollbar = new MyHScrollbar(control);
            m_scrollbarSize = new Vector2(MyGuiConstants.TREEVIEW_VSCROLLBAR_SIZE.X, MyGuiConstants.TREEVIEW_HSCROLLBAR_SIZE.Y);

            m_vScrollbar.TopBorder = m_vScrollbar.RightBorder = false;
            m_hScrollbar.LeftBorder = m_hScrollbar.BottomBorder = false;
        }