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

Classes

struct  ButtonIcon
 
class  StateDefinition
 
class  StyleDefinition
 

Public Member Functions

 MyGuiControlImageButton ()
 
 MyGuiControlImageButton (string name="Button", Vector2?position=null, Vector2?size=null, Vector4?colorMask=null, MyGuiDrawAlignEnum originAlign=MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, String toolTip=null, StringBuilder text=null, float textScale=MyGuiConstants.DEFAULT_TEXT_SCALE, MyGuiDrawAlignEnum textAlignment=MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, MyGuiControlHighlightType highlightType=MyGuiControlHighlightType.WHEN_ACTIVE, Action< MyGuiControlImageButton > onButtonClick=null, GuiSounds cueEnum=GuiSounds.MouseClick, float buttonScale=1.0f, int?buttonIndex=null, bool activateOnMouseRelease=false)
 
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 string GetMouseCursorTexture ()
 
override void Draw (float transitionAlpha, float backgroundTransitionAlpha)
 
override MyObjectBuilder_GuiControlBase GetObjectBuilder ()
 
override void Init (MyObjectBuilder_GuiControlBase objectBuilder)
 
void ApplyStyle (StyleDefinition style)
 
- 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 void ShowToolTip ()
 
virtual void Update ()
 
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...
 
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 ()
 

Public Attributes

bool Selected = false
 
MyGuiDrawAlignEnum TextAlignment = MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER
 
string TextFont
 
string CornerTextFont
 Corner text font. More...
 
float CornerTextSize
 Corner text size where 1.0f is the standard size. More...
 
bool DrawCrossTextureWhenDisabled = false
 
ButtonIcon Icon
 
- 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 Member Functions

void RaiseButtonClicked ()
 
override bool ShouldHaveHighlight ()
 
override void OnHasHighlightChanged ()
 
override void OnOriginAlignChanged ()
 
override void OnSizeChanged ()
 
- 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 void OnPositionChanged ()
 
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 ()
 

Protected Attributes

GuiSounds m_cueEnum
 
- Protected Attributes inherited from Sandbox.Graphics.GUI.MyGuiControlBase
bool m_mouseButtonPressed = false
 
bool m_showToolTip = false
 
Vector2 m_toolTipPosition
 

Properties

bool Checked [get, set]
 
bool ActivateOnMouseRelease [get, set]
 
MyKeys BoundKey [get, set]
 The key this button will respond to when pressed. Will act as an OnClick. MyKeys.None by default. More...
 
bool AllowBoundKey [get, set]
 Whether or not this button supports having a key bound to it. False by default. More...
 
int Index [get]
 
string Text [get, set]
 
MyStringId TextEnum [get, set]
 
string CornerText [get, set]
 Text visible in the bottom left corner. More...
 
GuiSounds CueEnum [get, set]
 
float TextScale [get, set]
 
float ButtonScale [get, set]
 
float TextScaleWithLanguage [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< MyGuiControlImageButtonButtonClicked
 
- 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

- 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)
 

Detailed Description

Definition at line 19 of file MyGuiControlImageButton.cs.

Constructor & Destructor Documentation

Sandbox.Gui.MyGuiControlImageButton.MyGuiControlImageButton ( )
inline

Definition at line 145 of file MyGuiControlImageButton.cs.

Sandbox.Gui.MyGuiControlImageButton.MyGuiControlImageButton ( string  name = "Button",
Vector2 position = null,
Vector2 size = null,
Vector4 colorMask = null,
MyGuiDrawAlignEnum  originAlign = MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER,
String  toolTip = null,
StringBuilder  text = null,
float  textScale = MyGuiConstants.DEFAULT_TEXT_SCALE,
MyGuiDrawAlignEnum  textAlignment = MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER,
MyGuiControlHighlightType  highlightType = MyGuiControlHighlightType.WHEN_ACTIVE,
Action< MyGuiControlImageButton onButtonClick = null,
GuiSounds  cueEnum = GuiSounds.MouseClick,
float  buttonScale = 1.0f,
int?  buttonIndex = null,
bool  activateOnMouseRelease = false 
)
inline

Definition at line 147 of file MyGuiControlImageButton.cs.

Member Function Documentation

void Sandbox.Gui.MyGuiControlImageButton.ApplyStyle ( StyleDefinition  style)
inline

Definition at line 521 of file MyGuiControlImageButton.cs.

override void Sandbox.Gui.MyGuiControlImageButton.Draw ( float  transitionAlpha,
float  backgroundTransitionAlpha 
)
inlinevirtual

Reimplemented from Sandbox.Graphics.GUI.MyGuiControlBase.

Definition at line 261 of file MyGuiControlImageButton.cs.

override string Sandbox.Gui.MyGuiControlImageButton.GetMouseCursorTexture ( )
inlinevirtual

Reimplemented from Sandbox.Graphics.GUI.MyGuiControlBase.

Definition at line 250 of file MyGuiControlImageButton.cs.

override MyObjectBuilder_GuiControlBase Sandbox.Gui.MyGuiControlImageButton.GetObjectBuilder ( )
inlinevirtual

Reimplemented from Sandbox.Graphics.GUI.MyGuiControlBase.

Definition at line 403 of file MyGuiControlImageButton.cs.

