]> O.S.I.I.S - jp/crow.git/commitdiff
rename CurrentInterface to IFace
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Fri, 23 Feb 2018 12:25:37 +0000 (13:25 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Fri, 23 Feb 2018 12:25:37 +0000 (13:25 +0100)
27 files changed:
Tests/BasicTests.cs
src/CompilerServices/CompilerServices.cs
src/CrowThread.cs
src/GraphicObjects/ColorSelector.cs
src/GraphicObjects/Docker.cs
src/GraphicObjects/FileDialog.cs
src/GraphicObjects/GenericStack.cs
src/GraphicObjects/GraphicObject.cs
src/GraphicObjects/Grid.cs
src/GraphicObjects/Group.cs
src/GraphicObjects/IMLContainer.cs
src/GraphicObjects/Image.cs
src/GraphicObjects/Label.cs
src/GraphicObjects/MessageBox.cs
src/GraphicObjects/Popper.cs
src/GraphicObjects/PrivateContainer.cs
src/GraphicObjects/ScrollingObject.cs
src/GraphicObjects/ScrollingTextBox.cs
src/GraphicObjects/Splitter.cs
src/GraphicObjects/TabView.cs
src/GraphicObjects/TemplatedControl.cs
src/GraphicObjects/TemplatedGroup.cs
src/GraphicObjects/TextBox.cs
src/GraphicObjects/Window.cs
src/GraphicObjects/Wrapper.cs
src/Interface.cs
src/LayoutingQueueItem.cs

index 581312700aad18595fc0267d15306a182aa152af..66ee3d0a771f268ea7d65100b910ef8ead51bb1d 100644 (file)
@@ -271,8 +271,8 @@ namespace Tests
                                return;
                        //tv.AddChild (new TabItem (CurrentInterface) { Caption = "NewTab" });
                        lock (CurrentInterface.UpdateMutex) {
-                               tv.AddChild (Crow.IML.Instantiator.CreateFromImlFragment
-                                       (@"<TabItem Caption='New tab' Background='Blue'><Label/></TabItem>").CreateInstance (CurrentInterface));
+                               tv.AddChild (CurrentInterface.LoadIMLFragment
+                                       (@"<TabItem Caption='New tab' Background='Blue'><Label/></TabItem>"));
                        }
                }
                [STAThread]
index eb8f2ecfcfd1694e212f3574075b51ca83100247..955a0d69c773b7cafbd7aba12a96b2b471bcf36e 100644 (file)
@@ -77,7 +77,7 @@ namespace Crow.IML
                internal static MethodInfo miDSChangeEmitHelper = typeof(Instantiator).GetMethod("dataSourceChangedEmitHelper", BindingFlags.Instance | BindingFlags.NonPublic);
                internal static MethodInfo miDSReverseBinding = typeof(Instantiator).GetMethod("dataSourceReverseBinding", BindingFlags.Static | BindingFlags.NonPublic);
 
-               internal static FieldInfo miSetCurIface = typeof(GraphicObject).GetField ("CurrentInterface", BindingFlags.Public | BindingFlags.Instance);
+               internal static FieldInfo miSetCurIface = typeof(GraphicObject).GetField ("IFace", BindingFlags.Public | BindingFlags.Instance);
                internal static MethodInfo miFindByName = typeof (GraphicObject).GetMethod ("FindByName");
                internal static MethodInfo miGetGObjItem = typeof(List<GraphicObject>).GetMethod("get_Item", new Type[] { typeof(Int32) });
                internal static MethodInfo miLoadDefaultVals = typeof (GraphicObject).GetMethod ("loadDefaultValues");
index c3a4ba3b8c36833393356599bcd2753ee0ec9ab2..a1b4c38e278c19d651f4a38720bcdb6cd3140e85 100644 (file)
@@ -41,15 +41,15 @@ namespace Crow
                        thread = new Thread (start);
                        thread.IsBackground = true;
                        Host = host;
-                       lock (Host.CurrentInterface.CrowThreads)
-                               Host.CurrentInterface.CrowThreads.Add (this);
+                       lock (Host.IFace.CrowThreads)
+                               Host.IFace.CrowThreads.Add (this);
                }
                public void CheckState(){
                        if (thread.ThreadState != ThreadState.Stopped)
                                return;
                        Finished.Raise (Host, null);
-                       lock (Host.CurrentInterface.CrowThreads)
-                               Host.CurrentInterface.CrowThreads.Remove (this);
+                       lock (Host.IFace.CrowThreads)
+                               Host.IFace.CrowThreads.Remove (this);
                }
                public void Start() { thread.Start();}
                public void Cancel(){
@@ -57,8 +57,8 @@ namespace Crow
                                cancelRequested = true;
                                thread.Join ();
                        }
-                       lock (Host.CurrentInterface.CrowThreads)
-                               Host.CurrentInterface.CrowThreads.Remove (this);
+                       lock (Host.IFace.CrowThreads)
+                               Host.IFace.CrowThreads.Remove (this);
                }
        }
 }
index 5b32fc95414761923ec9bf338c78010da80aecb8..e2d6cb6a829775f617708a410aedb57013476207 100644 (file)
@@ -47,7 +47,7 @@ namespace Crow
                public override void onMouseMove (object sender, MouseMoveEventArgs e)
                {
                        base.onMouseMove (sender, e);
-                       if (CurrentInterface.Mouse.LeftButton == ButtonState.Released)
+                       if (IFace.Mouse.LeftButton == ButtonState.Released)
                                return;
                        updateMouseLocalPos (e.Position);
                }
index d34e5ba7c247214655a22de03f73325c0f2d43c4..bb816dd9e4c850cf160852e3986329d3fb7a7d43 100644 (file)
@@ -38,9 +38,9 @@ namespace Crow
                }
                public Docker () : base ()
                {
-                       instStack = Instantiator.CreateFromImlFragment(CurrentInterface, @"<GenericStack Background='Blue' AllowDrop='true' DragEnter='onStackDragEnter'/>");
-                       instSplit = Instantiator.CreateFromImlFragment(CurrentInterface, @"<Splitter/>");
-                       instSpacer = Instantiator.CreateFromImlFragment(CurrentInterface, @"<GraphicObject Background='Red' IsEnabled='false'/>");
+                       instStack = IFace.CreateITorFromIMLFragment (@"<GenericStack Background='Blue' AllowDrop='true' DragEnter='onStackDragEnter'/>");
+                       instSplit = IFace.CreateITorFromIMLFragment (@"<Splitter/>");
+                       instSpacer = IFace.CreateITorFromIMLFragment (@"<GraphicObject Background='Red' IsEnabled='false'/>");
                }
                #endregion
 
@@ -85,9 +85,9 @@ namespace Crow
 
                public override void onMouseMove (object sender, MouseMoveEventArgs e)
                {                       
-                       if (CurrentInterface.DragAndDropOperation?.DragSource as DockWindow != null) {
-                               DockWindow dw = CurrentInterface.DragAndDropOperation?.DragSource as DockWindow;
-                               if (CurrentInterface.DragAndDropOperation.DragSource.Parent == this && !dw.IsDocked)
+                       if (IFace.DragAndDropOperation?.DragSource as DockWindow != null) {
+                               DockWindow dw = IFace.DragAndDropOperation?.DragSource as DockWindow;
+                               if (IFace.DragAndDropOperation.DragSource.Parent == this && !dw.IsDocked)
                                        dw.MoveAndResize (e.XDelta, e.YDelta);
 
                                Rectangle r = ClientRectangle;
@@ -149,7 +149,7 @@ namespace Crow
                        childrenRWLock.EnterReadLock ();
 
                        foreach (GraphicObject g in Children) {
-                               if (CurrentInterface.DragAndDropOperation?.DragSource == g)
+                               if (IFace.DragAndDropOperation?.DragSource == g)
                                        continue;
                                g.Paint (ref gr);
                        }
@@ -184,8 +184,8 @@ namespace Crow
                                gr.Stroke ();
                        }
 
-                       if (CurrentInterface.DragAndDropOperation != null)
-                               CurrentInterface.DragAndDropOperation.DragSource.Paint (ref gr);
+                       if (IFace.DragAndDropOperation != null)
+                               IFace.DragAndDropOperation.DragSource.Paint (ref gr);
 
 
                        gr.Restore ();  
@@ -194,7 +194,7 @@ namespace Crow
                public void Dock(DockWindow dw){
                        if (dockingDirection == Alignment.Center)
                                return;
-                       lock (CurrentInterface.UpdateMutex) {
+                       lock (IFace.UpdateMutex) {
 
                                Splitter splitter = instSplit.CreateInstance<Splitter> ();
 
index 285ca253377426b360edf44e8bd1f7bf9d51b0e5..8f1a0830e675afd5b2e62315a7fa40505eb0fcfb 100644 (file)
@@ -143,11 +143,11 @@ namespace Crow
                                CurrentDirectory = SelectedDirectory;
                        else {
                                OkClicked.Raise (this, null);
-                               CurrentInterface.DeleteWidget (this);
+                               IFace.DeleteWidget (this);
                        }
                }
                void onCancel(object sender, MouseButtonEventArgs e){
-                       CurrentInterface.DeleteWidget (this);
+                       IFace.DeleteWidget (this);
                }
        }
 }
index 7976f837fbb0f0db1a2bf35948a7fd28c294f59c..3d6884e157c36fb1f3a3a3196c5e5783dbf769a4 100644 (file)
@@ -128,7 +128,7 @@ namespace Crow
 
                                //if no layouting remains in queue for item, registre for redraw
                                if (RegisteredLayoutings == LayoutingType.None && IsDirty)
-                                       CurrentInterface.EnqueueForRepaint (this);
+                                       IFace.EnqueueForRepaint (this);
 
                                return true;
                        }
index f671239d6499e4ae2899763d34807f819770e843..8c9afa0e9ddc0daf6abcced3f23e8c9d2e3a01f6 100644 (file)
@@ -70,17 +70,17 @@ namespace Crow
                                throw new Exception("Trying to dispose an object queued for Redraw: " + this.ToString());
                                #endif
 
-                               if (CurrentInterface.HoverWidget != null) {
-                                       if (CurrentInterface.HoverWidget.IsOrIsInside(this))
-                                               CurrentInterface.HoverWidget = null;
+                               if (IFace.HoverWidget != null) {
+                                       if (IFace.HoverWidget.IsOrIsInside(this))
+                                               IFace.HoverWidget = null;
                                }
-                               if (CurrentInterface.ActiveWidget != null) {
-                                       if (CurrentInterface.ActiveWidget.IsOrIsInside (this))
-                                               CurrentInterface.ActiveWidget = null;
+                               if (IFace.ActiveWidget != null) {
+                                       if (IFace.ActiveWidget.IsOrIsInside (this))
+                                               IFace.ActiveWidget = null;
                                }
-                               if (CurrentInterface.FocusedWidget != null) {
-                                       if (CurrentInterface.FocusedWidget.IsOrIsInside (this))
-                                               CurrentInterface.FocusedWidget = null;
+                               if (IFace.FocusedWidget != null) {
+                                       if (IFace.FocusedWidget.IsOrIsInside (this))
+                                               IFace.FocusedWidget = null;
                                }
                                if (!localDataSourceIsNull)
                                        DataSource = null;
@@ -107,7 +107,7 @@ namespace Crow
                /// <summary>
                /// interface this widget is bound to, this should not be changed once the instance is created
                /// </summary>
-               public Interface CurrentInterface = null;
+               public Interface IFace = null;
 
                /// <summary>
                /// contains the dirty rectangles in the coordinate system of the cache. those dirty zones
@@ -159,7 +159,7 @@ namespace Crow
                /// <param name="iface">Iface.</param>
                public GraphicObject (Interface iface) : this()
                {
-                       CurrentInterface = iface;
+                       IFace = iface;
                        Initialize ();
                }
                #endregion
@@ -867,17 +867,17 @@ namespace Crow
                        Type thisType = this.GetType ();
 
                        if (!string.IsNullOrEmpty (Style)) {
-                               if (CurrentInterface.DefaultValuesLoader.ContainsKey (Style)) {
-                                       CurrentInterface.DefaultValuesLoader [Style] (this);
+                               if (IFace.DefaultValuesLoader.ContainsKey (Style)) {
+                                       IFace.DefaultValuesLoader [Style] (this);
                                        return;
                                }
                        } else {
-                               if (CurrentInterface.DefaultValuesLoader.ContainsKey (thisType.FullName)) {
-                                       CurrentInterface.DefaultValuesLoader [thisType.FullName] (this);
+                               if (IFace.DefaultValuesLoader.ContainsKey (thisType.FullName)) {
+                                       IFace.DefaultValuesLoader [thisType.FullName] (this);
                                        return;
-                               } else if (!CurrentInterface.Styling.ContainsKey (thisType.FullName)) {
-                                       if (CurrentInterface.DefaultValuesLoader.ContainsKey (thisType.Name)) {
-                                               CurrentInterface.DefaultValuesLoader [thisType.Name] (this);
+                               } else if (!IFace.Styling.ContainsKey (thisType.FullName)) {
+                                       if (IFace.DefaultValuesLoader.ContainsKey (thisType.Name)) {
+                                               IFace.DefaultValuesLoader [thisType.Name] (this);
                                                return;
                                        }
                                }
@@ -892,17 +892,17 @@ namespace Crow
                        //   those files being placed in a Styles folder
                        string styleKey = Style;
                        if (!string.IsNullOrEmpty (Style)) {
-                               if (CurrentInterface.Styling.ContainsKey (Style)) {
-                                       styling.Add (CurrentInterface.Styling [Style]);
+                               if (IFace.Styling.ContainsKey (Style)) {
+                                       styling.Add (IFace.Styling [Style]);
                                }
                        }
-                       if (CurrentInterface.Styling.ContainsKey (thisType.FullName)) {
-                               styling.Add (CurrentInterface.Styling [thisType.FullName]);
+                       if (IFace.Styling.ContainsKey (thisType.FullName)) {
+                               styling.Add (IFace.Styling [thisType.FullName]);
                                if (string.IsNullOrEmpty (styleKey))
                                        styleKey = thisType.FullName;
                        }
-                       if (CurrentInterface.Styling.ContainsKey (thisType.Name)) {
-                               styling.Add (CurrentInterface.Styling [thisType.Name]);
+                       if (IFace.Styling.ContainsKey (thisType.Name)) {
+                               styling.Add (IFace.Styling [thisType.Name]);
                                if (string.IsNullOrEmpty (styleKey))
                                        styleKey = thisType.Name;
                        }
@@ -972,8 +972,8 @@ namespace Crow
                        #endregion
 
                        try {
-                               CurrentInterface.DefaultValuesLoader[styleKey] = (Interface.LoaderInvoker)dm.CreateDelegate(typeof(Interface.LoaderInvoker));
-                               CurrentInterface.DefaultValuesLoader[styleKey] (this);
+                               IFace.DefaultValuesLoader[styleKey] = (Interface.LoaderInvoker)dm.CreateDelegate(typeof(Interface.LoaderInvoker));
+                               IFace.DefaultValuesLoader[styleKey] (this);
                        } catch (Exception ex) {
                                throw new Exception ("Error applying style <" + styleKey + ">:", ex);
                        }
@@ -1105,7 +1105,7 @@ namespace Crow
                /// fired when drag and drop operation start
                /// </summary>
                protected virtual void onStartDrag (object sender, DragDropEventArgs e){
-                       CurrentInterface.HoverWidget = null;
+                       IFace.HoverWidget = null;
                        IsDragged = true;
                        StartDrag.Raise (this, e);
                        Debug.WriteLine(this.ToString() + " : START DRAG => " + e.ToString());
@@ -1180,7 +1180,7 @@ namespace Crow
                        if (Width.IsFit || Height.IsFit)
                                RegisterForLayouting (LayoutingType.Sizing);
                        else if (RegisteredLayoutings == LayoutingType.None)
-                               CurrentInterface.EnqueueForRepaint (this);
+                               IFace.EnqueueForRepaint (this);
                }
                /// <summary> query an update of the content, a redraw </summary>
                [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -1191,7 +1191,7 @@ namespace Crow
                        #endif
                        IsDirty = true;
                        if (RegisteredLayoutings == LayoutingType.None)
-                               CurrentInterface.EnqueueForRepaint (this);
+                               IFace.EnqueueForRepaint (this);
                }
                #endregion
 
@@ -1209,7 +1209,7 @@ namespace Crow
                public virtual void RegisterForLayouting(LayoutingType layoutType){
                        if (Parent == null)
                                return;
-                       lock (CurrentInterface.LayoutMutex) {
+                       lock (IFace.LayoutMutex) {
                                //prevent queueing same LayoutingType for this
                                layoutType &= (~RegisteredLayoutings);
 
@@ -1236,15 +1236,15 @@ namespace Crow
 
                                //enqueue LQI LayoutingTypes separately
                                if (layoutType.HasFlag (LayoutingType.Width))
-                                       CurrentInterface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Width, this));
+                                       IFace.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Width, this));
                                if (layoutType.HasFlag (LayoutingType.Height))
-                                       CurrentInterface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Height, this));
+                                       IFace.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Height, this));
                                if (layoutType.HasFlag (LayoutingType.X))
-                                       CurrentInterface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.X, this));
+                                       IFace.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.X, this));
                                if (layoutType.HasFlag (LayoutingType.Y))
-                                       CurrentInterface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Y, this));
+                                       IFace.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Y, this));
                                if (layoutType.HasFlag (LayoutingType.ArrangeChildren))
