public MyGuiControlBase(IMyGuiControlsParent parent, Vector2 position, MyGuiControlPreDefinedSize predefinedSize, Vector4?backgroundColor, StringBuilder toolTip, MyTexture2D controlTexture, MyTexture2D hoverTexture, MyTexture2D pressedTexture, bool isActiveControl) : this(parent, position, backgroundColor, toolTip, controlTexture, hoverTexture, pressedTexture, isActiveControl, null, null /*, null, null*/) { m_predefinedSize = predefinedSize; m_size = GetPredefinedControlSize(); }
public MyGuiControlListboxDragAndDrop(IMyGuiControlsParent parent, List<MyGuiControlListbox> listboxesToDrop, MyGuiControlPreDefinedSize predefinedSize, Vector4 backgroundColor, Vector4 textColor, float textScale, Vector2 textOffset, bool supportIcon) : base(parent, new Vector2(0.0f, 0.0f), predefinedSize, backgroundColor, null, true) { m_listboxesToDrop = listboxesToDrop; m_textColor = textColor; m_textScale = textScale; m_textOffset = textOffset; m_supportIcon = supportIcon; m_size = GetPredefinedControlSize(); DrawBackgroundTexture = true; }
public MyGuiControlTextbox(IMyGuiControlsParent parent, Vector2 position, MyGuiControlPreDefinedSize predefinedSize, string defaultText, int maxLength, Vector4 textColor, float textScale, MyGuiControlTextboxType type, bool canHandleKeyboardActiveControl, bool drawBackground = true) : base(parent, position, predefinedSize, drawBackground ? MyGuiConstants.BUTTON_BACKGROUND_COLOR : Color.Transparent.ToVector4(), null, drawBackground ? MyGuiManager.GetTextboxTexture(predefinedSize) : null, null, null, true) { Visible = true; m_type = type; m_size = GetPredefinedControlSize(); m_carriagePositionIndex = 0; m_carriageBlinkerTimer = 0; m_canHandleKeyboardActiveControl = canHandleKeyboardActiveControl; m_textColor = MyGuiConstants.DEFAULT_CONTROL_NONACTIVE_COLOR; m_textScale = textScale; m_maxLength = maxLength; m_slidingWindowPosition = GetTextAreaPosition(); Text = defaultText; }
public MyGuiControlCombobox(IMyGuiControlsParent parent, Vector2 position, MyGuiControlPreDefinedSize predefinedSize, Vector2 iconSize, Vector2 textOffset, Vector4 backgroundColor, float textScale, int openAreaItemsCount, bool supportPicture, bool supportSmoothScroll, bool supportListBoxMode, bool useScrollBarOffset = false) : base(parent, position, predefinedSize, backgroundColor, null, MyGuiManager.GetComboboxTexture(predefinedSize), null, null, true) { m_highlightType = MyGuiControlHighlightType.WHEN_CURSOR_OVER; m_canHandleKeyboardActiveControl = true; m_items = new List<MyGuiControlComboboxItem>(); m_isOpen = supportListBoxMode; m_textColor = MyGuiConstants.COMBOBOX_TEXT_COLOR; m_textScale = textScale; m_openAreaItemsCount = openAreaItemsCount; m_middleIndex = Math.Max(m_openAreaItemsCount / 2 - 1, 0); m_supportIcon = supportPicture; m_supportSmoothScroll = supportSmoothScroll; m_supportListBoxMode = supportListBoxMode; m_textOffset = textOffset; m_size = GetPredefinedControlSize(); if(m_supportIcon) { m_size = new Vector2(m_size.Value.X, iconSize.Y); } m_dropDownItemSize = GetItemSize(); m_comboboxItemDeltaHeight = m_dropDownItemSize.Y; // m_doubleClickTimer = 0; m_mousePositionReinit = true; InitializeScrollBarParameters(); m_showToolTip = true; m_useScrollBarOffset = useScrollBarOffset; }
public MyGuiControlCombobox(IMyGuiControlsParent parent, Vector2 position, MyGuiControlPreDefinedSize predefinedSize, Vector4 backgroundColor, float textScale, int openAreaItemsCount) : this(parent, position, predefinedSize, backgroundColor, textScale, openAreaItemsCount, false, false, false) { }
// Base Constructor public MyGuiControlCombobox(IMyGuiControlsParent parent, Vector2 position, MyGuiControlPreDefinedSize predefinedSize, Vector4 backgroundColor, float textScale, int openAreaItemsCount, bool supportPicture, bool supportSmoothScroll, bool supportListBoxMode, bool useScrollbarOffset = false) : this(parent, position, predefinedSize, MyGuiConstants.COMBOBOX_ICON_SIZE, MyGuiConstants.COMBOBOX_TEXT_OFFSET, backgroundColor, textScale, openAreaItemsCount, supportPicture, supportSmoothScroll, supportListBoxMode, useScrollbarOffset) { }
public static Vector2 GetPredefinedControlSize(MyGuiControlPreDefinedSize preDefinedSize) { switch (preDefinedSize) { case MyGuiControlPreDefinedSize.LARGE: return MyGuiConstants.COMBOBOX_LARGE_SIZE; case MyGuiControlPreDefinedSize.MEDIUM: return MyGuiConstants.COMBOBOX_MEDIUM_SIZE; case MyGuiControlPreDefinedSize.LONGMEDIUM: return MyGuiConstants.COMBOBOX_LONGMEDIUM_SIZE; case MyGuiControlPreDefinedSize.SMALL: return MyGuiConstants.COMBOBOX_SMALL_SIZE; default: throw new IndexOutOfRangeException("undefined for this size"); } }
public MyGuiControlListboxDragAndDrop(IMyGuiControlsParent parent, List <MyGuiControlListbox> listboxesToDrop, MyGuiControlPreDefinedSize predefinedSize, Vector4 backgroundColor, Vector4 textColor, float textScale, Vector2 textOffset, bool supportIcon) : base(parent, new Vector2(0.0f, 0.0f), predefinedSize, backgroundColor, null, true) { m_listboxesToDrop = listboxesToDrop; m_textColor = textColor; m_textScale = textScale; m_textOffset = textOffset; m_supportIcon = supportIcon; m_size = GetPredefinedControlSize(); DrawBackgroundTexture = true; }
public MyGuiControlBase(IMyGuiControlsParent parent, Vector2 position, MyGuiControlPreDefinedSize predefinedSize, Vector4? backgroundColor, StringBuilder toolTip, MyTexture2D controlTexture, MyTexture2D hoverTexture, MyTexture2D pressedTexture, bool isActiveControl) : this(parent, position, backgroundColor, toolTip, controlTexture, hoverTexture, pressedTexture, isActiveControl, null, null/*, null, null*/) { m_predefinedSize = predefinedSize; m_size = GetPredefinedControlSize(); }
public MyGuiControlBase(IMyGuiControlsParent parent, Vector2 position, MyGuiControlPreDefinedSize predefinedSize, Vector4? backgroundColor, StringBuilder toolTip, bool isActiveControl) : this(parent, position, predefinedSize, backgroundColor, toolTip, null, null, null, isActiveControl) { }
public MyGuiControlBase(IMyGuiControlsParent parent, Vector2 position, MyGuiControlPreDefinedSize predefinedSize, Vector4?backgroundColor, StringBuilder toolTip, bool isActiveControl) : this(parent, position, predefinedSize, backgroundColor, toolTip, null, null, null, isActiveControl) { }
public MyGuiControlTextbox(IMyGuiControlsParent parent, Vector2 position, MyGuiControlPreDefinedSize predefinedSize, string defaultText, int maxLength, Vector4 textColor, float textScale, MyGuiControlTextboxType type) : this(parent, position, predefinedSize, defaultText, maxLength, textColor, textScale, type, true) { }
public static MyTexture2D GetComboboxTextureBottom(MyGuiControlPreDefinedSize predefinedSize) { switch (predefinedSize) { case MyGuiControlPreDefinedSize.MEDIUM: return m_comboboxMediumBottomTexture; case MyGuiControlPreDefinedSize.LONGMEDIUM: return m_comboboxMediumBottomTexture; default: throw new IndexOutOfRangeException("this combobox texture does not exist"); } }
public static MyTexture2D GetTextboxTexture(MyGuiControlPreDefinedSize predefinedSize) { /* if (predefinedSize == MyGuiControlPreDefinedSize.SMALL) { return m_textboxSmallTexture; } else if (predefinedSize == MyGuiControlPreDefinedSize.MEDIUM) { return m_textboxMediumTexture; } else { return m_textboxLargeTexture; } * */ return m_textboxMediumTexture; }