Space Engineers
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | Events | List of all members
Sandbox.Graphics.GUI.MyGuiControlCombobox Class Reference
Inheritance diagram for Sandbox.Graphics.GUI.MyGuiControlCombobox:
Sandbox.Graphics.GUI.MyGuiControlBase Sandbox.Graphics.GUI.IMyGuiControlsOwner

Classes

class  Item
 
class  StyleDefinition
 

Public Member Functions

delegate void ItemSelectedDelegate ()
 
 MyGuiControlCombobox ()
 
 MyGuiControlCombobox (Vector2?position=null, Vector2?size=null, Vector4?backgroundColor=null, Vector2?textOffset=null, int openAreaItemsCount=10, Vector2?iconSize=null, bool useScrollBarOffset=false, String toolTip=null, MyGuiDrawAlignEnum originAlign=MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, Vector4?textColor=null)
 
void ClearItems ()
 
void AddItem (long key, MyStringId value, int?sortOrder=null, MyStringId?toolTip=null)
 
void AddItem (long key, StringBuilder value, int?sortOrder=null, String toolTip=null)
 
void AddItem (long key, String value, int?sortOrder=null, String toolTip=null)
 
void RemoveItem (long key)
 
void RemoveItemByIndex (int index)
 
Item GetItemByIndex (int index)
 
Item TryGetItemByKey (long key)
 
int GetItemsCount ()
 
void SortItemsByValueText ()
 
void CustomSortItems (Comparison< Item > comparison)
 
override MyGuiControlBase GetExclusiveInputHandler ()
 
void SelectItemByIndex (int index)
 
void SelectItemByKey (long key, bool sendEvent=true)
 
long GetSelectedKey ()
 
int GetSelectedIndex ()
 
StringBuilder GetSelectedValue ()
 
override MyGuiControlBase HandleInput ()
 Method returns true if input was captured by control, so no other controls, nor screen can use input in this update. More...
 
override void Draw (float transitionAlpha, float backgroundTransitionAlpha)
 two phase draw(two SpriteBatch phase): More...
 
void ScrollToPreSelectedItem ()
 
override bool CheckMouseOver ()
 Checks if mouse cursor is over control. GR: Update: Also check if mouse over parent controls. Slower but more solid implementation (and we get rid of a few bugs). Also there is no need for HandleMouse variable (removed) More...
 
override void ShowToolTip ()
 
void ApplyStyle (StyleDefinition style)
 
- Public Member Functions inherited from Sandbox.Graphics.GUI.MyGuiControlBase
virtual void Init (MyObjectBuilder_GuiControlBase builder)
 
virtual MyObjectBuilder_GuiControlBase GetObjectBuilder ()
 
virtual MyGuiControlGridDragAndDrop GetDragAndDropHandlingNow ()
 
virtual MyGuiControlBase GetMouseOverControl ()
 Returns first control, which has mouse over. More...
 
virtual void HideToolTip ()
 
virtual bool IsMouseOverAnyControl ()
 
virtual void Update ()
 
virtual string GetMouseCursorTexture ()
 
Vector2 GetPositionAbsolute ()
 
Vector2 GetPositionAbsoluteBottomLeft ()
 
Vector2 GetPositionAbsoluteBottomRight ()
 
Vector2 GetPositionAbsoluteCenterLeft ()
 
Vector2 GetPositionAbsoluteCenter ()
 
Vector2 GetPositionAbsoluteTopLeft ()
 
Vector2 GetPositionAbsoluteTopRight ()
 
Vector2 GetSize ()
 
void SetToolTip (MyToolTips toolTip)
 
void SetToolTip (String text)
 
void SetToolTip (MyStringId text)
 
virtual void OnRemoving ()
 Removes various references and clears event handlers. More...
 
void GetElementsUnderCursor (Vector2 position, bool visibleOnly, List< MyGuiControlBase > controls)
 
virtual MyGuiControlBase GetNextFocusControl (MyGuiControlBase currentFocusControl, bool forwardMovement)
 
virtual void Clear ()
 
override string ToString ()
 

Static Public Member Functions

static StyleDefinition GetVisualStyle (MyGuiControlComboboxStyleEnum style)
 
- Static Public Member Functions inherited from Sandbox.Graphics.GUI.MyGuiControlBase
static void ReadIfHasValue< T > (ref T target, T?source)
 
