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

Classes

struct  ColoredIcon
 
struct  EventArgs
 
class  Item
 
class  StyleDefinition
 

Public Member Functions

 MyGuiControlGrid ()
 
override void Init (MyObjectBuilder_GuiControlBase objectBuilder)
 
override MyObjectBuilder_GuiControlBase GetObjectBuilder ()
 
void Add (Item item, int startingRow=0)
 Adds item to the first empty (null) position. More...
 
Item GetItemAt (int index)
 
bool IsValidIndex (int row, int col)
 
bool IsValidIndex (int index)
 
Item GetItemAt (int rowIdx, int colIdx)
 
void SetItemAt (int index, Item item)
 
void SetItemAt (int rowIdx, int colIdx, Item item)
 
void blinkSlot (int?slot)
 
void SetItemsToDefault ()
 Sets all items to default value (null). Note that this does not affect the number of items. More...
 
virtual void Clear ()
 Removes all items. This affects the size of the collection. More...
 
void TrimEmptyItems ()
 Removes items which are null (empty) from the end. Stops as soon as first non-empty item is found. More...
 
Item TryGetItemAt (int rowIdx, int colIdx)
 
Item TryGetItemAt (int itemIdx)
 
void SelectLastItem ()
 
void AddRows (int numberOfRows)
 
void RecalculateRowsCount ()
 
override void Draw (float transitionAlpha, float backgroundTransitionAlpha)
 
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 Update ()
 
override void ShowToolTip ()
 
int ComputeIndex (int row, int col)
 
void SetEmptyItemToolTip (String toolTip)
 
int GetItemsCount ()
 
- Public Member Functions inherited from Sandbox.Graphics.GUI.MyGuiControlBase
virtual MyGuiControlGridDragAndDrop GetDragAndDropHandlingNow ()
 
virtual MyGuiControlBase GetExclusiveInputHandler ()
 
virtual MyGuiControlBase GetMouseOverControl ()
 Returns first control, which has mouse over. More...
 
virtual void HideToolTip ()
 
virtual bool IsMouseOverAnyControl ()
 
virtual 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...
 
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)
 
override string ToString ()
 

Static Public Member Functions

static StyleDefinition GetVisualStyle (MyGuiControlGridStyleEnum 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)
 

Public Attributes

const int INVALID_INDEX = -1
 
Dictionary< int, ColorModalItems
 
string EmptyItemIcon
 
bool SelectionEnabled = true
 
bool ShowEmptySlots = true
 
- 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

RectangleF m_itemsRectangle
 
Vector2 m_itemStep
 
StyleDefinition m_styleDef
 
- Protected Attributes inherited from Sandbox.Graphics.GUI.MyGuiControlBase
bool m_mouseButtonPressed = false
 
bool m_showToolTip = false
 
Vector2 m_toolTipPosition
 

Properties

bool EnableSelectEmptyCell [get, set]
 
Vector2 ItemStep [get]
 
int ColumnsCount [get, set]
 
int RowsCount [get, set]
 
int MaxItemCount [get, set]
 
Vector2 ItemSize [get]
 
int MouseOverIndex [get]
 
Item MouseOverItem [get]
 
int SelectedIndex [get, set]
 
Item SelectedItem [get]
 
MyGuiControlGridStyleEnum VisualStyle [get, set]
 
float ItemTextScale [get]
 
float ItemTextScaleWithLanguage [get]
 
- 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

Action< MyGuiControlGrid, EventArgsItemChanged
 
Action< MyGuiControlGrid, EventArgsItemClicked
 
Action< MyGuiControlGrid, EventArgsItemReleased
 
Action< MyGuiControlGrid, EventArgsItemClickedWithoutDoubleClick
 
Action< MyGuiControlGrid, EventArgsItemDoubleClicked
 
Action< MyGuiControlGrid, EventArgsItemDragged
 
Action< MyGuiControlGrid, EventArgsItemSelected
 
