Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial implementation for GUIControl enabled attribute.

  • Loading branch information...
commit 08030263a4ab9706183c11159d64d3f04b19af50 1 parent 6e94ca7
@ajp8164 ajp8164 authored
View
16 mediaportal/Core/guilib/GUIControl.cs
@@ -114,6 +114,7 @@ public abstract class GUIControl : GUIBaseControl, IDisposable // Control, IDisp
[XMLSkinElement("dimColor")] protected int _dimColor = 0x60ffffff;
[XMLSkinElement("layoutDetail")] protected ILayoutDetail _layoutDetail;
[XMLSkinElement("onfocus")] protected string _onfocus = "";
+ [XMLSkinElement("enabled")] protected string _enabledFromSkinExpression = "";
protected int _parentControlId = 0;
protected bool _isSelected = false;
@@ -2024,6 +2025,21 @@ public virtual void SetVisibleCondition(int visible, bool allowHiddenFocus)
_allowHiddenFocus = allowHiddenFocus;
}
+ public void UpdateEnableState()
+ {
+ if (_enabledFromSkinExpression.Length != 0)
+ {
+ try
+ {
+ IsEnabled = bool.Parse(GUIPropertyManager.Parse(_enabledFromSkinExpression, GUIExpressionManager.ExpressionOptions.EVALUATE_ALWAYS));
+ }
+ catch (System.Exception)
+ {
+ Log.Debug("GUIControl: id={0} <enabled> expression does not return a boolean value", GetID);
+ }
+ }
+ }
+
protected virtual void OnFocus() {}
public Point Camera
View
1  mediaportal/Core/guilib/GUIWindow.cs
@@ -1364,6 +1364,7 @@ public virtual void Render(float timePassed)
foreach (GUIControl control in Children)
{
control.UpdateVisibility();
+ control.UpdateEnableState();
control.DoRender(timePassed, currentTime);
}
Please sign in to comment.
Something went wrong with that request. Please try again.