static void ReadIfHasValue (ref Color target, Vector4?source)
 
static MyGuiControlBase GetExclusiveInputHandler (MyGuiControls controls)
 
static Color ApplyColorMaskModifiers (Vector4 sourceColorMask, bool enabled, float transitionAlpha)
 Modifies source color mask using transition alpha and color multiplier in case a control is disabled. More...
 
static bool CheckMouseOver (Vector2 size, Vector2 position, MyGuiDrawAlignEnum originAlign)
 
static bool IsPointInside (Vector2 queryPoint, Vector2 size, Vector2 position, MyGuiDrawAlignEnum originAlign)
 

Protected Member Functions

override void OnHasHighlightChanged ()
 
override void OnPositionChanged ()
 
override void OnOriginAlignChanged ()
 
Vector2 GetItemSize ()
 
- Protected Member Functions inherited from Sandbox.Graphics.GUI.MyGuiControlBase
 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)
 
void DrawBackground (float transitionAlpha)
 
void DrawBorder (float transitionAlpha)
 
virtual bool ShouldHaveHighlight ()
 
virtual void OnSizeChanged ()
 
virtual void OnVisibleChanged ()
 
virtual void OnEnabledChanged ()
 
virtual void OnColorMaskChanged ()
 
MyGuiScreenBase GetTopMostOwnerScreen ()
 
bool IsMouseOverOrKeyboardActive ()
 
virtual void DrawElements (float transitionAlpha, float backgroundTransitionAlpha)
 
MyGuiControlBase HandleInputElements ()
 
virtual void ClearEvents ()
 

Properties

MyGuiControlComboboxStyleEnum VisualStyle [get, set]
 
- Properties inherited from Sandbox.Graphics.GUI.MyGuiControlBase
float Alpha [get, set]
 
string Name [get, set]
 
IMyGuiControlsOwner Owner [get]
 
MyToolTips Tooltips [get]
 
Vector2 Position [get, set]
 Position of control's center (normalized and relative to parent screen center (not left/top corner!!!)) More...
 
float PositionY [get, set]
 
float PositionX [get, set]
 
Vector2 Size [get, set]
 Size of control (normalized). More...
 
Vector2 MinSize [get, protected set]
 
Vector2 MaxSize [get, protected set]
 
Vector4 ColorMask [get, set]
 
int BorderSize [get, set]
 
bool Enabled [get, set]
 False to disable control, disabled controls are skipped when switching with Tab key etc., look implemented atm. only in MyGuiControlButton. More...
 
MyGuiDrawAlignEnum OriginAlign [get, set]
 
bool Visible [get, set]
 Says whether control is visible. Note that this is not a constant time operation (checks parents, fires events on set). More...
 
bool HasHighlight [get]
 Says whether control is currently highlighted. When control is highlit depends on HighlightType. More...
 
bool HasFocus [get]
 
bool IsMouseOver [get, set]
 
bool CanHaveFocus [get, set]
 
bool AllowFocusingElements [get, set]
 Indicates whether elements can have focus or not. More...
 
object UserData [get, set]
 Specific user data for this control. More...
 
string DebugNamePath [get]
 
- Properties inherited from Sandbox.Graphics.GUI.IMyGuiControlsOwner
string DebugNamePath [get]
 
string Name [get]
 
IMyGuiControlsOwner Owner [get]
 

Events

ItemSelectedDelegate ItemSelected
 
- Events inherited from Sandbox.Graphics.GUI.MyGuiControlBase
Action< MyGuiControlBase, NameChangedArgsNameChanged
 
Action< MyGuiControlBaseSizeChanged
 
VisibleChangedDelegate VisibleChanged
 
Action< MyGuiControlBase, bool > FocusChanged
 Called when the control enters or leaves focus. More...
 

Additional Inherited Members

- Public Attributes inherited from Sandbox.Graphics.GUI.MyGuiControlBase
readonly MyGuiControls Elements
 
MyGuiCompositeTexture BackgroundTexture
 
Vector4 BorderColor
 
bool BorderEnabled
 
bool DrawWhilePaused
 
bool ShowTooltipWhenDisabled
 
bool IsActiveControl
 There are some controls, that cannot receive any handle input(control panel for example), thus disable them with this. More...
 