override MyGuiControlBase Sandbox.Gui.MyGuiControlImageButton.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 200 of file MyGuiControlImageButton.cs.

override void Sandbox.Gui.MyGuiControlImageButton.Init ( MyObjectBuilder_GuiControlBase  objectBuilder)
inlinevirtual

Reimplemented from Sandbox.Graphics.GUI.MyGuiControlBase.

Definition at line 416 of file MyGuiControlImageButton.cs.

override void Sandbox.Gui.MyGuiControlImageButton.OnHasHighlightChanged ( )
inlineprotectedvirtual

Reimplemented from Sandbox.Graphics.GUI.MyGuiControlBase.

Definition at line 439 of file MyGuiControlImageButton.cs.

override void Sandbox.Gui.MyGuiControlImageButton.OnOriginAlignChanged ( )
inlineprotectedvirtual

Reimplemented from Sandbox.Graphics.GUI.MyGuiControlBase.

Definition at line 445 of file MyGuiControlImageButton.cs.

override void Sandbox.Gui.MyGuiControlImageButton.OnSizeChanged ( )
inlineprotectedvirtual

Reimplemented from Sandbox.Graphics.GUI.MyGuiControlBase.

Definition at line 451 of file MyGuiControlImageButton.cs.

void Sandbox.Gui.MyGuiControlImageButton.RaiseButtonClicked ( )
inlineprotected

Definition at line 255 of file MyGuiControlImageButton.cs.

override bool Sandbox.Gui.MyGuiControlImageButton.ShouldHaveHighlight ( )
inlineprotectedvirtual

Reimplemented from Sandbox.Graphics.GUI.MyGuiControlBase.

Definition at line 431 of file MyGuiControlImageButton.cs.

Member Data Documentation

string Sandbox.Gui.MyGuiControlImageButton.CornerTextFont

Corner text font.

Definition at line 391 of file MyGuiControlImageButton.cs.

float Sandbox.Gui.MyGuiControlImageButton.CornerTextSize

Corner text size where 1.0f is the standard size.

Definition at line 396 of file MyGuiControlImageButton.cs.

bool Sandbox.Gui.MyGuiControlImageButton.DrawCrossTextureWhenDisabled = false

Definition at line 398 of file MyGuiControlImageButton.cs.

ButtonIcon Sandbox.Gui.MyGuiControlImageButton.Icon

Definition at line 400 of file MyGuiControlImageButton.cs.

GuiSounds Sandbox.Gui.MyGuiControlImageButton.m_cueEnum
protected

Definition at line 98 of file MyGuiControlImageButton.cs.

bool Sandbox.Gui.MyGuiControlImageButton.Selected = false

Definition at line 116 of file MyGuiControlImageButton.cs.

MyGuiDrawAlignEnum Sandbox.Gui.MyGuiControlImageButton.TextAlignment = MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER

Definition at line 384 of file MyGuiControlImageButton.cs.

string Sandbox.Gui.MyGuiControlImageButton.TextFont

Definition at line 386 of file MyGuiControlImageButton.cs.

Property Documentation

bool Sandbox.Gui.MyGuiControlImageButton.ActivateOnMouseRelease
getset

Definition at line 108 of file MyGuiControlImageButton.cs.

bool Sandbox.Gui.MyGuiControlImageButton.AllowBoundKey
getset

Whether or not this button supports having a key bound to it. False by default.

Definition at line 136 of file MyGuiControlImageButton.cs.

MyKeys Sandbox.Gui.MyGuiControlImageButton.BoundKey
getset

The key this button will respond to when pressed. Will act as an OnClick. MyKeys.None by default.

Definition at line 126 of file MyGuiControlImageButton.cs.

float Sandbox.Gui.MyGuiControlImageButton.ButtonScale
getsetprotected

Definition at line 371 of file MyGuiControlImageButton.cs.

bool Sandbox.Gui.MyGuiControlImageButton.Checked
getset

Definition at line 102 of file MyGuiControlImageButton.cs.

string Sandbox.Gui.MyGuiControlImageButton.CornerText
getset

Text visible in the bottom left corner.

Definition at line 345 of file MyGuiControlImageButton.cs.

GuiSounds Sandbox.Gui.MyGuiControlImageButton.CueEnum
getset

Definition at line 355 of file MyGuiControlImageButton.cs.

int Sandbox.Gui.MyGuiControlImageButton.Index
get

Definition at line 319 of file MyGuiControlImageButton.cs.

string Sandbox.Gui.MyGuiControlImageButton.Text
getset

Definition at line 322 of file MyGuiControlImageButton.cs.

MyStringId Sandbox.Gui.MyGuiControlImageButton.TextEnum
getset

Definition at line 332 of file MyGuiControlImageButton.cs.

float Sandbox.Gui.MyGuiControlImageButton.TextScale
getset

Definition at line 361 of file MyGuiControlImageButton.cs.

float Sandbox.Gui.MyGuiControlImageButton.TextScaleWithLanguage
get

Definition at line 379 of file MyGuiControlImageButton.cs.

Event Documentation

Action<MyGuiControlImageButton> Sandbox.Gui.MyGuiControlImageButton.ButtonClicked

Definition at line 89 of file MyGuiControlImageButton.cs.


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