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

base class for every window. It contains all methods needed for basic window management like - initialization - deitialization - render itself onscreen - processing actions like keypresses, mouse clicks/movements - processing messages Each window plugin should derive from this base class Pluginwindows should be copied in the plugins/windows folder
Наследование: ISupportInitialize, IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
_mainThreadContext System.Threading.SynchronizationContext

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

Свойство Тип Описание
_autoHideTopbar bool
_autoHideTopbarType AutoHideTopBar
_defaultControlId int
_disableTopBar bool
_isOverlayAllowed bool
_isOverlayAllowedCondition int
_isOverlayAllowedOriginalCondition int
_listPositions List
_loadParameter string
_loadSkinDone bool
_shouldRestore bool
_volumeOverlayOffsetX int
_volumeOverlayOffsetY int
_windowXmlFileName string

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

Метод Описание
Add ( GUIControl &control ) : void

add a new control to this window

AllocResources ( ) : void

Gets called by the runtime just before the window gets shown. It will ask every control of the window to allocate its (directx) resources

BeginInit ( ) : void
Clear ( ) : void

Clear() method. This method gets called when user switches skin. It removes any static vars the GUIWindow class has

ClearAll ( ) : void

remove all controls from the window

DeInit ( ) : void

Gets called by the runtime when a window will be destroyed Every window window should override this method and cleanup any resources

Dispose ( ) : void

Gets called by the runtime when the window is not longer shown. It will ask every control of the window 2 free its (directx) resources

DoRestoreSkin ( ) : void
EndInit ( ) : void
GUIWindow ( ) : System

The (empty) constructor of the GUIWindow

GUIWindow ( string skinFile ) : System

Constructor

GetControl ( int iControlId ) : GUIControl

get a control by the control ID

GetFocusControlId ( ) : int

returns the ID of the control which has the focus

GetModuleName ( ) : string
InWindow ( int x, int y ) : bool
Init ( ) : bool

Gets called by the runtime when a new window has been created Every window window should override this method and load itself by calling the Load() method

InitControls ( ) : void

This method will call the OnInit() on each control belonging to this window this gives the control a way to do some pre-initalisation stuff

IsInstance ( Object obj ) : bool
Load ( string skinFileName ) : bool

Load the XML file for this window which contains a definition of which controls the GUI has

LoadSkin ( ) : bool
LoadSkinBool ( ) : bool

Loads the xml file for the window.

LoadSkinThreaded ( int p1, int p2, object s ) : int
LooseFocus ( ) : void

This method will remove the focus from the currently focused control

NeedRefresh ( ) : bool

NeedRefresh() can be called to see if the windows 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 window can respond to any action

OnAdded ( ) : void
OnDeviceLost ( ) : void

Gets called when DirectX device has been lost. Any texture/font is now invalid

OnDeviceRestored ( ) : void

Gets called when DirectX device has been restored.

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 window can respond to the messages of its controls

PreInit ( ) : void

This function gets called once by the runtime when everything is up & running directX is now initialized, but before the first window is activated. It gives the window the oppertunity to allocate any (directx) resources it may need

Process ( ) : void
QueueAnimation ( AnimationType animType ) : void
Remove ( int dwId ) : void

remove a control by its id from this window

Render ( float timePassed ) : void

Render() method. This method draws the window by asking every control of the window to render itself

ResetAllControls ( ) : void

Resets all the controls to their original positions, width and height

Restore ( ) : void

Restores all the (x,y) positions of the XML file to their original values

RestoreControlPosition ( int iControl ) : void

Restores the position of the control to its default position.

SendToFront ( GUIControl &ctrl ) : void

Move the control with the specified id to the end of the control list (will render last; in front of other controls).

SetObject ( object obj ) : void
UpdateOverlay ( ) : void

Restores window overlay status to default value from skin condition

UpdateVisibility ( ) : void

calls UpdateVisibility for all children components (also used for allowing to switch focus to a component that can only be focused if the current component is not active)

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

Метод Описание
DeInitControls ( ) : void
IsAnimating ( AnimationType animType ) : bool
LoadControl ( XmlNode node, string>.IDictionary defines ) : void

This method will load a single control from the xml node

OnClicked ( int controlId, GUIControl control, Action actionType ) : void
OnClickedDown ( int controlId, GUIControl control, Action actionType ) : void
OnClickedUp ( int controlId, GUIControl control, Action actionType ) : void
OnMouseClick ( int posX, int posY, Action action ) : void
OnMouseMove ( int cx, int cy, Action action ) : void
OnPageDestroy ( int newWindowId ) : void
OnPageLoad ( ) : void
OnPreviousWindow ( ) : void
OnShowContextMenu ( ) : void
OnWindowLoaded ( ) : void

Gets by the window manager when it has loaded the window default implementation stores the position of all controls in _listPositions

PreLoadPage ( ) : void

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

Метод Описание
AnimationTrigger ( GUIMessage message ) : void
FreeResources ( ) : void
HasAnimation ( AnimationType animType ) : bool
LoadDefines ( XmlDocument document ) : string>.IDictionary
LoadInclude ( XmlNode node, string>.IDictionary defines ) : bool
RenderAnimation ( uint time ) : bool
SetControlVisibility ( ) : void
SetInitialOverlayAllowed ( ) : void
TemporaryAnimationTrigger ( ) : void
UpdateOverlayAllowed ( ) : void
UpdateOverlayAllowed ( bool useOriginal ) : void
UpdateStates ( AnimationType type, AnimationProcess currentProcess, AnimationState currentState ) : void

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

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

add a new control to this window
public Add ( GUIControl &control ) : void
control GUIControl new control to add
Результат void

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

Gets called by the runtime just before the window gets shown. It will ask every control of the window to allocate its (directx) resources
public AllocResources ( ) : void
Результат void

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

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

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