Action< MyGuiControlGrid, EventArgsMouseOverIndexChanged
 
- 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

- 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 OnHasHighlightChanged ()
 
virtual void OnPositionChanged ()
 
virtual void OnSizeChanged ()
 
virtual void OnVisibleChanged ()
 
virtual void OnOriginAlignChanged ()
 
virtual void OnEnabledChanged ()
 
virtual void OnColorMaskChanged ()
 
MyGuiScreenBase GetTopMostOwnerScreen ()
 
bool IsMouseOverOrKeyboardActive ()
 
virtual void DrawElements (float transitionAlpha, float backgroundTransitionAlpha)
 
MyGuiControlBase HandleInputElements ()
 
virtual void ClearEvents ()
 

Detailed Description

Definition at line 15 of file MyGuiControlGrid.cs.

Constructor & Destructor Documentation

Sandbox.Graphics.GUI.MyGuiControlGrid.MyGuiControlGrid ( )
inline

Definition at line 281 of file MyGuiControlGrid.cs.

Member Function Documentation

void Sandbox.Graphics.GUI.MyGuiControlGrid.Add ( Item  item,
int  startingRow = 0 
)
inline

Adds item to the first empty (null) position.

Definition at line 489 of file MyGuiControlGrid.cs.

void Sandbox.Graphics.GUI.MyGuiControlGrid.AddRows ( int  numberOfRows)
inline

Definition at line 640 of file MyGuiControlGrid.cs.

void Sandbox.Graphics.GUI.MyGuiControlGrid.blinkSlot ( int?  slot)
inline

Definition at line 577 of file MyGuiControlGrid.cs.

virtual void Sandbox.Graphics.GUI.MyGuiControlGrid.Clear ( )
inlinevirtual

Removes all items. This affects the size of the collection.

Reimplemented from Sandbox.Graphics.GUI.MyGuiControlBase.

Reimplemented in Sandbox.Graphics.GUI.MyGuiControlLabeledGrid.

Definition at line 598 of file MyGuiControlGrid.cs.

int Sandbox.Graphics.GUI.MyGuiControlGrid.ComputeIndex ( int  row,
int  col 
)
inline

Definition at line 760 of file MyGuiControlGrid.cs.

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

Reimplemented from Sandbox.Graphics.GUI.MyGuiControlBase.

Reimplemented in Sandbox.Graphics.GUI.MyGuiControlLabeledGrid.

Definition at line 668 of file MyGuiControlGrid.cs.

Item Sandbox.Graphics.GUI.MyGuiControlGrid.GetItemAt ( int  index)
inline

Definition at line 512 of file MyGuiControlGrid.cs.

Item Sandbox.Graphics.GUI.MyGuiControlGrid.GetItemAt ( int  rowIdx,
int  colIdx 
)
inline

Definition at line 538 of file MyGuiControlGrid.cs.

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

Definition at line 1228 of file MyGuiControlGrid.cs.

override MyObjectBuilder_GuiControlBase Sandbox.Graphics.GUI.MyGuiControlGrid.GetObjectBuilder ( )
inlinevirtual

Reimplemented from Sandbox.Graphics.GUI.MyGuiControlBase.

Definition at line 312 of file MyGuiControlGrid.cs.

static StyleDefinition Sandbox.Graphics.GUI.MyGuiControlGrid.GetVisualStyle ( MyGuiControlGridStyleEnum  style)
inlinestatic

Definition at line 103 of file MyGuiControlGrid.cs.

override MyGuiControlBase Sandbox.Graphics.GUI.MyGuiControlGrid.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 678 of file MyGuiControlGrid.cs.

override void Sandbox.Graphics.GUI.MyGuiControlGrid.Init ( MyObjectBuilder_GuiControlBase  objectBuilder)
inlinevirtual

Reimplemented from Sandbox.Graphics.GUI.MyGuiControlBase.

