C# Class MediaPortal.GUI.Library.GUIControl

Base class for GUIControls.
Inheritance: GUIBaseControl, IDisposable
Afficher le fichier Open project: MediaPortal/MediaPortal-1 Class Usage Examples

Protected Properties

Свойство Type Description
_calibration bool
_data object
_isAnimating bool
_isDimmed bool
_isSelected bool
_originalDiffuseColor long
_originalRectangle Rectangle
_parentControl GUIControl
_parentControlId int
_selectedItem int
_subItemList ArrayList
_windowId int

Private Properties

Свойство Type Description
CalcBearing double
CalcDistance double
FlattenHierarchy System.Collections.ArrayList
FlattenHierarchy void
FreeResources void
Navigate int
UpdateStates void

Méthodes publiques

Méthode Description
AddAnimations ( List animations ) : void
AddItemLabelControl ( int iWindowId, int iControlId, string strLabel ) : void

Sends a GUI_MSG_LABEL_ADD message to a control (Add an ItemLabel to a control).

AddListItemControl ( int iWindowId, int iControlId, GUIListItem item ) : void

Sends a GUI_MSG_LABEL_ADD message to a control (Add a ListItem to a control).

AddSubItem ( object obj ) : void

Add an subitem to a control

AllocResources ( ) : void

Allocates the control its DirectX resources.

Animate ( float timePassed, MediaPortal.GUI.Library.Animator animator ) : void

Method to get animate the current control

CanFocus ( ) : bool

Checks if the control can focus.

ClearControl ( int iWindowId, int iControlId ) : void

Sends a GUI_MSG_LABEL_RESET message to a control (Clears a control).

DeSelectControl ( int iWindowId, int iControlId ) : void

Sends a GUI_MSG_DESELECTED message to a control (Deselect a control).

DisableControl ( int iWindowId, int iControlId ) : void

Sends a GUI_MSG_DISABLED message to a control (Disables a control).

Dispose ( ) : void

Frees the control its DirectX resources.

DoRender ( float timePassed, uint currentTime ) : void
DoUpdate ( ) : void
EnableControl ( int iWindowId, int iControlId ) : void

Sends a GUI_MSG_ENABLED message to a control (Enables a control).

FinalizeConstruction ( ) : void

This function is called after all of the XmlSkinnable fields have been filled with appropriate data. Use this to do any construction work other than simple data member assignments, for example, initializing new reference types, extra calculations, etc..

FocusControl ( int iWindowId, int iControlId ) : void

Sends a GUI_MSG_SETFOCUS message to a control (Set the focus on a control).

FocusControl ( int iWindowId, int iControlId, Direction direction ) : void
FocusItemControl ( int iWindowId, int iControlId, int iItem ) : void

Sends a GUI_MSG_ITEM_FOCUS message to a control (set item in control to selected state).

GUIControl ( ) : System

empty constructor

GUIControl ( int dwParentID ) : System

The basic constructur of the GUIControl class.

GUIControl ( int dwParentID, int dwControlId, int dwPosX, int dwPosY, int dwWidth, int dwHeight ) : System

The constructor of the GUIControl class.

GetAnimation ( AnimationType type, bool checkConditions ) : VisualEffect
GetAnimations ( AnimationType type, bool checkConditions ) : List
GetCenter ( float &centerX, float &centerY ) : void
GetControlById ( int ID ) : GUIControl

Property to get the control for a specific control ID

GetItemCount ( int lWindowId, int iControlId ) : int

Sends a GUI_MSG_ITEMS message to a control (Gets the number of Items in a control).

GetListItem ( int lWindowId, int iControlId, int iItem ) : GUIListItem

Sends a GUI_MSG_GET_ITEM message to a control (Gets a GUIListItem based on the lWindowId, iControlId, iItem parameters).

GetRect ( int &x, int &y, int &width, int &height ) : void

Method to get the rectangle of the current control

GetSelectedListItem ( int lWindowId, int iControlId ) : GUIListItem

Sends a GUI_MSG_GET_SELECTED_ITEM message to a control (Gets the selected GUIListItem based on the lWindowId, iControlId).

GetSubItem ( int index ) : object

Property to get a subitem

GetVisibleCondition ( ) : int
HideControl ( int iWindowId, int iControlId ) : void