Clear() method. This method gets called when user switches skin. It removes any static vars the GUIWindow class has
public static Clear ( ) : void
Результат void

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

remove all controls from the window
public ClearAll ( ) : void
Результат void

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

Gets called by the runtime when a window will be destroyed Every window window should override this method and cleanup any resources
public DeInit ( ) : void
Результат void

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

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

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

Gets called by the runtime when the window is not longer shown. It will ask every control of the window 2 free its (directx) resources
public Dispose ( ) : void
Результат void

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

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

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

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

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

The (empty) constructor of the GUIWindow
public GUIWindow ( ) : System
Результат System

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

Constructor
public GUIWindow ( string skinFile ) : System
skinFile string filename of xml skin file which belongs to this window
Результат System

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

get a control by the control ID
public GetControl ( int iControlId ) : GUIControl
iControlId int id of control
Результат GUIControl

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

returns the ID of the control which has the focus
public GetFocusControlId ( ) : int
Результат int

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

public GetModuleName ( ) : string
Результат string

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

public InWindow ( int x, int y ) : bool
x int
y int
Результат bool

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

Gets called by the runtime when a new window has been created Every window window should override this method and load itself by calling the Load() method
public Init ( ) : bool
Результат bool

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

This method will call the OnInit() on each control belonging to this window this gives the control a way to do some pre-initalisation stuff
public InitControls ( ) : void
Результат void

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

protected IsAnimating ( AnimationType animType ) : bool
animType AnimationType
Результат bool

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

public IsInstance ( Object obj ) : bool
obj Object
Результат bool

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

Load the XML file for this window which contains a definition of which controls the GUI has
public Load ( string skinFileName ) : bool
skinFileName string filename of the .xml file
Результат bool

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

This method will load a single control from the xml node
protected LoadControl ( XmlNode node, string>.IDictionary defines ) : void
node System.Xml.XmlNode XmlNode describing the control
defines string>.IDictionary on return this will contain an arraylist of all controls loaded
Результат void

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

public LoadSkin ( ) : bool
Результат bool

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

Loads the xml file for the window.
public LoadSkinBool ( ) : bool
Результат bool

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

public LoadSkinThreaded ( int p1, int p2, object s ) : int
p1 int
p2 int
s object
Результат int

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

This method will remove the focus from the currently focused control
public LooseFocus ( ) : void
Результат void

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

NeedRefresh() can be called to see if the windows 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 window can respond to any action
public OnAction ( Action action ) : void
action Action action : contains the action
Результат void

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

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

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

protected OnClicked ( int controlId, GUIControl control, Action actionType ) : void
controlId int
control GUIControl
actionType Action
Результат void

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

protected OnClickedDown ( int controlId, GUIControl control, Action actionType ) : void
controlId int
control GUIControl
actionType Action
Результат void

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

protected OnClickedUp ( int controlId, GUIControl control, Action actionType ) : void
controlId int
control GUIControl
actionType Action
Результат void

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

Gets called when DirectX device has been lost. Any texture/font is now invalid
public OnDeviceLost ( ) : void
Результат void

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

Gets called when DirectX device has been restored.
public OnDeviceRestored ( ) : 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 window can respond to the messages of its controls
public OnMessage ( GUIMessage message ) : bool
message GUIMessage
Результат bool

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

protected OnMouseClick ( int posX, int posY, Action action ) : void
posX int
posY int
action Action
Результат void

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

protected OnMouseMove ( int cx, int cy, Action action ) : void
cx int
cy int
action Action
Результат void

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

protected OnPageDestroy ( int newWindowId ) : void
newWindowId int
Результат void

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

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

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

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

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

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

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

Gets by the window manager when it has loaded the window default implementation stores the position of all controls in _listPositions
protected OnWindowLoaded ( ) : void
Результат void

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

This function gets called once by the runtime when everything is up & running directX is now initialized, but before the first window is activated. It gives the window the oppertunity to allocate any (directx) resources it may need
public PreInit ( ) : void
Результат void

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

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

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

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

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

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

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

remove a control by its id from this window
public Remove ( int dwId ) : void
dwId int ID of the control
Результат void

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

Render() method. This method draws the window by asking every control of the window to render itself
public Render ( float timePassed ) : void
timePassed float
Результат void

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

Resets all the controls to their original positions, width and height
public ResetAllControls ( ) : void
Результат void

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

Restores all the (x,y) positions of the XML file to their original values
public Restore ( ) : void
Результат void

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

Restores the position of the control to its default position.
public RestoreControlPosition ( int iControl ) : void
iControl int The identifier of the control that needs to be restored.
Результат void

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

Move the control with the specified id to the end of the control list (will render last; in front of other controls).
public SendToFront ( GUIControl &ctrl ) : void
ctrl GUIControl ID of the control
Результат void

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

public SetObject ( object obj ) : void
obj object
Результат void

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

Restores window overlay status to default value from skin condition
public UpdateOverlay ( ) : void
Результат void

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

calls UpdateVisibility for all children components (also used for allowing to switch focus to a component that can only be focused if the current component is not active)
public UpdateVisibility ( ) : void
Результат void

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

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

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

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

protected AutoHideTopBar _autoHideTopbarType
Результат AutoHideTopBar

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

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

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

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

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

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

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

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

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

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

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

protected List _listPositions
Результат List

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

protected string _loadParameter
Результат string

_loadSkinDone защищенное статическое свойство

protected static bool _loadSkinDone
Результат bool

_mainThreadContext публичное статическое свойство

public static SynchronizationContext,System.Threading _mainThreadContext
Результат System.Threading.SynchronizationContext

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

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

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

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

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

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

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

protected string _windowXmlFileName
Результат string