C# Класс MediaPortal.GUI.Library.GUIControl

Base class for GUIControls.
Наследование: GUIBaseControl, IDisposable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
_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

Свойство Тип Описание
CalcBearing double
CalcDistance double
FlattenHierarchy System.Collections.ArrayList
FlattenHierarchy void
FreeResources void
Navigate int
UpdateStates void

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
OnFocus ( ) : void
Update ( ) : void

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

Приватные методы

Метод Описание
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

Описание методов

AddAnimations() публичный Метод

public AddAnimations ( List animations ) : void
animations List
Результат void

AddItemLabelControl() публичный статический Метод

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.
Результат void

AddListItemControl() публичный статический Метод

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
Результат void

AddSubItem() публичный Метод

Add an subitem to a control
public AddSubItem ( object obj ) : void
obj object subitem
Результат void

AllocResources() публичный Метод

Allocates the control its DirectX resources.
public AllocResources ( ) : void
Результат void

Animate() публичный Метод

Method to get animate the current control
public Animate ( float timePassed, MediaPortal.GUI.Library.Animator animator ) : void
timePassed float
animator MediaPortal.GUI.Library.Animator
Результат void

CanFocus() публичный Метод

Checks if the control can focus.
public CanFocus ( ) : bool
Результат bool

ClearControl() публичный статический Метод

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.
Результат void

DeSelectControl() публичный статический Метод

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.
Результат void

DisableControl() публичный статический Метод

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.
Результат void

Dispose() публичный Метод

Frees the control its DirectX resources.
public Dispose ( ) : void
Результат void

DoRender() публичный Метод

public DoRender ( float timePassed, uint currentTime ) : void
timePassed float
currentTime uint
Результат void

DoUpdate() публичный Метод

public DoUpdate ( ) : void
Результат void

EnableControl() публичный статический Метод

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.
Результат void

FinalizeConstruction() публичный Метод

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
Результат void

FocusControl() публичный статический Метод

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.
Результат void

FocusControl() публичный статический Метод

public static FocusControl ( int iWindowId, int iControlId, Direction direction ) : void
iWindowId int
iControlId int
direction Direction
Результат void

FocusItemControl() публичный статический Метод

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.
Результат void

GUIControl() публичный Метод

empty constructor
public GUIControl ( ) : System
Результат System

GUIControl() публичный Метод

The basic constructur of the GUIControl class.
public GUIControl ( int dwParentID ) : System
dwParentID int
Результат System

GUIControl() публичный Метод

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.
Результат System

GetAnimation() публичный Метод

public GetAnimation ( AnimationType type, bool checkConditions ) : VisualEffect
type AnimationType
checkConditions bool
Результат VisualEffect

GetAnimations() публичный Метод

public GetAnimations ( AnimationType type, bool checkConditions ) : List
type AnimationType
checkConditions bool
Результат List

GetCenter() публичный Метод

public GetCenter ( float &centerX, float &centerY ) : void
centerX float
centerY float
Результат void

GetControlById() публичный Метод

Property to get the control for a specific control ID
public GetControlById ( int ID ) : GUIControl
ID int Id of wanted control
Результат GUIControl

GetItemCount() публичный статический Метод

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.
Результат int

GetListItem() публичный статический Метод

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.
Результат GUIListItem

GetRect() публичный Метод

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
Результат void

GetSelectedListItem() публичный статический Метод

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.
Результат GUIListItem

GetSubItem() публичный Метод

Property to get a subitem
public GetSubItem ( int index ) : object
index int index
Результат object

GetVisibleCondition() публичный Метод

public GetVisibleCondition ( ) : int
Результат int

HideControl() публичный статический Метод

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.
Результат void

HitTest() публичный Метод

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
Результат bool

InControl() публичный Метод

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
Результат bool

IsEffectAnimating() публичный Метод

public IsEffectAnimating ( AnimationType animType ) : bool
animType AnimationType
Результат bool

LoadAnimationControl() публичный Метод

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
Результат GUIAnimation

LoadControl() публичный Метод

public LoadControl ( string xmlFilename ) : List
xmlFilename string
Результат List

NeedRefresh() публичный Метод

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
Результат bool

OnAction() публичный Метод

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
Результат void

OnDeInit() публичный Метод