Definition at line 301 of file MyGuiControlGrid.cs.

bool Sandbox.Graphics.GUI.MyGuiControlGrid.IsValidIndex ( int  row,
int  col 
)
inline

Definition at line 521 of file MyGuiControlGrid.cs.

bool Sandbox.Graphics.GUI.MyGuiControlGrid.IsValidIndex ( int  index)
inline

Definition at line 526 of file MyGuiControlGrid.cs.

void Sandbox.Graphics.GUI.MyGuiControlGrid.RecalculateRowsCount ( )
inline

Definition at line 660 of file MyGuiControlGrid.cs.

void Sandbox.Graphics.GUI.MyGuiControlGrid.SelectLastItem ( )
inline

Definition at line 635 of file MyGuiControlGrid.cs.

void Sandbox.Graphics.GUI.MyGuiControlGrid.SetEmptyItemToolTip ( String  toolTip)
inline

Definition at line 765 of file MyGuiControlGrid.cs.

void Sandbox.Graphics.GUI.MyGuiControlGrid.SetItemAt ( int  index,
Item  item 
)
inline

Definition at line 544 of file MyGuiControlGrid.cs.

void Sandbox.Graphics.GUI.MyGuiControlGrid.SetItemAt ( int  rowIdx,
int  colIdx,
Item  item 
)
inline

Definition at line 559 of file MyGuiControlGrid.cs.

void Sandbox.Graphics.GUI.MyGuiControlGrid.SetItemsToDefault ( )
inline

Sets all items to default value (null). Note that this does not affect the number of items.

Definition at line 587 of file MyGuiControlGrid.cs.

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

Reimplemented from Sandbox.Graphics.GUI.MyGuiControlBase.

Definition at line 741 of file MyGuiControlGrid.cs.

void Sandbox.Graphics.GUI.MyGuiControlGrid.TrimEmptyItems ( )
inline

Removes items which are null (empty) from the end. Stops as soon as first non-empty item is found.

Definition at line 609 of file MyGuiControlGrid.cs.

Item Sandbox.Graphics.GUI.MyGuiControlGrid.TryGetItemAt ( int  rowIdx,
int  colIdx 
)
inline

Definition at line 625 of file MyGuiControlGrid.cs.

Item Sandbox.Graphics.GUI.MyGuiControlGrid.TryGetItemAt ( int  itemIdx)
inline

Definition at line 630 of file MyGuiControlGrid.cs.

override void Sandbox.Graphics.GUI.MyGuiControlGrid.Update ( )
inlinevirtual

Reimplemented from Sandbox.Graphics.GUI.MyGuiControlBase.

Definition at line 734 of file MyGuiControlGrid.cs.

Member Data Documentation

string Sandbox.Graphics.GUI.MyGuiControlGrid.EmptyItemIcon

Definition at line 478 of file MyGuiControlGrid.cs.

const int Sandbox.Graphics.GUI.MyGuiControlGrid.INVALID_INDEX = -1

Definition at line 253 of file MyGuiControlGrid.cs.

RectangleF Sandbox.Graphics.GUI.MyGuiControlGrid.m_itemsRectangle
protected

Definition at line 265 of file MyGuiControlGrid.cs.

Vector2 Sandbox.Graphics.GUI.MyGuiControlGrid.m_itemStep
protected

Definition at line 266 of file MyGuiControlGrid.cs.

StyleDefinition Sandbox.Graphics.GUI.MyGuiControlGrid.m_styleDef
protected

Definition at line 458 of file MyGuiControlGrid.cs.

Dictionary<int, Color> Sandbox.Graphics.GUI.MyGuiControlGrid.ModalItems

Definition at line 276 of file MyGuiControlGrid.cs.

bool Sandbox.Graphics.GUI.MyGuiControlGrid.SelectionEnabled = true

Definition at line 480 of file MyGuiControlGrid.cs.