MyGuiControlHighlightType HighlightType
 
- Protected Attributes inherited from Sandbox.Graphics.GUI.MyGuiControlBase
bool m_mouseButtonPressed = false
 
bool m_showToolTip = false
 
Vector2 m_toolTipPosition
 

Detailed Description

Definition at line 22 of file MyGuiControlCombobox.cs.

Constructor & Destructor Documentation

Sandbox.Graphics.GUI.MyGuiControlCombobox.MyGuiControlCombobox ( )
inline

Definition at line 283 of file MyGuiControlCombobox.cs.

Sandbox.Graphics.GUI.MyGuiControlCombobox.MyGuiControlCombobox ( Vector2 position = null,
Vector2 size = null,
Vector4 backgroundColor = null,
Vector2 textOffset = null,
int  openAreaItemsCount = 10,
Vector2 iconSize = null,
bool  useScrollBarOffset = false,
String  toolTip = null,
MyGuiDrawAlignEnum  originAlign = MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER,
Vector4 textColor = null 
)
inline

Definition at line 285 of file MyGuiControlCombobox.cs.

Member Function Documentation

void Sandbox.Graphics.GUI.MyGuiControlCombobox.AddItem ( long  key,
MyStringId  value,
int?  sortOrder = null,
MyStringId toolTip = null 
)
inline

Definition at line 334 of file MyGuiControlCombobox.cs.

void Sandbox.Graphics.GUI.MyGuiControlCombobox.AddItem ( long  key,
StringBuilder  value,
int?  sortOrder = null,
String  toolTip = null 
)
inline

Definition at line 343 of file MyGuiControlCombobox.cs.

void Sandbox.Graphics.GUI.MyGuiControlCombobox.AddItem ( long  key,
String  value,
int?  sortOrder = null,
String  toolTip = null 
)
inline

Definition at line 357 of file MyGuiControlCombobox.cs.

void Sandbox.Graphics.GUI.MyGuiControlCombobox.ApplyStyle ( StyleDefinition  style)
inline

Definition at line 1171 of file MyGuiControlCombobox.cs.

override bool Sandbox.Graphics.GUI.MyGuiControlCombobox.CheckMouseOver ( )
inlinevirtual

Checks if mouse cursor is over control. GR: Update: Also check if mouse over parent controls. Slower but more solid implementation (and we get rid of a few bugs). Also there is no need for HandleMouse variable (removed)

Reimplemented from Sandbox.Graphics.GUI.MyGuiControlBase.

Definition at line 1108 of file MyGuiControlCombobox.cs.

void Sandbox.Graphics.GUI.MyGuiControlCombobox.ClearItems ( )
inline

Definition at line 323 of file MyGuiControlCombobox.cs.

void Sandbox.Graphics.GUI.MyGuiControlCombobox.CustomSortItems ( Comparison< Item comparison)
inline

Definition at line 434 of file MyGuiControlCombobox.cs.

override void Sandbox.Graphics.GUI.MyGuiControlCombobox.Draw ( float  transitionAlpha,
float  backgroundTransitionAlpha 
)
inlinevirtual

two phase draw(two SpriteBatch phase):

  1. combobox itself and selected item
  2. opened area and display items draw(if opened area is displayed) a. setup up and draw stencil area to stencil buffer for clipping b. enable stencil c. draw the display items d. disable stencil

Reimplemented from Sandbox.Graphics.GUI.MyGuiControlBase.

Definition at line 911 of file MyGuiControlCombobox.cs.

override MyGuiControlBase Sandbox.Graphics.GUI.MyGuiControlCombobox.GetExclusiveInputHandler ( )
inlinevirtual

Reimplemented from Sandbox.Graphics.GUI.MyGuiControlBase.

Definition at line 442 of file MyGuiControlCombobox.cs.

Item Sandbox.Graphics.GUI.MyGuiControlCombobox.GetItemByIndex ( int  index)
inline

Definition at line 387 of file MyGuiControlCombobox.cs.

int Sandbox.Graphics.GUI.MyGuiControlCombobox.GetItemsCount ( )
inline

Definition at line 418 of file MyGuiControlCombobox.cs.

Vector2 Sandbox.Graphics.GUI.MyGuiControlCombobox.GetItemSize ( )
inlineprotected

