C# Class MediaPortal.GUI.Library.GUIButtonControl

The class implementing a GUIButton.
Inheritance: GUIControl
Show file Open project: MediaPortal/MediaPortal-1 Class Usage Examples

Protected Properties

Property Type Description
_frameCounter int
_hoverImage GUIAnimation
_imageFocused GUIAnimation
_imageNonFocused GUIAnimation
_labelControl GUIControl

Public Methods

Method Description
AllocResources ( ) : void

Allocates the control its DirectX resources.

Dispose ( ) : void

Frees the control its DirectX resources.

FinalizeConstruction ( ) : void

This method gets called when the control is created and all properties has been set It allows the control to do any initialization

GUIButtonControl ( int dwParentID ) : System.Diagnostics
GUIButtonControl ( int dwParentID, int dwControlId, int dwPosX, int dwPosY, int dwWidth, int dwHeight, long ltextColor, long ltextcolorNoFocus, string strTextureFocus, string strTextureNoFocus, int dwShadowAngle, int dwShadowDistance, long dwShadowColor ) : System.Diagnostics
GUIButtonControl ( int dwParentID, int dwControlId, int dwPosX, int dwPosY, int dwWidth, int dwHeight, string strTextureFocus, string strTextureNoFocus, int dwShadowAngle, int dwShadowDistance, long dwShadowColor ) : System.Diagnostics

The constructor of the GUIButtonControl class.

OnAction ( MediaPortal.GUI.Library.Action action ) : void

OnAction() method. This method gets called when there's a new action like a keypress or mousemove or... By overriding this method, the control can respond to any action

OnMessage ( GUIMessage message ) : bool

OnMessage() This method gets called when there's a new message. Controls send messages to notify their parents about their state (changes) By overriding this method a control can respond to the messages of its controls

PreAllocResources ( ) : void

Preallocates the control its DirectX resources.

Refresh ( ) : void
Render ( float timePassed ) : void

Renders the GUIButtonControl.

ScaleToScreenResolution ( ) : void

This method gets called when the control is created and all properties has been set It allows the control to scale itself to the current screen resolution

SetAlpha ( int dwAlpha ) : void

Changes the alpha transparency component of the colordiffuse.

SetBorderH ( string border, GUIImage position, bool repeat, bool rotate, string texture, long colorKey, bool hasCorners, bool cornerRotate ) : void
SetBorderTF ( string border, GUIImage position, bool repeat, bool rotate, string texture, long colorKey, bool hasCorners, bool cornerRotate ) : void
SetBorderTNF ( string border, GUIImage position, bool repeat, bool rotate, string texture, long colorKey, bool hasCorners, bool cornerRotate ) : void
SetFocusedTextureMask ( string mask ) : void
SetHoverTextureMask ( string mask ) : void
SetLabel ( string strFontName, string strLabel, long dwColor ) : void

Set the text of the GUIButtonControl.

SetNonFocusedTextureMask ( string mask ) : void
SetOverlayH ( string overlay ) : void
SetOverlayTF ( string overlay ) : void
SetOverlayTNF ( string overlay ) : void
SetPosition ( int dwPosX, int dwPosY ) : void

Sets the position of the control.

Protected Methods

Method Description
Update ( ) : void

Perform an update after a change has occured. E.g. change to a new position.

Private Methods

Method Description
DoContextMenu ( ) : void

Method Details

AllocResources() public method

Allocates the control its DirectX resources.
public AllocResources ( ) : void
return void

Dispose() public method

Frees the control its DirectX resources.
public Dispose ( ) : void
return void

FinalizeConstruction() public method

This method gets called when the control is created and all properties has been set It allows the control to do any initialization
public FinalizeConstruction ( ) : void
return void

GUIButtonControl() public method

public GUIButtonControl ( int dwParentID ) : System.Diagnostics
dwParentID int
return System.Diagnostics

GUIButtonControl() public method

public GUIButtonControl ( int dwParentID, int dwControlId, int dwPosX, int dwPosY, int dwWidth, int dwHeight, long ltextColor, long ltextcolorNoFocus, string strTextureFocus, string strTextureNoFocus, int dwShadowAngle, int dwShadowDistance, long dwShadowColor ) : System.Diagnostics
dwParentID int
dwControlId int
dwPosX int
dwPosY int
dwWidth int
dwHeight int
ltextColor long
ltextcolorNoFocus long
strTextureFocus string
strTextureNoFocus string
dwShadowAngle int
dwShadowDistance int
dwShadowColor long
return System.Diagnostics

GUIButtonControl() public method

The constructor of the GUIButtonControl class.
public GUIButtonControl ( int dwParentID, int dwControlId, int dwPosX, int dwPosY, int dwWidth, int dwHeight, string strTextureFocus, string strTextureNoFocus, int dwShadowAngle, int dwShadowDistance, long dwShadowColor ) : System.Diagnostics
dwParentID int The parent of this control.
dwControlId int The ID of this control.
dwPosX int The X position of this control.
dwPosY int The Y position of this control.
dwWidth int The width of this control.
dwHeight int The height of this control.
strTextureFocus string The filename containing the texture of the butten, when the button has the focus.
strTextureNoFocus string The filename containing the texture of the butten, when the button does not have the focus.
dwShadowAngle int The angle of the shadow; zero degress along x-axis.
dwShadowDistance int The distance of the shadow.
dwShadowColor long The color of the shadow.
return System.Diagnostics

OnAction() public method

OnAction() method. This method gets called when there's a new action like a keypress or mousemove or... By overriding this method, the control can respond to any action
public OnAction ( MediaPortal.GUI.Library.Action action ) : void
action MediaPortal.GUI.Library.Action action : contains the action
return void

OnMessage() public method

OnMessage() This method gets called when there's a new message. Controls send messages to notify their parents about their state (changes) By overriding this method a control can respond to the messages of its controls
public OnMessage ( GUIMessage message ) : bool
message GUIMessage message : contains the message
return bool

PreAllocResources() public method

Preallocates the control its DirectX resources.
public PreAllocResources ( ) : void
return void

Refresh() public method

public Refresh ( ) : void
return void

Render() public method

Renders the GUIButtonControl.
public Render ( float timePassed ) : void
timePassed float
return void

ScaleToScreenResolution() public method

This method gets called when the control is created and all properties has been set It allows the control to scale itself to the current screen resolution
public ScaleToScreenResolution ( ) : void
return void

SetAlpha() public method

Changes the alpha transparency component of the colordiffuse.
public SetAlpha ( int dwAlpha ) : void
dwAlpha int The new value of the colordiffuse.
return void

SetBorderH() public method

public SetBorderH ( string border, GUIImage position, bool repeat, bool rotate, string texture, long colorKey, bool hasCorners, bool cornerRotate ) : void
border string
position GUIImage
repeat bool
rotate bool
texture string
colorKey long
hasCorners bool
cornerRotate bool
return void

SetBorderTF() public method

public SetBorderTF ( string border, GUIImage position, bool repeat, bool rotate, string texture, long colorKey, bool hasCorners, bool cornerRotate ) : void
border string
position GUIImage
repeat bool
rotate bool
texture string
colorKey long
hasCorners bool
cornerRotate bool
return void

SetBorderTNF() public method

public SetBorderTNF ( string border, GUIImage position, bool repeat, bool rotate, string texture, long colorKey, bool hasCorners, bool cornerRotate ) : void
border string
position GUIImage
repeat bool
rotate bool
texture string
colorKey long
hasCorners bool
cornerRotate bool
return void

SetFocusedTextureMask() public method

public SetFocusedTextureMask ( string mask ) : void
mask string
return void

SetHoverTextureMask() public method

public SetHoverTextureMask ( string mask ) : void
mask string
return void

SetLabel() public method

Set the text of the GUIButtonControl.
public SetLabel ( string strFontName, string strLabel, long dwColor ) : void
strFontName string The font name.
strLabel string The text.
dwColor long The font color.
return void

SetNonFocusedTextureMask() public method

public SetNonFocusedTextureMask ( string mask ) : void
mask string
return void

SetOverlayH() public method

public SetOverlayH ( string overlay ) : void
overlay string
return void

SetOverlayTF() public method

public SetOverlayTF ( string overlay ) : void
overlay string
return void

SetOverlayTNF() public method

public SetOverlayTNF ( string overlay ) : void
overlay string
return void

SetPosition() public method

Sets the position of the control.
public SetPosition ( int dwPosX, int dwPosY ) : void
dwPosX int The X position.
dwPosY int The Y position.
return void

Update() protected method

Perform an update after a change has occured. E.g. change to a new position.
protected Update ( ) : void
return void

Property Details

_frameCounter protected property

protected int _frameCounter
return int

_hoverImage protected property

protected GUIAnimation,MediaPortal.GUI.Library _hoverImage
return GUIAnimation

_imageFocused protected property

protected GUIAnimation,MediaPortal.GUI.Library _imageFocused
return GUIAnimation

_imageNonFocused protected property

protected GUIAnimation,MediaPortal.GUI.Library _imageNonFocused
return GUIAnimation

_labelControl protected property

protected GUIControl,MediaPortal.GUI.Library _labelControl
return GUIControl