Sends a GUI_MSG_HIDDEN message to a control (Hide a control).

HitTest ( int x, int y, int &controlID, bool &focused ) : bool

Checks if the x and y coordinates correspond to the current control.

InControl ( int x, int y, int &controlID ) : bool

Method which determines of the coordinate(x,y) is within the current control

IsEffectAnimating ( AnimationType animType ) : bool
LoadAnimationControl ( int parentID, int controlId, int posX, int posY, int width, int height, string texture ) : GUIAnimation
LoadControl ( string xmlFilename ) : List
NeedRefresh ( ) : bool

NeedRefresh() can be called to see if the control needs 2 redraw itself or not some controls (for example the fadelabel) contain scrolling texts and need 2 ne re-rendered constantly

OnAction ( 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

OnDeInit ( ) : void

Virtual method. This method gets called when the control is de-initialized and allows it to do any de-initalization

OnInit ( ) : void

Virtual method. This method gets called when the control is initialized and allows it to do any initalization

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.

QueueAnimation ( AnimationType animType ) : void
ReStorePosition ( ) : void

Method to restore the saved-current control rectangle

RefreshControl ( int iWindowId, int iControlId ) : void
RemoveSubItem ( int index ) : void

Remove an subitem from an control

RemoveSubItem ( object obj ) : void

Remove an subitem from an control

Render ( float timePassed ) : void

The default render method. This needs to be overwritten when inherited to give every control its specific look and feel.

ResetAnimations ( ) : void
ScaleToScreenResolution ( ) : void

Does any scaling on the inital size\position values to fit them to screen resolution.

SelectControl ( int iWindowId, int iControlId ) : void

Sends a GUI_MSG_SELECTED message to a control (Select a control).

SelectItemControl ( int iWindowId, int iControlId, int iItem ) : void

Sends a GUI_MSG_ITEM_SELECT message to a control (Select an item in a control).

SetAlpha ( int dwAlpha ) : void

Changes the alpha transparency component of the colordiffuse.

SetAnimations ( List animations ) : void
SetControlLabel ( int iWindowId, int iControlId, string strText ) : void

Sends a GUI_MSG_LABEL_SET message to a control (Set the label of a control).

SetInitialVisibility ( ) : void
SetNavigation ( int dwUp, int dwDown, int dwLeft, int dwRight ) : void

Set the up/down/left/right control

SetPosition ( int dwPosX, int dwPosY ) : void

Sets the position of the control.

SetSubItem ( int index, object o ) : void

Property to set an subitem

SetThumbAnimations ( List animations ) : void
SetVisibleCondition ( int visible, bool allowHiddenFocus ) : void
ShowControl ( int iWindowId, int iControlId ) : void

Sends a GUI_MSG_VISIBLE message to a control (Make a control visible).

StorePosition ( ) : void

Method to store(save) the current control rectangle

UnfocusControl ( int iWindowId, int iControlId ) : void

Sends a GUI_MSG_LOSTFOCUS message to a control (Set the focus on a control).

UpdateVisibility ( ) : void
getTransformMatrix ( uint currentTime ) : TransformMatrix

Méthodes protégées

Méthode Description
OnFocus ( ) : void
Update ( ) : void

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

Private Methods

Méthode Description
CalcBearing ( Drawing p1, Drawing p2 ) : double
CalcDistance ( Drawing p2, Drawing p1 ) : double
FlattenHierarchy ( ICollection elements ) : ArrayList
FlattenHierarchy ( ICollection collection, ArrayList targetList ) : void
FreeResources ( ) : void
Navigate ( Direction direction ) : int
UpdateStates ( AnimationType type, AnimationProcess currentProcess, AnimationState currentState ) : void

Method Details

AddAnimations() public méthode

public AddAnimations ( List animations ) : void
animations List
Résultat void

AddItemLabelControl() public static méthode

Sends a GUI_MSG_LABEL_ADD message to a control (Add an ItemLabel to a control).
public static AddItemLabelControl ( int iWindowId, int iControlId, string strLabel ) : void
iWindowId int The SenderId.
iControlId int The target control.
strLabel string The text of the label that needs to be added.
Résultat void

AddListItemControl() public static méthode

Sends a GUI_MSG_LABEL_ADD message to a control (Add a ListItem to a control).
public static AddListItemControl ( int iWindowId, int iControlId, GUIListItem item ) : void
iWindowId int The SenderId.
iControlId int The target control.
item GUIListItem The item that needs to be added to the ListControl
Résultat void

AddSubItem() public méthode

Add an subitem to a control
public AddSubItem ( object obj ) : void
obj object subitem
Résultat void

AllocResources() public méthode

Allocates the control its DirectX resources.
public AllocResources ( ) : void
Résultat void

Animate() public méthode

Method to get animate the current control
public Animate ( float timePassed, MediaPortal.GUI.Library.Animator animator ) : void
timePassed float
animator MediaPortal.GUI.Library.Animator
Résultat void

CanFocus() public méthode

Checks if the control can focus.
public CanFocus ( ) : bool
Résultat bool

ClearControl() public static méthode

Sends a GUI_MSG_LABEL_RESET message to a control (Clears a control).
public static ClearControl ( int iWindowId, int iControlId ) : void
iWindowId int The SenderId.
iControlId int The target control.
Résultat void

DeSelectControl() public static méthode

Sends a GUI_MSG_DESELECTED message to a control (Deselect a control).
public static DeSelectControl ( int iWindowId, int iControlId ) : void
iWindowId int The SenderId.
iControlId int The target control.
Résultat void

DisableControl() public static méthode

Sends a GUI_MSG_DISABLED message to a control (Disables a control).
public static DisableControl ( int iWindowId, int iControlId ) : void
iWindowId int The SenderId.
iControlId int The target control.
Résultat void

Dispose() public méthode

Frees the control its DirectX resources.
public Dispose ( ) : void
Résultat void

DoRender() public méthode

public DoRender ( float timePassed, uint currentTime ) : void
timePassed float
currentTime uint
Résultat void

DoUpdate() public méthode

public DoUpdate ( ) : void
Résultat void

EnableControl() public static méthode

Sends a GUI_MSG_ENABLED message to a control (Enables a control).
public static EnableControl ( int iWindowId, int iControlId ) : void
iWindowId int The SenderId.
iControlId int The target control.
Résultat void

FinalizeConstruction() public méthode

This function is called after all of the XmlSkinnable fields have been filled with appropriate data. Use this to do any construction work other than simple data member assignments, for example, initializing new reference types, extra calculations, etc..
public FinalizeConstruction ( ) : void
Résultat void

FocusControl() public static méthode

Sends a GUI_MSG_SETFOCUS message to a control (Set the focus on a control).
public static FocusControl ( int iWindowId, int iControlId ) : void
iWindowId int The SenderId.
iControlId int The target control.
Résultat void

FocusControl() public static méthode

public static FocusControl ( int iWindowId, int iControlId, Direction direction ) : void
iWindowId int
iControlId int
direction Direction
Résultat void

FocusItemControl() public static méthode

Sends a GUI_MSG_ITEM_FOCUS message to a control (set item in control to selected state).
public static FocusItemControl ( int iWindowId, int iControlId, int iItem ) : void
iWindowId int The SenderId.
iControlId int The target control.
iItem int The id of the item that should have the selected state.
Résultat void

GUIControl() public méthode

empty constructor
public GUIControl ( ) : System
Résultat System

GUIControl() public méthode

The basic constructur of the GUIControl class.
public GUIControl ( int dwParentID ) : System
dwParentID int
Résultat System

GUIControl() public méthode

The constructor of the GUIControl class.
public GUIControl ( int dwParentID, int dwControlId, int dwPosX, int dwPosY, int dwWidth, int dwHeight ) : System
dwParentID int The id of the parent control.
dwControlId int The id of this control.
dwPosX int The X position on the screen of this control.
dwPosY int The Y position on the screen of this control.
dwWidth int The width of this control.
dwHeight int The height of this control.
Résultat System

GetAnimation() public méthode

public GetAnimation ( AnimationType type, bool checkConditions ) : VisualEffect
type AnimationType
checkConditions bool
Résultat VisualEffect

GetAnimations() public méthode

public GetAnimations ( AnimationType type, bool checkConditions ) : List
type AnimationType
checkConditions bool
Résultat List

GetCenter() public méthode

public GetCenter ( float &centerX, float &centerY ) : void
centerX float
centerY float
Résultat void

GetControlById() public méthode

Property to get the control for a specific control ID
public GetControlById ( int ID ) : GUIControl
ID int Id of wanted control
Résultat GUIControl

GetItemCount() public static méthode

Sends a GUI_MSG_ITEMS message to a control (Gets the number of Items in a control).
public static GetItemCount ( int lWindowId, int iControlId ) : int
lWindowId int
iControlId int The target control.
Résultat int

GetListItem() public static méthode

Sends a GUI_MSG_GET_ITEM message to a control (Gets a GUIListItem based on the lWindowId, iControlId, iItem parameters).
public static GetListItem ( int lWindowId, int iControlId, int iItem ) : GUIListItem
lWindowId int
iControlId int The target control.
iItem int The item id of the item that needs to be returned.
Résultat GUIListItem

GetRect() public méthode

Method to get the rectangle of the current control
public GetRect ( int &x, int &y, int &width, int &height ) : void
x int
y int
width int
height int
Résultat void

GetSelectedListItem() public static méthode

Sends a GUI_MSG_GET_SELECTED_ITEM message to a control (Gets the selected GUIListItem based on the lWindowId, iControlId).
public static GetSelectedListItem ( int lWindowId, int iControlId ) : GUIListItem
lWindowId int
iControlId int The target control.
Résultat GUIListItem

GetSubItem() public méthode

Property to get a subitem
public GetSubItem ( int index ) : object
index int index
Résultat object

GetVisibleCondition() public méthode

public GetVisibleCondition ( ) : int
Résultat int

HideControl() public static méthode

Sends a GUI_MSG_HIDDEN message to a control (Hide a control).
public static HideControl ( int iWindowId, int iControlId ) : void
iWindowId int The SenderId.
iControlId int The target control.
Résultat void

HitTest() public méthode

Checks if the x and y coordinates correspond to the current control.
public HitTest ( int x, int y, int &controlID, bool &focused ) : bool
x int The x coordinate.
y int The y coordinate.
controlID int
focused bool
Résultat bool

InControl() public méthode

Method which determines of the coordinate(x,y) is within the current control
public InControl ( int x, int y, int &controlID ) : bool
x int x coordinate
y int y coordiate
controlID int return id of control if coordinate is within control
Résultat bool

IsEffectAnimating() public méthode

public IsEffectAnimating ( AnimationType animType ) : bool
animType AnimationType
Résultat bool

LoadAnimationControl() public méthode

public LoadAnimationControl ( int parentID, int controlId, int posX, int posY, int width, int height, string texture ) : GUIAnimation
parentID int
controlId int
posX int
posY int
width int
height int
texture string
Résultat GUIAnimation

LoadControl() public méthode

public LoadControl ( string xmlFilename ) : List
xmlFilename string
Résultat List

NeedRefresh() public méthode

NeedRefresh() can be called to see if the control needs 2 redraw itself or not some controls (for example the fadelabel) contain scrolling texts and need 2 ne re-rendered constantly
public NeedRefresh ( ) : bool
Résultat bool

OnAction() public méthode

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 ( Action action ) : void
action Action action : contains the action
Résultat void

OnDeInit() public méthode

Virtual method. This method gets called when the control is de-initialized and allows it to do any de-initalization
public OnDeInit ( ) : void
Résultat void

OnFocus() protected méthode

protected OnFocus ( ) : void
Résultat void

OnInit() public méthode

Virtual method. This method gets called when the control is initialized and allows it to do any initalization
public OnInit ( ) : void
Résultat void

OnMessage() public méthode

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
Résultat bool

PreAllocResources() public méthode

Preallocates the control its DirectX resources.
public PreAllocResources ( ) : void
Résultat void

QueueAnimation() public méthode

public QueueAnimation ( AnimationType animType ) : void
animType AnimationType
Résultat void

ReStorePosition() public méthode

Method to restore the saved-current control rectangle
public ReStorePosition ( ) : void
Résultat void

RefreshControl() public static méthode

public static RefreshControl ( int iWindowId, int iControlId ) : void
iWindowId int
iControlId int
Résultat void

RemoveSubItem() public méthode

Remove an subitem from an control
public RemoveSubItem ( int index ) : void
index int
Résultat void

RemoveSubItem() public méthode

Remove an subitem from an control
public RemoveSubItem ( object obj ) : void
obj object subitem
Résultat void

Render() public méthode

The default render method. This needs to be overwritten when inherited to give every control its specific look and feel.
public Render ( float timePassed ) : void
timePassed float
Résultat void

ResetAnimations() public méthode

public ResetAnimations ( ) : void
Résultat void

ScaleToScreenResolution() public méthode

Does any scaling on the inital size\position values to fit them to screen resolution.
public ScaleToScreenResolution ( ) : void
Résultat void

SelectControl() public static méthode

Sends a GUI_MSG_SELECTED message to a control (Select a control).
public static SelectControl ( int iWindowId, int iControlId ) : void
iWindowId int The SenderId.
iControlId int The target control.
Résultat void

SelectItemControl() public static méthode

Sends a GUI_MSG_ITEM_SELECT message to a control (Select an item in a control).
public static SelectItemControl ( int iWindowId, int iControlId, int iItem ) : void
iWindowId int The SenderId.
iControlId int The target control.
iItem int The id of the item that is selected on the control.
Résultat void

SetAlpha() public méthode

Changes the alpha transparency component of the colordiffuse.
public SetAlpha ( int dwAlpha ) : void
dwAlpha int
Résultat void

SetAnimations() public méthode

public SetAnimations ( List animations ) : void
animations List
Résultat void

SetControlLabel() public static méthode

Sends a GUI_MSG_LABEL_SET message to a control (Set the label of a control).
public static SetControlLabel ( int iWindowId, int iControlId, string strText ) : void
iWindowId int The SenderId.
iControlId int The target control.
strText string The text that needs to be set on the target label.
Résultat void

SetInitialVisibility() public méthode

public SetInitialVisibility ( ) : void
Résultat void

SetNavigation() public méthode

Set the up/down/left/right control
public SetNavigation ( int dwUp, int dwDown, int dwLeft, int dwRight ) : void
dwUp int The control above this control.
dwDown int The control under this control.
dwLeft int The control left to this control.
dwRight int The control right to this control.
Résultat void

SetPosition() public méthode

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

SetSubItem() public méthode

Property to set an subitem
public SetSubItem ( int index, object o ) : void
index int index
o object subitem
Résultat void

SetThumbAnimations() public méthode

public SetThumbAnimations ( List animations ) : void
animations List
Résultat void

SetVisibleCondition() public méthode

public SetVisibleCondition ( int visible, bool allowHiddenFocus ) : void
visible int
allowHiddenFocus bool
Résultat void

ShowControl() public static méthode

Sends a GUI_MSG_VISIBLE message to a control (Make a control visible).
public static ShowControl ( int iWindowId, int iControlId ) : void
iWindowId int The SenderId.
iControlId int The target control.
Résultat void

StorePosition() public méthode

Method to store(save) the current control rectangle
public StorePosition ( ) : void
Résultat void

UnfocusControl() public static méthode

Sends a GUI_MSG_LOSTFOCUS message to a control (Set the focus on a control).
public static UnfocusControl ( int iWindowId, int iControlId ) : void
iWindowId int The SenderId.
iControlId int The target control.
Résultat void

Update() protected méthode

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

UpdateVisibility() public méthode

public UpdateVisibility ( ) : void
Résultat void

getTransformMatrix() public méthode

public getTransformMatrix ( uint currentTime ) : TransformMatrix
currentTime uint
Résultat TransformMatrix

Property Details

_calibration protected_oe property

protected bool _calibration
Résultat bool

_data protected_oe property

protected object _data
Résultat object

_isAnimating protected_oe property

protected bool _isAnimating
Résultat bool

_isDimmed protected_oe property

protected bool _isDimmed
Résultat bool

_isSelected protected_oe property

protected bool _isSelected
Résultat bool

_originalDiffuseColor protected_oe property

protected long _originalDiffuseColor
Résultat long

_originalRectangle protected_oe property

protected Rectangle _originalRectangle
Résultat Rectangle

_parentControl protected_oe property

protected GUIControl _parentControl
Résultat GUIControl

_parentControlId protected_oe property

protected int _parentControlId
Résultat int

_selectedItem protected_oe property

protected int _selectedItem
Résultat int

_subItemList protected_oe property

protected ArrayList _subItemList
Résultat ArrayList

_windowId protected_oe property

protected int _windowId
Résultat int