Definition at line 1103 of file MyGuiControlCombobox.cs.

int Sandbox.Graphics.GUI.MyGuiControlCombobox.GetSelectedIndex ( )
inline

Definition at line 489 of file MyGuiControlCombobox.cs.

long Sandbox.Graphics.GUI.MyGuiControlCombobox.GetSelectedKey ( )
inline

Definition at line 482 of file MyGuiControlCombobox.cs.

StringBuilder Sandbox.Graphics.GUI.MyGuiControlCombobox.GetSelectedValue ( )
inline

Definition at line 497 of file MyGuiControlCombobox.cs.

static StyleDefinition Sandbox.Graphics.GUI.MyGuiControlCombobox.GetVisualStyle ( MyGuiControlComboboxStyleEnum  style)
inlinestatic

Definition at line 114 of file MyGuiControlCombobox.cs.

override MyGuiControlBase Sandbox.Graphics.GUI.MyGuiControlCombobox.HandleInput ( )
inlinevirtual

Method returns true if input was captured by control, so no other controls, nor screen can use input in this update.

Reimplemented from Sandbox.Graphics.GUI.MyGuiControlBase.

Definition at line 524 of file MyGuiControlCombobox.cs.

delegate void Sandbox.Graphics.GUI.MyGuiControlCombobox.ItemSelectedDelegate ( )
override void Sandbox.Graphics.GUI.MyGuiControlCombobox.OnHasHighlightChanged ( )
inlineprotectedvirtual

Reimplemented from Sandbox.Graphics.GUI.MyGuiControlBase.

Definition at line 265 of file MyGuiControlCombobox.cs.

override void Sandbox.Graphics.GUI.MyGuiControlCombobox.OnOriginAlignChanged ( )
inlineprotectedvirtual

Reimplemented from Sandbox.Graphics.GUI.MyGuiControlBase.

Definition at line 277 of file MyGuiControlCombobox.cs.

override void Sandbox.Graphics.GUI.MyGuiControlCombobox.OnPositionChanged ( )
inlineprotectedvirtual

Reimplemented from Sandbox.Graphics.GUI.MyGuiControlBase.

Definition at line 271 of file MyGuiControlCombobox.cs.

void Sandbox.Graphics.GUI.MyGuiControlCombobox.RemoveItem ( long  key)
inline

Definition at line 371 of file MyGuiControlCombobox.cs.

void Sandbox.Graphics.GUI.MyGuiControlCombobox.RemoveItemByIndex ( int  index)
inline

Definition at line 377 of file MyGuiControlCombobox.cs.

void Sandbox.Graphics.GUI.MyGuiControlCombobox.ScrollToPreSelectedItem ( )
inline

Definition at line 1070 of file MyGuiControlCombobox.cs.

void Sandbox.Graphics.GUI.MyGuiControlCombobox.SelectItemByIndex ( int  index)
inline

Definition at line 448 of file MyGuiControlCombobox.cs.

void Sandbox.Graphics.GUI.MyGuiControlCombobox.SelectItemByKey ( long  key,
bool  sendEvent = true 
)
inline

Definition at line 463 of file MyGuiControlCombobox.cs.

override void Sandbox.Graphics.GUI.MyGuiControlCombobox.ShowToolTip ( )
inlinevirtual

Reimplemented from Sandbox.Graphics.GUI.MyGuiControlBase.

Definition at line 1160 of file MyGuiControlCombobox.cs.

void Sandbox.Graphics.GUI.MyGuiControlCombobox.SortItemsByValueText ( )
inline

Definition at line 423 of file MyGuiControlCombobox.cs.

Item Sandbox.Graphics.GUI.MyGuiControlCombobox.TryGetItemByKey ( long  key)
inline

Definition at line 410 of file MyGuiControlCombobox.cs.

Property Documentation

MyGuiControlComboboxStyleEnum Sandbox.Graphics.GUI.MyGuiControlCombobox.VisualStyle
getset

Definition at line 204 of file MyGuiControlCombobox.cs.

Event Documentation

ItemSelectedDelegate Sandbox.Graphics.GUI.MyGuiControlCombobox.ItemSelected

Definition at line 168 of file MyGuiControlCombobox.cs.


The documentation for this class was generated from the following file: