]> O.S.I.I.S - jp/crow.git/commitdiff
MouseCursor property in GOLIBHost; IsActive Prop in GraphicObject
authorjpbruyere <jp.bruyere@hotmail.com>
Sat, 13 Feb 2016 01:26:03 +0000 (02:26 +0100)
committerjpbruyere <jp.bruyere@hotmail.com>
Sat, 13 Feb 2016 01:26:03 +0000 (02:26 +0100)
src/GraphicObjects/GraphicObject.cs
src/GraphicObjects/IGOLibHost.cs
src/OpenTKGameWindow.cs

index 85166d4f7b061bda69dfd3bf83f758a9174d7929..1f07e9223c4a9b2f0b59be605d18774f527e01d7 100644 (file)
@@ -79,6 +79,7 @@ namespace Crow
                int _margin = 0;
                bool _focusable = false;
                bool _hasFocus = false;
+               bool _isActive = false;
                bool _mouseRepeat;
                protected bool _isVisible = true;
                VerticalAlignment _verticalAlignment = VerticalAlignment.Center;
@@ -121,11 +122,9 @@ namespace Crow
                /// <summary>
                /// Parent in the graphic tree, used for rendering and layouting
                /// </summary>
-               [XmlIgnore]public ILayoutable Parent { 
+               [XmlIgnore]public virtual ILayoutable Parent { 
                        get { return _parent; }
-                       set {
-                               _parent = value;
-                       }
+                       set { _parent = value; }
                }
 
                public ILayoutable LogicalParent {
@@ -295,6 +294,16 @@ namespace Crow
                                NotifyValueChanged ("HasFocus", _hasFocus);
                        }
                }
+               [XmlIgnore]public virtual bool IsActive {
+                       get { return _isActive; }
+                       set { 
+                               if (value == _isActive)
+                                       return;
+
+                               _isActive = value; 
+                               NotifyValueChanged ("IsActive", _isActive);
+                       }
+               }
                [XmlAttributeAttribute()][DefaultValue(false)]
                public virtual bool MouseRepeat {
                        get { return _mouseRepeat; }
index 1cf6978ce2d7aa5055055c6189249868f96a7f3d..5c842e328929da85981beda6498327756e506e0d 100644 (file)
@@ -9,6 +9,7 @@ namespace Crow
                GraphicObject activeWidget { get; set; }
                GraphicObject hoverWidget { get; set; }
                GraphicObject FocusedWidget { get; set; }
+               XCursor MouseCursor { set; }
                void AddWidget (GraphicObject g);
                void DeleteWidget(GraphicObject g);
                void PutOnTop (GraphicObject g);
index 00035390f5aa84079cf0ed9f98e45fe803a4b0e6..a9d047148545d5981ad137a2e78dfc8d5eb9ee5b 100644 (file)
@@ -63,6 +63,9 @@ namespace Crow
                        }
                }
 
+               public XCursor MouseCursor {
+                       set { Cursor = value; }
+               }
                public List<GraphicObject> gobjsToRedraw {
                        get {
                                return _gobjsToRedraw;
@@ -107,10 +110,17 @@ namespace Crow
                {
                        get { return _activeWidget; }
                        set 
-                       {
+                       {                               
                                if (_activeWidget == value)
-                                       return;                         
+                                       return; 
+
+                               if (_activeWidget != null)
+                                       _activeWidget.IsActive = false;
+
                                _activeWidget = value;
+
+                               if (_activeWidget != null)
+                                       _activeWidget.IsActive = true;
                        }
                }
                public GraphicObject hoverWidget
@@ -418,7 +428,7 @@ namespace Crow
                                } else {
                                        
                                        //send move evt even if mouse move outside bounds
-                                       _activeWidget.onMouseMove (_activeWidget, e);
+                                       _activeWidget.onMouseMove (this, e);
                                        return;
                                }
                        }