C# Class 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
Inheritance: ISupportInitialize, IDisposable
Afficher le fichier Open project: MediaPortal/MediaPortal-1 Class Usage Examples

Méthodes publiques

Свойство Type Description
_mainThreadContext System.Threading.SynchronizationContext

Protected Properties

Свойство Type Description
_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

Méthodes publiques

Méthode Description
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)

Méthodes protégées

Méthode Description
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

Private Methods

Méthode Description
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

Method Details

Add() public méthode

add a new control to this window
public Add ( GUIControl &control ) : void
control GUIControl new control to add
Résultat void

AllocResources() public méthode

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

BeginInit() public méthode

public BeginInit ( ) : void
Résultat void

Clear() public static méthode

Clear() method. This method gets called when user switches skin. It removes any static vars the GUIWindow class has
public static Clear ( ) : void
Résultat void

ClearAll() public méthode

remove all controls from the window
public ClearAll ( ) : void
Résultat void

DeInit() public méthode

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

DeInitControls() protected méthode

protected DeInitControls ( ) : void
Résultat void

Dispose() public méthode

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

DoRestoreSkin() public méthode

public DoRestoreSkin ( ) : void
Résultat void

EndInit() public méthode

public EndInit ( ) : void
Résultat void

GUIWindow() public méthode

The (empty) constructor of the GUIWindow
public GUIWindow ( ) : System
Résultat System

GUIWindow() public méthode

Constructor
public GUIWindow ( string skinFile ) : System
skinFile string filename of xml skin file which belongs to this window
Résultat System

GetControl() public méthode

get a control by the control ID
public GetControl ( int iControlId ) : GUIControl
iControlId int id of control
Résultat GUIControl

GetFocusControlId() public méthode

returns the ID of the control which has the focus
public GetFocusControlId ( ) : int
Résultat int

GetModuleName() public méthode

public GetModuleName ( ) : string
Résultat string

InWindow() public méthode

public InWindow ( int x, int y ) : bool
x int
y int
Résultat bool

Init() public méthode

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

InitControls() public méthode

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

IsAnimating() protected méthode

protected IsAnimating ( AnimationType animType ) : bool
animType AnimationType
Résultat bool

IsInstance() public méthode

public IsInstance ( Object obj ) : bool
obj Object
Résultat bool

Load() public méthode

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

LoadControl() protected méthode

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

LoadSkin() public méthode

public LoadSkin ( ) : bool
Résultat bool

LoadSkinBool() public méthode

Loads the xml file for the window.
public LoadSkinBool ( ) : bool
Résultat bool

LoadSkinThreaded() public méthode

public LoadSkinThreaded ( int p1, int p2, object s ) : int
p1 int
p2 int
s object
Résultat int

LooseFocus() public méthode

This method will remove the focus from the currently focused control
public LooseFocus ( ) : void
Résultat void

NeedRefresh() public méthode

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
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 window can respond to any action
public OnAction ( Action action ) : void
action Action action : contains the action
Résultat void

OnAdded() public méthode

public OnAdded ( ) : void
Résultat void

OnClicked() protected méthode

protected OnClicked ( int controlId, GUIControl control, Action actionType ) : void
controlId int
control GUIControl
actionType Action
Résultat void

OnClickedDown() protected méthode

protected OnClickedDown ( int controlId, GUIControl control, Action actionType ) : void
controlId int
control GUIControl
actionType Action
Résultat void

OnClickedUp() protected méthode

protected OnClickedUp ( int controlId, GUIControl control, Action actionType ) : void
controlId int
control GUIControl
actionType Action
Résultat void

OnDeviceLost() public méthode

Gets called when DirectX device has been lost. Any texture/font is now invalid
public OnDeviceLost ( ) : void
Résultat void

OnDeviceRestored() public méthode

Gets called when DirectX device has been restored.
public OnDeviceRestored ( ) : 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 window can respond to the messages of its controls
public OnMessage ( GUIMessage message ) : bool
message GUIMessage
Résultat bool

OnMouseClick() protected méthode

protected OnMouseClick ( int posX, int posY, Action action ) : void
posX int
posY int
action Action
Résultat void

OnMouseMove() protected méthode

protected OnMouseMove ( int cx, int cy, Action action ) : void
cx int
cy int
action Action
Résultat void

OnPageDestroy() protected méthode

protected OnPageDestroy ( int newWindowId ) : void
newWindowId int
Résultat void

OnPageLoad() protected méthode

protected OnPageLoad ( ) : void
Résultat void

OnPreviousWindow() protected méthode

protected OnPreviousWindow ( ) : void
Résultat void

OnShowContextMenu() protected méthode

protected OnShowContextMenu ( ) : void
Résultat void

OnWindowLoaded() protected méthode

Gets by the window manager when it has loaded the window default implementation stores the position of all controls in _listPositions
protected OnWindowLoaded ( ) : void
Résultat void

PreInit() public méthode

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

PreLoadPage() protected méthode

protected PreLoadPage ( ) : void
Résultat void

Process() public méthode

public Process ( ) : void
Résultat void

QueueAnimation() public méthode

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

Remove() public méthode

remove a control by its id from this window
public Remove ( int dwId ) : void
dwId int ID of the control
Résultat void

Render() public méthode

Render() method. This method draws the window by asking every control of the window to render itself
public Render ( float timePassed ) : void
timePassed float
Résultat void

ResetAllControls() public méthode

Resets all the controls to their original positions, width and height
public ResetAllControls ( ) : void
Résultat void

Restore() public méthode

Restores all the (x,y) positions of the XML file to their original values
public Restore ( ) : void
Résultat void

RestoreControlPosition() public méthode

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.
Résultat void

SendToFront() public méthode

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

SetObject() public méthode

public SetObject ( object obj ) : void
obj object
Résultat void

UpdateOverlay() public méthode

Restores window overlay status to default value from skin condition
public UpdateOverlay ( ) : void
Résultat void

UpdateVisibility() public méthode

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

Property Details

_autoHideTopbar protected_oe property

protected bool _autoHideTopbar
Résultat bool

_autoHideTopbarType protected_oe property

protected AutoHideTopBar _autoHideTopbarType
Résultat AutoHideTopBar

_defaultControlId protected_oe property

protected int _defaultControlId
Résultat int

_disableTopBar protected_oe property

protected bool _disableTopBar
Résultat bool

_isOverlayAllowed protected_oe property

protected bool _isOverlayAllowed
Résultat bool

_isOverlayAllowedCondition protected_oe property

protected int _isOverlayAllowedCondition
Résultat int

_isOverlayAllowedOriginalCondition protected_oe property

protected int _isOverlayAllowedOriginalCondition
Résultat int

_listPositions protected_oe property

protected List _listPositions
Résultat List

_loadParameter protected_oe property

protected string _loadParameter
Résultat string

_loadSkinDone protected_oe static_oe property

protected static bool _loadSkinDone
Résultat bool

_mainThreadContext public_oe static_oe property

public static SynchronizationContext,System.Threading _mainThreadContext
Résultat System.Threading.SynchronizationContext

_shouldRestore protected_oe property

protected bool _shouldRestore
Résultat bool

_volumeOverlayOffsetX protected_oe property

protected int _volumeOverlayOffsetX
Résultat int

_volumeOverlayOffsetY protected_oe property

protected int _volumeOverlayOffsetY
Résultat int

_windowXmlFileName protected_oe property

protected string _windowXmlFileName
Résultat string