-                                       CurrentInterface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.ArrangeChildren, this));
+                                       IFace.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.ArrangeChildren, this));
                        }
                }
 
@@ -1420,7 +1420,7 @@ namespace Crow
 
                        //if no layouting remains in queue for item, registre for redraw
                        if (this.registeredLayoutings == LayoutingType.None && IsDirty)
-                               CurrentInterface.EnqueueForRepaint (this);
+                               IFace.EnqueueForRepaint (this);
 
                        return true;
                }
@@ -1557,8 +1557,8 @@ namespace Crow
                }
                public virtual void checkHoverWidget(MouseMoveEventArgs e)
                {
-                       if (CurrentInterface.HoverWidget != this) {
-                               CurrentInterface.HoverWidget = this;
+                       if (IFace.HoverWidget != this) {
+                               IFace.HoverWidget = this;
                                onMouseEnter (this, e);
                        }
 
@@ -1567,9 +1567,9 @@ namespace Crow
                public virtual void onMouseMove(object sender, MouseMoveEventArgs e)
                {
                        if (AllowDrag & HasFocus & e.Mouse.LeftButton == ButtonState.Pressed) {
-                               if (CurrentInterface.DragAndDropOperation == null) {
-                                       CurrentInterface.DragAndDropOperation = new DragDropEventArgs (this);
-                                       onStartDrag (this, CurrentInterface.DragAndDropOperation);
+                               if (IFace.DragAndDropOperation == null) {
+                                       IFace.DragAndDropOperation = new DragDropEventArgs (this);
+                                       onStartDrag (this, IFace.DragAndDropOperation);
                                }
                        }
 
@@ -1585,15 +1585,15 @@ namespace Crow
                        Debug.WriteLine("MOUSE DOWN => " + this.ToString());
                        #endif
 
-                       if (CurrentInterface.ActiveWidget == null)
-                               CurrentInterface.ActiveWidget = this;
+                       if (IFace.ActiveWidget == null)
+                               IFace.ActiveWidget = this;
                        if (this.Focusable && !Interface.FocusOnHover) {
                                BubblingMouseButtonEventArg be = e as BubblingMouseButtonEventArg;
                                if (be.Focused == null) {
                                        be.Focused = this;
-                                       CurrentInterface.FocusedWidget = this;
+                                       IFace.FocusedWidget = this;
                                        if (e.Button == MouseButton.Right && this.ContextCommands != null)
-                                               CurrentInterface.ShowContextMenu (this);                                        
+                                               IFace.ShowContextMenu (this);                                   
                                }
                        }
                        //bubble event to the top
@@ -1608,13 +1608,13 @@ namespace Crow
                        Debug.WriteLine("MOUSE UP => " + this.ToString());
                        #endif
 
-                       if (CurrentInterface.DragAndDropOperation != null){
-                               if (CurrentInterface.DragAndDropOperation.DragSource == this) {
-                                       if (CurrentInterface.DragAndDropOperation.DropTarget != null)
-                                               onDrop (this, CurrentInterface.DragAndDropOperation);
+                       if (IFace.DragAndDropOperation != null){
+                               if (IFace.DragAndDropOperation.DragSource == this) {
+                                       if (IFace.DragAndDropOperation.DropTarget != null)
+                                               onDrop (this, IFace.DragAndDropOperation);
                                        else
-                                               onEndDrag (this, CurrentInterface.DragAndDropOperation);
-                                       CurrentInterface.DragAndDropOperation = null;
+                                               onEndDrag (this, IFace.DragAndDropOperation);
+                                       IFace.DragAndDropOperation = null;
                                }
                        }
 
@@ -1656,10 +1656,10 @@ namespace Crow
                        Debug.WriteLine("MouseEnter => " + this.ToString());
                        #endif
 
-                       if (CurrentInterface.DragAndDropOperation != null) {
+                       if (IFace.DragAndDropOperation != null) {
                                if (this.AllowDrop) {
-                                       if (CurrentInterface.DragAndDropOperation.DragSource != this && CurrentInterface.DragAndDropOperation.DropTarget != this)
-                                               onDragEnter (this, CurrentInterface.DragAndDropOperation);                                      
+                                       if (IFace.DragAndDropOperation.DragSource != this && IFace.DragAndDropOperation.DropTarget != this)
+                                               onDragEnter (this, IFace.DragAndDropOperation);                                 
                                }
                        }
 
@@ -1670,9 +1670,9 @@ namespace Crow
                        #if DEBUG_FOCUS
                        Debug.WriteLine("MouseLeave => " + this.ToString());
                        #endif
-                       if (CurrentInterface.DragAndDropOperation != null) {
-                               if (CurrentInterface.DragAndDropOperation.DropTarget == this)
-                                       onDragLeave (this, CurrentInterface.DragAndDropOperation);
+                       if (IFace.DragAndDropOperation != null) {
+                               if (IFace.DragAndDropOperation.DropTarget == this)
+                                       onDragLeave (this, IFace.DragAndDropOperation);
                        }
                        MouseLeave.Raise (this, e);
                }
index f8a50264ebb67eb7e4029bb537882d1ca21e152c..4ae906a783457b409f77ab3347d2f92450fd27df 100644 (file)
@@ -157,7 +157,7 @@ namespace Crow
 
                                //if no layouting remains in queue for item, registre for redraw
                                if (RegisteredLayoutings == LayoutingType.None && IsDirty)
-                                       CurrentInterface.EnqueueForRepaint (this);
+                                       IFace.EnqueueForRepaint (this);
                                
                                return true;
                        }
index e7604842ae2ee72244f7a2853e091ca7b2d56e0c..cfec77742605add4f7bd072376d0effdfd3c6d66 100644 (file)
@@ -80,9 +80,9 @@ namespace Crow
                {
                        child.LayoutChanged -= OnChildLayoutChanges;
                        //check if HoverWidget is removed from Tree
-                       if (CurrentInterface.HoverWidget != null) {
-                               if (this.Contains (CurrentInterface.HoverWidget))
-                                       CurrentInterface.HoverWidget = null;
+                       if (IFace.HoverWidget != null) {
+                               if (this.Contains (IFace.HoverWidget))
+                                       IFace.HoverWidget = null;
                        }
 
                        childrenRWLock.EnterWriteLock ();
@@ -397,8 +397,8 @@ namespace Crow
                #region Mouse handling
                public override void checkHoverWidget (MouseMoveEventArgs e)
                {
-                       if (CurrentInterface.HoverWidget != this) {
-                               CurrentInterface.HoverWidget = this;
+                       if (IFace.HoverWidget != this) {
+                               IFace.HoverWidget = this;
                                onMouseEnter (this, e);
                        }
                        for (int i = Children.Count - 1; i >= 0; i--) {
index a221a78b5f3edef25ca5114d75a05fe958bd8883..84692284f2ce3d7468f10d76fb0b3dc77bb52b61 100644 (file)
@@ -41,7 +41,7 @@ namespace Crow
                                if (path == value)
                                        return;
                                path = value;
-                               this.SetChild (CurrentInterface.Load (path));
+                               this.SetChild (IFace.Load (path));
                                NotifyValueChanged ("Path", path);
                        }
                }
index 75c59f4af63ef7d33b6a37001d0f7014dba5257c..d6392626c795c2390f9a31376d071f8f6c7dd994 100644 (file)
@@ -93,7 +93,7 @@ namespace Crow
                                        if (string.IsNullOrEmpty(value))
                                                Picture = null;
                                        else {
-                                               lock(CurrentInterface.LayoutMutex){
+                                               lock(IFace.LayoutMutex){
                                                        LoadImage (value);
                                                }
                                        }
index ea68fde006d1f9d72353026bfcd74c904c08d5df..56508d2308c9ec87f21dbd6d0bf11b2dd844920d 100644 (file)
@@ -688,12 +688,12 @@ namespace Crow
                {
                        base.onMouseEnter (sender, e);
                        if (Selectable)
-                               CurrentInterface.MouseCursor = XCursor.Text;
+                               IFace.MouseCursor = XCursor.Text;
                }
                public override void onMouseLeave (object sender, MouseMoveEventArgs e)
                {
                        base.onMouseLeave (sender, e);
-                       CurrentInterface.MouseCursor = XCursor.Default;
+                       IFace.MouseCursor = XCursor.Default;
                }
                protected override void onFocused (object sender, EventArgs e)
                {
index c0754eaa7b9bc1c21bfd99104b1f3d94fe9ffda6..e59e0e63d77b5b9e3f83e446a1b79bde6a36bff3 100644 (file)
@@ -137,7 +137,7 @@ namespace Crow
                public static MessageBox Show (Interface iface, Type msgBoxType, string message, string okMsg = "", string cancelMsg = ""){
                        lock (iface.UpdateMutex) {
                                MessageBox mb = new MessageBox (iface);
-                               mb.CurrentInterface.AddWidget (mb);
+                               mb.IFace.AddWidget (mb);
                                mb.MsgType = msgBoxType;
                                mb.Message = message;
                                if (!string.IsNullOrEmpty(okMsg))
index 70804bda2df9428dcaf6277290111fa9219d022b..1186e8e727ba1de76a9eb54ede1fca49bef52333 100644 (file)
@@ -201,8 +201,8 @@ namespace Crow
                }
                public override void checkHoverWidget (MouseMoveEventArgs e)
                {
-                       if (CurrentInterface.HoverWidget != this) {
-                               CurrentInterface.HoverWidget = this;
+                       if (IFace.HoverWidget != this) {
+                               IFace.HoverWidget = this;
                                onMouseEnter (this, e);
                        }
                        if (Content != null){
@@ -222,10 +222,10 @@ namespace Crow
                        if (Content != null) {
                                Content.Visible = true;
                                if (Content.Parent == null)
-                                       CurrentInterface.AddWidget (Content);
+                                       IFace.AddWidget (Content);
                                if (Content.LogicalParent != this)
                                        Content.LogicalParent = this;
-                               CurrentInterface.PutOnTop (Content, true);
+                               IFace.PutOnTop (Content, true);
                                _content_LayoutChanged (this, new LayoutingEventArgs (LayoutingType.Sizing));
                        }
                        Popped.Raise (this, e);
index 8383a274865ffeb62a3f1d8d4b52f194b7b0a0f5..f2626e255a17fd6dd26b02d9c534fd6d34fd1e3c 100644 (file)
@@ -52,9 +52,9 @@ namespace Crow
 
                        if (child != null) {
                                //check if HoverWidget is removed from Tree
-                               if (CurrentInterface.HoverWidget != null) {
-                                       if (this.Contains (CurrentInterface.HoverWidget))
-                                               CurrentInterface.HoverWidget = null;
+                               if (IFace.HoverWidget != null) {
+                                       if (this.Contains (IFace.HoverWidget))
+                                               IFace.HoverWidget = null;
                                }
                                contentSize = new Size (0, 0);
                                child.LayoutChanged -= OnChildLayoutChanges;
index 9059d8eda8ff722f50a0eb39467ac9c243b847ff..b636d993b9fc5aafb0148838ab676adeacd77c53 100644 (file)
@@ -148,7 +148,7 @@ namespace Crow
                public override void onMouseWheel (object sender, MouseWheelEventArgs e)
                {
                        base.onMouseWheel (sender, e);
-                       if (CurrentInterface.Keyboard.IsKeyDown (Key.ShiftLeft))
+                       if (IFace.Keyboard.IsKeyDown (Key.ShiftLeft))
                                ScrollX += e.Delta * MouseWheelSpeed;
                        else
                                ScrollY -= e.Delta * MouseWheelSpeed;
index c84594dfccb727ff5c10f7e4dc6ddea8b3ec3ab1..d3c4276e127f4918f039789c981ddb6a1fceb6e1 100644 (file)
@@ -467,12 +467,12 @@ namespace Crow
                public override void onMouseEnter (object sender, MouseMoveEventArgs e)
                {
                        base.onMouseEnter (sender, e);
-                       CurrentInterface.MouseCursor = XCursor.Text;
+                       IFace.MouseCursor = XCursor.Text;
                }
                public override void onMouseLeave (object sender, MouseMoveEventArgs e)
                {
                        base.onMouseLeave (sender, e);
-                       CurrentInterface.MouseCursor = XCursor.Default;
+                       IFace.MouseCursor = XCursor.Default;
                }
                protected override void onFocused (object sender, EventArgs e)
                {
@@ -558,7 +558,7 @@ namespace Crow
                                        if (!MoveRight ())
                                                return;
                                }else if (e.Shift)
-                                       CurrentInterface.Clipboard = this.SelectedText;
+                                       IFace.Clipboard = this.SelectedText;
                                this.DeleteChar ();
                                break;
                        case Key.Enter:
@@ -604,9 +604,9 @@ namespace Crow
                                break;
                        case Key.Insert:
                                if (e.Shift)
-                                       this.Insert (CurrentInterface.Clipboard);
+                                       this.Insert (IFace.Clipboard);
                                else if (e.Control && !selectionIsEmpty)
-                                       CurrentInterface.Clipboard = this.SelectedText;
+                                       IFace.Clipboard = this.SelectedText;
                                break;
                        case Key.Left:
                                if (e.Shift) {
index c688f773f404d4ff3f74deb669ce7a8298bcdb07..e8aa60f80fc5a2db46e566feeb29069c33d5f1d1 100644 (file)
@@ -91,14 +91,14 @@ namespace Crow
                {
                        base.onMouseEnter (sender, e);
                        if ((Parent as GenericStack).Orientation == Orientation.Horizontal)
-                               CurrentInterface.MouseCursor = XCursor.H;
+                               IFace.MouseCursor = XCursor.H;
                        else
-                               CurrentInterface.MouseCursor = XCursor.V;
+                               IFace.MouseCursor = XCursor.V;
                }
                public override void onMouseLeave (object sender, MouseMoveEventArgs e)
                {
                        base.onMouseLeave (sender, e);
-                       CurrentInterface.MouseCursor = XCursor.Default;
+                       IFace.MouseCursor = XCursor.Default;
                }
                public override void onMouseDown (object sender, MouseButtonEventArgs e)
                {
index abaa6ac0f4a2b5934d999a86eb977dff75ede7d4..707e1dcf56ff41f311678cfad5c97df153701954 100644 (file)
@@ -153,7 +153,7 @@ namespace Crow
 
                                //if no layouting remains in queue for item, registre for redraw
                                if (RegisteredLayoutings == LayoutingType.None && IsDirty)
-                                       CurrentInterface.EnqueueForRepaint (this);
+                                       IFace.EnqueueForRepaint (this);
 
                                return true;
                        }
@@ -196,8 +196,8 @@ namespace Crow
                #region Mouse handling
                public override void checkHoverWidget (MouseMoveEventArgs e)
                {
-                       if (CurrentInterface.HoverWidget != this) {
-                               CurrentInterface.HoverWidget = this;
+                       if (IFace.HoverWidget != this) {
+                               IFace.HoverWidget = this;
                                onMouseEnter (this, e);
                        }
 
index e0e77fc0d7c0217f6b4c428b561be564e048b4ad..c231fd0f8a0938b59d0b8cb6228876a22a094e55 100644 (file)
@@ -66,7 +66,7 @@ namespace Crow
                                if (string.IsNullOrEmpty(_template))
                                        loadTemplate ();
                                else
-                                       loadTemplate (CurrentInterface.Load (_template));
+                                       loadTemplate (IFace.Load (_template));
                        }
                }
                /// <summary>
@@ -133,9 +133,9 @@ namespace Crow
                                this.ClearTemplateBinding();
                        
                        if (template == null) {
-                               if (!CurrentInterface.DefaultTemplates.ContainsKey (this.GetType ().FullName))
+                               if (!IFace.DefaultTemplates.ContainsKey (this.GetType ().FullName))
                                        throw new Exception (string.Format ("No default template found for '{0}'", this.GetType ().FullName));
-                               this.SetChild (CurrentInterface.Load (CurrentInterface.DefaultTemplates[this.GetType ().FullName]));
+                               this.SetChild (IFace.Load (IFace.DefaultTemplates[this.GetType ().FullName]));
                        }else
                                this.SetChild (template);
                }
index cf378dbd8fc6cdd91aae6314f6b8721255622beb..8e0ffb448d9cc7f716fbcf93a1df6f676d8cdbc4 100644 (file)
@@ -427,7 +427,7 @@ namespace Crow
                                        iTemp = ItemTemplates ["default"];
                        }
 
-                       lock (CurrentInterface.LayoutMutex) {
+                       lock (IFace.LayoutMutex) {
                                g = iTemp.CreateInstance();
                                page.AddChild (g);
 //                             if (isPaged)
index a14aea6ad1b2a7c59fb949b6bf16594163b12de7..e29ff9bf44c81157fa800e2a05a0ba9a0fcddd23 100644 (file)
@@ -86,7 +86,7 @@ namespace Crow
                                        if (!MoveRight ())
                                                return;
                                }else if (e.Shift)
-                                       CurrentInterface.Clipboard = this.SelectedText;
+                                       IFace.Clipboard = this.SelectedText;
                                this.DeleteChar ();
                                break;
                        case Key.Enter:
@@ -135,9 +135,9 @@ namespace Crow
                                break;
                        case Key.Insert:
                                if (e.Shift)
-                                       this.Insert (CurrentInterface.Clipboard);
+                                       this.Insert (IFace.Clipboard);
                                else if (e.Control && !selectionIsEmpty)
-                                       CurrentInterface.Clipboard = this.SelectedText;
+                                       IFace.Clipboard = this.SelectedText;
                                break;
                        case Key.Left:
                                if (e.Shift) {
index bbfb196dc1973c1c953f5949f55585b993a0d922..cff96a7574d946a2b0cfd87168fc21c86533c4d9 100644 (file)
@@ -175,7 +175,7 @@ namespace Crow
                                alwaysOnTop = value;
 
                                if (alwaysOnTop && Parent != null)
-                                       CurrentInterface.PutOnTop (this);
+                                       IFace.PutOnTop (this);
 
                                NotifyValueChanged ("AlwaysOnTop", alwaysOnTop);
                        }
@@ -278,11 +278,11 @@ namespace Crow
                {
                        base.onMouseMove (sender, e);
 
-                       Interface otkgw = CurrentInterface;
+                       Interface otkgw = IFace;
 
                        if (!hoverBorder) {
                                currentDirection = Direction.None;
-                               CurrentInterface.MouseCursor = XCursor.Default;
+                               IFace.MouseCursor = XCursor.Default;
                                return;
                        }
 
@@ -356,7 +356,7 @@ namespace Crow
                #endregion
 
                protected void onMaximized (object sender, EventArgs e){
-                       lock (CurrentInterface.LayoutMutex) {
+                       lock (IFace.LayoutMutex) {
                                if (!IsMinimized)
                                        savedBounds = this.LastPaintedSlot;
                                this.Left = this.Top = 0;
@@ -372,7 +372,7 @@ namespace Crow
                        Maximized.Raise (sender, e);
                }
                protected void onUnmaximized (object sender, EventArgs e){
-                       lock (CurrentInterface.LayoutMutex) {
+                       lock (IFace.LayoutMutex) {
                                this.Left = savedBounds.Left;
                                this.Top = savedBounds.Top;
                                this.Width = savedBounds.Width;
@@ -387,7 +387,7 @@ namespace Crow
                        Unmaximized.Raise (sender, e);
                }
                protected void onMinimized (object sender, EventArgs e){
-                       lock (CurrentInterface.LayoutMutex) {
+                       lock (IFace.LayoutMutex) {
                                if (IsNormal)
                                        savedBounds = this.LastPaintedSlot;
                                Width = 200;
@@ -405,7 +405,7 @@ namespace Crow
                {
                        hoverBorder = false;
                        currentDirection = Direction.None;
-                       CurrentInterface.MouseCursor = XCursor.Default;
+                       IFace.MouseCursor = XCursor.Default;
                }
                protected virtual void onBorderMouseEnter (object sender, MouseMoveEventArgs e)
                {
@@ -415,7 +415,7 @@ namespace Crow
 
                protected void butQuitPress (object sender, MouseButtonEventArgs e)
                {
-                       CurrentInterface.MouseCursor = XCursor.Default;
+                       IFace.MouseCursor = XCursor.Default;
                        close ();
                }
 
index 4fff17ff329177bd2d4ed95e115ce6e842f7603f..3f5dfdf0ce2c93be57088ff81f841a5f9735add0 100644 (file)
@@ -207,7 +207,7 @@ namespace Crow
 
                                //if no layouting remains in queue for item, registre for redraw
                                if (RegisteredLayoutings == LayoutingType.None && IsDirty)
-                                       CurrentInterface.EnqueueForRepaint (this);
+                                       IFace.EnqueueForRepaint (this);
 
                                return true;
                        }
index ee95eeb54047e65073bf8dce95f78f95f7f17846..5174e37e698a44eb8cd65c410817b0764d546417 100644 (file)
@@ -344,12 +344,20 @@ namespace Crow
                /// <param name="imlFragment">a valid IML string</param>
                public GraphicObject LoadIMLFragment (string imlFragment) {
                        lock (UpdateMutex) {
-                               GraphicObject tmp = Instantiator.CreateFromImlFragment (this, imlFragment).CreateInstance();
+                               GraphicObject tmp = CreateITorFromIMLFragment (imlFragment).CreateInstance();
                                AddWidget (tmp);
                                return tmp;
                        }
                }
                /// <summary>
+               /// Add the content of the IML fragment to the graphic tree of this interface
+               /// </summary>
+               /// <returns>return the new instance for convenience, may be ignored</returns>
+               /// <param name="imlFragment">a valid IML string</param>
+               public Instantiator CreateITorFromIMLFragment (string imlFragment) {                    
+                       return Instantiator.CreateFromImlFragment (this, imlFragment);
+               }
+               /// <summary>
                /// Create an instance of a GraphicObject and add it to the GraphicTree of this Interface
                /// </summary>
                /// <returns>new instance of graphic object created</returns>
index ba2f95af41cbd7ae33338c66b8c1e9ed0c586835..08810aaa62f3e88e83e07eda535969472a124002 100644 (file)
@@ -125,7 +125,7 @@ namespace Crow
                                #endif
                                if (LayoutingTries < Interface.MaxLayoutingTries) {
                                        Layoutable.RegisteredLayoutings |= LayoutType;
-                                       (Layoutable as GraphicObject).CurrentInterface.LayoutingQueue.Enqueue (this);
+                                       (Layoutable as GraphicObject).IFace.LayoutingQueue.Enqueue (this);
                                } else if (DiscardCount < Interface.MaxDiscardCount) {
                                        #if DEBUG_LAYOUTING
                                        Debug.WriteLine ("\t\tDiscarded");
@@ -133,7 +133,7 @@ namespace Crow
                                        LayoutingTries = 0;
                                        DiscardCount++;
                                        Layoutable.RegisteredLayoutings |= LayoutType;
-                                       (Layoutable as GraphicObject).CurrentInterface.DiscardQueue.Enqueue (this);
+                                       (Layoutable as GraphicObject).IFace.DiscardQueue.Enqueue (this);
                                }
                                #if DEBUG_LAYOUTING
                                else