bool Sandbox.Graphics.GUI.MyGuiControlGrid.ShowEmptySlots = true

Definition at line 481 of file MyGuiControlGrid.cs.

Property Documentation

int Sandbox.Graphics.GUI.MyGuiControlGrid.ColumnsCount
getset

Definition at line 343 of file MyGuiControlGrid.cs.

bool Sandbox.Graphics.GUI.MyGuiControlGrid.EnableSelectEmptyCell
getset

Definition at line 255 of file MyGuiControlGrid.cs.

Vector2 Sandbox.Graphics.GUI.MyGuiControlGrid.ItemSize
get

Definition at line 385 of file MyGuiControlGrid.cs.

Vector2 Sandbox.Graphics.GUI.MyGuiControlGrid.ItemStep
get

Definition at line 338 of file MyGuiControlGrid.cs.

float Sandbox.Graphics.GUI.MyGuiControlGrid.ItemTextScale
get

Definition at line 462 of file MyGuiControlGrid.cs.

float Sandbox.Graphics.GUI.MyGuiControlGrid.ItemTextScaleWithLanguage
get

Definition at line 473 of file MyGuiControlGrid.cs.

int Sandbox.Graphics.GUI.MyGuiControlGrid.MaxItemCount
getset

Definition at line 371 of file MyGuiControlGrid.cs.

int Sandbox.Graphics.GUI.MyGuiControlGrid.MouseOverIndex
get

Definition at line 392 of file MyGuiControlGrid.cs.

Item Sandbox.Graphics.GUI.MyGuiControlGrid.MouseOverItem
get

Definition at line 411 of file MyGuiControlGrid.cs.

int Sandbox.Graphics.GUI.MyGuiControlGrid.RowsCount
getset

Definition at line 357 of file MyGuiControlGrid.cs.

int Sandbox.Graphics.GUI.MyGuiControlGrid.SelectedIndex
getset

Definition at line 416 of file MyGuiControlGrid.cs.

Item Sandbox.Graphics.GUI.MyGuiControlGrid.SelectedItem
get

Definition at line 444 of file MyGuiControlGrid.cs.

MyGuiControlGridStyleEnum Sandbox.Graphics.GUI.MyGuiControlGrid.VisualStyle
getset

Definition at line 449 of file MyGuiControlGrid.cs.

Event Documentation

Action<MyGuiControlGrid, EventArgs> Sandbox.Graphics.GUI.MyGuiControlGrid.ItemChanged

Definition at line 325 of file MyGuiControlGrid.cs.

Action<MyGuiControlGrid, EventArgs> Sandbox.Graphics.GUI.MyGuiControlGrid.ItemClicked

Definition at line 326 of file MyGuiControlGrid.cs.

Action<MyGuiControlGrid, EventArgs> Sandbox.Graphics.GUI.MyGuiControlGrid.ItemClickedWithoutDoubleClick

Definition at line 328 of file MyGuiControlGrid.cs.

Action<MyGuiControlGrid, EventArgs> Sandbox.Graphics.GUI.MyGuiControlGrid.ItemDoubleClicked

Definition at line 329 of file MyGuiControlGrid.cs.

Action<MyGuiControlGrid, EventArgs> Sandbox.Graphics.GUI.MyGuiControlGrid.ItemDragged

Definition at line 330 of file MyGuiControlGrid.cs.

Action<MyGuiControlGrid, EventArgs> Sandbox.Graphics.GUI.MyGuiControlGrid.ItemReleased

Definition at line 327 of file MyGuiControlGrid.cs.

Action<MyGuiControlGrid, EventArgs> Sandbox.Graphics.GUI.MyGuiControlGrid.ItemSelected

Definition at line 331 of file MyGuiControlGrid.cs.

Action<MyGuiControlGrid, EventArgs> Sandbox.Graphics.GUI.MyGuiControlGrid.MouseOverIndexChanged

Definition at line 332 of file MyGuiControlGrid.cs.


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