Virtual method. This method gets called when the control is de-initialized and allows it to do any de-initalization
public OnDeInit ( ) : void
Результат void

OnFocus() защищенный Метод

protected OnFocus ( ) : void
Результат void

OnInit() публичный Метод

Virtual method. This method gets called when the control is initialized and allows it to do any initalization
public OnInit ( ) : void
Результат void

OnMessage() публичный Метод

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
Результат bool

PreAllocResources() публичный Метод

Preallocates the control its DirectX resources.
public PreAllocResources ( ) : void
Результат void

QueueAnimation() публичный Метод

public QueueAnimation ( AnimationType animType ) : void
animType AnimationType
Результат void

ReStorePosition() публичный Метод

Method to restore the saved-current control rectangle
public ReStorePosition ( ) : void
Результат void

RefreshControl() публичный статический Метод

public static RefreshControl ( int iWindowId, int iControlId ) : void
iWindowId int
iControlId int
Результат void

RemoveSubItem() публичный Метод

Remove an subitem from an control
public RemoveSubItem ( int index ) : void
index int
Результат void

RemoveSubItem() публичный Метод

Remove an subitem from an control
public RemoveSubItem ( object obj ) : void
obj object subitem
Результат void

Render() публичный Метод

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
Результат void

ResetAnimations() публичный Метод

public ResetAnimations ( ) : void
Результат void

ScaleToScreenResolution() публичный Метод

Does any scaling on the inital size\position values to fit them to screen resolution.
public ScaleToScreenResolution ( ) : void
Результат void

SelectControl() публичный статический Метод

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.
Результат void

SelectItemControl() публичный статический Метод

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.
Результат void

SetAlpha() публичный Метод

Changes the alpha transparency component of the colordiffuse.
public SetAlpha ( int dwAlpha ) : void
dwAlpha int
Результат void

SetAnimations() публичный Метод

public SetAnimations ( List animations ) : void
animations List
Результат void

SetControlLabel() публичный статический Метод

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.
Результат void

SetInitialVisibility() публичный Метод

public SetInitialVisibility ( ) : void
Результат void

SetNavigation() публичный Метод

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.
Результат void

SetPosition() публичный Метод

Sets the position of the control.
public SetPosition ( int dwPosX, int dwPosY ) : void
dwPosX int The X position.
dwPosY int The Y position.
Результат void

SetSubItem() публичный Метод

Property to set an subitem
public SetSubItem ( int index, object o ) : void
index int index
o object subitem
Результат void

SetThumbAnimations() публичный Метод

public SetThumbAnimations ( List animations ) : void
animations List
Результат void

SetVisibleCondition() публичный Метод

public SetVisibleCondition ( int visible, bool allowHiddenFocus ) : void
visible int
allowHiddenFocus bool
Результат void

ShowControl() публичный статический Метод

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.
Результат void

StorePosition() публичный Метод

Method to store(save) the current control rectangle
public StorePosition ( ) : void
Результат void

UnfocusControl() публичный статический Метод

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.
Результат void

Update() защищенный Метод

Perform an update after a change has occured. E.g. change to a new position.
protected Update ( ) : void
Результат void

UpdateVisibility() публичный Метод

public UpdateVisibility ( ) : void
Результат void

getTransformMatrix() публичный Метод

public getTransformMatrix ( uint currentTime ) : TransformMatrix
currentTime uint
Результат TransformMatrix

Описание свойств

_calibration защищенное свойство

protected bool _calibration
Результат bool

_data защищенное свойство

protected object _data
Результат object

_isAnimating защищенное свойство

protected bool _isAnimating
Результат bool

_isDimmed защищенное свойство

protected bool _isDimmed
Результат bool

_isSelected защищенное свойство

protected bool _isSelected
Результат bool

_originalDiffuseColor защищенное свойство

protected long _originalDiffuseColor
Результат long

_originalRectangle защищенное свойство

protected Rectangle _originalRectangle
Результат Rectangle

_parentControl защищенное свойство

protected GUIControl _parentControl
Результат GUIControl

_parentControlId защищенное свойство

protected int _parentControlId
Результат int

_selectedItem защищенное свойство

protected int _selectedItem
Результат int

_subItemList защищенное свойство

protected ArrayList _subItemList
Результат ArrayList

_windowId защищенное свойство

protected int _windowId
Результат int