]> O.S.I.I.S - jp/crow.git/commitdiff
remove Initialise, currentInterface is set by instanciator
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 26 Aug 2017 08:24:39 +0000 (10:24 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 26 Aug 2017 08:24:39 +0000 (10:24 +0200)
22 files changed:
Tests/CrowWindow.cs
src/CrowThread.cs
src/GraphicObjects/ColorSelector.cs
src/GraphicObjects/FileDialog.cs
src/GraphicObjects/GenericStack.cs
src/GraphicObjects/GraphicObject.cs
src/GraphicObjects/Grid.cs
src/GraphicObjects/Group.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/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/LayoutingQueueItem.cs

index 2934af23c83a7f208a482d711d88ddfca70ad55c..e66fa7b3ca1df9bfcad51ae222add2b4d5aa3fa3 100644 (file)
@@ -63,7 +63,7 @@ namespace Crow
                                        ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMin", fpsMin));
                                }
                                #endif
-                               if (frameCpt % 3 == 0) {
+                               if (frameCpt % 20 == 0) {
                                        ValueChanged.Raise (this, new ValueChangeEventArgs ("fps", _fps));
                                        #if MEASURE_TIME
                                        foreach (PerformanceMeasure m in ifaceControl[0].PerfMeasures)
index ece87fa80e46f8f99ed4ab709045c82f6f80df20..857ec1a32fdb3456c98e0fa3e406f31a0b274786 100644 (file)
@@ -40,15 +40,15 @@ namespace Crow
                        thread = new Thread (start);
                        thread.IsBackground = true;
                        Host = host;
-                       lock (Host.CurrentInterface.CrowThreads)
-                               Host.CurrentInterface.CrowThreads.Add (this);
+                       lock (Host.currentInterface.CrowThreads)
+                               Host.currentInterface.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.currentInterface.CrowThreads)
+                               Host.currentInterface.CrowThreads.Remove (this);
                }
                public void Start() { thread.Start();}
                public void Cancel(){
@@ -57,8 +57,8 @@ namespace Crow
                                thread.Join ();
                                //cancelLoading = false;
                        }
-                       lock (Host.CurrentInterface.CrowThreads)
-                               Host.CurrentInterface.CrowThreads.Remove (this);
+                       lock (Host.currentInterface.CrowThreads)
+                               Host.currentInterface.CrowThreads.Remove (this);
                }
        }
 }
index c9f3a19869da776fd656f571e80584e2eb70dcd0..596d332e91697626df2ebcdf529292ca93ed3151 100644 (file)
@@ -43,7 +43,7 @@ namespace Crow
                public override void onMouseMove (object sender, MouseMoveEventArgs e)
                {
                        base.onMouseMove (sender, e);
-                       if (CurrentInterface.Mouse.LeftButton == ButtonState.Released)
+                       if (currentInterface.Mouse.LeftButton == ButtonState.Released)
                                return;
                        updateMouseLocalPos (e.Position);
                }
index 8182e02166dc3818125e32a4d09b6942e8a3ebbd..47a6fb54e32a107fbb977bd73ed916e4aaf8b312 100644 (file)
@@ -117,11 +117,11 @@ namespace Crow
                                CurrentDirectory = SelectedDirectory;
                        else {
                                OkClicked.Raise (this, null);
-                               unloadDialog ((sender as GraphicObject).CurrentInterface);
+                               unloadDialog ((sender as GraphicObject).currentInterface);
                        }
                }
                void onCancel(object sender, MouseButtonEventArgs e){
-                       unloadDialog ((sender as GraphicObject).CurrentInterface);
+                       unloadDialog ((sender as GraphicObject).currentInterface);
                }
                void unloadDialog(Interface host){
                        host.DeleteWidget (this);
index cecdaffd5116825561ac2114810960b28fe8042b..77f1cb1f922c637cecce8551601c8995ef26a003 100644 (file)
@@ -127,7 +127,7 @@ namespace Crow
 
                                //if no layouting remains in queue for item, registre for redraw
                                if (RegisteredLayoutings == LayoutingType.None && IsDirty)
-                                       CurrentInterface.EnqueueForRepaint (this);
+                                       currentInterface.EnqueueForRepaint (this);
 
                                return true;
                        }
index 41738802701ade171c2351652aedd9b3dc719ceb..aad6e327f50abd448abe2e012516d3fa3cd9d7d4 100644 (file)
@@ -43,20 +43,7 @@ namespace Crow
                internal static ulong currentUid = 0;
                internal ulong uid = 0;
 
-               Interface currentInterface = null;
-
-               [XmlIgnore]public Interface CurrentInterface {
-                       get {
-                               if (currentInterface == null) {
-                                       currentInterface = Interface.CurrentInterface;
-                                       Initialize ();
-                               }
-                               return currentInterface;
-                       }
-                       set {
-                               currentInterface = value;
-                       }
-               }
+               internal Interface currentInterface = null;
 
                public Region Clipping;
 
@@ -72,23 +59,12 @@ namespace Crow
                #region CTOR
                public GraphicObject ()
                {
-                       Clipping = new Region ();
                        #if DEBUG
                        uid = currentUid;
                        currentUid++;
                        #endif
                }
                #endregion
-               internal bool initialized = false;
-               /// <summary>
-               /// Initialize this Graphic object instance by setting style and default values and loading template if required
-               /// </summary>
-               public virtual void Initialize(){
-                       if (currentInterface == null)
-                               currentInterface = Interface.CurrentInterface;                  
-                       loadDefaultValues ();
-                       initialized = true;
-               }
                #region private fields
                LayoutingType registeredLayoutings = LayoutingType.All;
                ILayoutable logicalParent;
@@ -653,6 +629,8 @@ namespace Crow
                        Debug.WriteLine ("LoadDefValues for " + this.ToString ());
                        #endif
 
+                       Clipping = new Region ();
+
                        Type thisType = this.GetType ();
 
                        if (!string.IsNullOrEmpty (Style)) {
@@ -861,7 +839,7 @@ namespace Crow
                        if (Width.IsFit || Height.IsFit)
                                RegisterForLayouting (LayoutingType.Sizing);
                        else if (RegisteredLayoutings == LayoutingType.None)
-                               CurrentInterface.EnqueueForRepaint (this);
+                               currentInterface.EnqueueForRepaint (this);
                }
                /// <summary> query an update of the content, a redraw </summary>
                [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -869,7 +847,7 @@ namespace Crow
                {
                        IsDirty = true;
                        if (RegisteredLayoutings == LayoutingType.None)
-                               CurrentInterface.EnqueueForRepaint (this);
+                               currentInterface.EnqueueForRepaint (this);
                }
                #endregion
 
@@ -881,13 +859,12 @@ namespace Crow
                                contentSize.Width + 2 * Margin: contentSize.Height + 2 * Margin;
                }
                /// <summary> By default in groups, LayoutingType.ArrangeChildren is reset </summary>
-               public virtual void ChildrenLayoutingConstraints(ref LayoutingType layoutType){
-               }
+               public virtual void ChildrenLayoutingConstraints(ref LayoutingType layoutType){}
                public virtual bool ArrangeChildren { get { return false; } }
                public virtual void RegisterForLayouting(LayoutingType layoutType){
                        if (Parent == null)
                                return;
-                       lock (CurrentInterface.LayoutMutex) {
+                       lock (currentInterface.LayoutMutex) {
                                //prevent queueing same LayoutingType for this
                                layoutType &= (~RegisteredLayoutings);
 
@@ -906,23 +883,20 @@ namespace Crow
                                if (Parent is GraphicObject)
                                        (Parent as GraphicObject).ChildrenLayoutingConstraints (ref layoutType);
 
-//                             //prevent queueing same LayoutingType for this
-//                             layoutType &= (~RegisteredLayoutings);
-
                                if (layoutType == LayoutingType.None)
                                        return;
 
                                //enqueue LQI LayoutingTypes separately
                                if (layoutType.HasFlag (LayoutingType.Width))
-                                       CurrentInterface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Width, this));
+                                       currentInterface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Width, this));
                                if (layoutType.HasFlag (LayoutingType.Height))
-                                       CurrentInterface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Height, this));
+                                       currentInterface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Height, this));
                                if (layoutType.HasFlag (LayoutingType.X))
-                                       CurrentInterface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.X, this));
+                                       currentInterface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.X, this));
                                if (layoutType.HasFlag (LayoutingType.Y))
-                                       CurrentInterface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Y, this));
+                                       currentInterface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Y, this));
                                if (layoutType.HasFlag (LayoutingType.ArrangeChildren))
-                                       CurrentInterface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.ArrangeChildren, this));
+                                       currentInterface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.ArrangeChildren, this));
                        }
                }
 
@@ -1095,7 +1069,7 @@ namespace Crow
 
                        //if no layouting remains in queue for item, registre for redraw
                        if (this.registeredLayoutings == LayoutingType.None && IsDirty)
-                               CurrentInterface.EnqueueForRepaint (this);
+                               currentInterface.EnqueueForRepaint (this);
 
                        return true;
                }
@@ -1219,8 +1193,8 @@ namespace Crow
                }
                public virtual void checkHoverWidget(MouseMoveEventArgs e)
                {
-                       if (CurrentInterface.HoverWidget != this) {
-                               CurrentInterface.HoverWidget = this;
+                       if (currentInterface.HoverWidget != this) {
+                               currentInterface.HoverWidget = this;
                                onMouseEnter (this, e);
                        }
 
@@ -1236,19 +1210,19 @@ namespace Crow
                        MouseMove.Raise (this, e);
                }
                public virtual void onMouseDown(object sender, MouseButtonEventArgs e){
-                       if (CurrentInterface.eligibleForDoubleClick == this && CurrentInterface.clickTimer.ElapsedMilliseconds < Interface.DoubleClick)
+                       if (currentInterface.eligibleForDoubleClick == this && currentInterface.clickTimer.ElapsedMilliseconds < Interface.DoubleClick)
                                onMouseDoubleClick (this, e);
                        else
                                currentInterface.clickTimer.Restart();
-                       CurrentInterface.eligibleForDoubleClick = null;
+                       currentInterface.eligibleForDoubleClick = null;
 
-                       if (CurrentInterface.ActiveWidget == null)
-                               CurrentInterface.ActiveWidget = this;
+                       if (currentInterface.ActiveWidget == null)
+                               currentInterface.ActiveWidget = this;
                        if (this.Focusable && !Interface.FocusOnHover) {
                                BubblingMouseButtonEventArg be = e as BubblingMouseButtonEventArg;
                                if (be.Focused == null) {
                                        be.Focused = this;
-                                       CurrentInterface.FocusedWidget = this;
+                                       currentInterface.FocusedWidget = this;
                                }
                        }
                        //bubble event to the top
@@ -1267,8 +1241,8 @@ namespace Crow
                        MouseUp.Raise (this, e);
 
                        if (MouseIsIn (e.Position) && IsActive) {
-                               if (CurrentInterface.clickTimer.ElapsedMilliseconds < Interface.DoubleClick)
-                                       CurrentInterface.eligibleForDoubleClick = this;
+                               if (currentInterface.clickTimer.ElapsedMilliseconds < Interface.DoubleClick)
+                                       currentInterface.eligibleForDoubleClick = this;
                                onMouseClick (this, e);
                        }
                }
index 3d1847a28502f0d7783cf1c432927873b7e0dc66..b2a13150311b5617be7edd74bff282e369df48d8 100644 (file)
@@ -161,7 +161,7 @@ namespace Crow
 
                                //if no layouting remains in queue for item, registre for redraw
                                if (RegisteredLayoutings == LayoutingType.None && IsDirty)
-                                       CurrentInterface.EnqueueForRepaint (this);
+                                       currentInterface.EnqueueForRepaint (this);
                                
                                return true;
                        }
index f3c357d2ecf63e1f4d373c7b12106bc580c41154..a02b9669ac7a1d6ab2d48ce5f55c83c6deb562bb 100644 (file)
@@ -76,9 +76,9 @@ namespace Crow
                        //child.Parent = null;
 
                        //check if HoverWidget is removed from Tree
-                       if (CurrentInterface.HoverWidget != null) {
-                               if (this.Contains (CurrentInterface.HoverWidget))
-                                       CurrentInterface.HoverWidget = null;
+                       if (currentInterface.HoverWidget != null) {
+                               if (this.Contains (currentInterface.HoverWidget))
+                                       currentInterface.HoverWidget = null;
                        }
 
                        lock (children)
@@ -350,8 +350,8 @@ namespace Crow
                #region Mouse handling
                public override void checkHoverWidget (MouseMoveEventArgs e)
                {
-                       if (CurrentInterface.HoverWidget != this) {
-                               CurrentInterface.HoverWidget = this;
+                       if (currentInterface.HoverWidget != this) {
+                               currentInterface.HoverWidget = this;
                                onMouseEnter (this, e);
                        }
                        for (int i = Children.Count - 1; i >= 0; i--) {
index 6a4c590d0b274ed27b17c3343e2e68fd8a7538c2..f2d540be06cd62b2cdfd975cccd4bb297bcc173e 100644 (file)
@@ -79,7 +79,7 @@ namespace Crow
                                        if (string.IsNullOrEmpty(value))
                                                Picture = null;
                                        else {
-                                               lock(CurrentInterface.LayoutMutex){
+                                               lock(currentInterface.LayoutMutex){
                                                        LoadImage (value);
                                                }
                                        }
index 64ee9688c384276c2e6ef1d07acd93026a864794..7a802bda13ade2dcb1cdcb327d707b9b64cbef90 100644 (file)
@@ -686,12 +686,12 @@ namespace Crow
                {
                        base.onMouseEnter (sender, e);
                        if (Selectable)
-                               CurrentInterface.MouseCursor = XCursor.Text;
+                               currentInterface.MouseCursor = XCursor.Text;
                }
                public override void onMouseLeave (object sender, MouseMoveEventArgs e)
                {
                        base.onMouseLeave (sender, e);
-                       CurrentInterface.MouseCursor = XCursor.Default;
+                       currentInterface.MouseCursor = XCursor.Default;
                }
                protected override void onFocused (object sender, EventArgs e)
                {
index d8ce1dae7d401b327d0a3ad08f9157ece9a4e722..8c8380efe16c1e0bfc5e3b76e9be072d0c083922 100644 (file)
@@ -134,8 +134,8 @@ namespace Crow
                public static MessageBox Show (Type msgBoxType, string message, string okMsg = "", string cancelMsg = ""){
                        lock (Interface.CurrentInterface.UpdateMutex) {
                                MessageBox mb = new MessageBox ();
-                               mb.Initialize ();
-                               mb.CurrentInterface.AddWidget (mb);
+                               mb.loadDefaultValues ();
+                               mb.currentInterface.AddWidget (mb);
                                mb.MsgType = msgBoxType;
                                mb.Message = message;
                                if (!string.IsNullOrEmpty(okMsg))
index 0e5364d6c8ca56809639ce38773c1ebedd596c70..3ba6d71195f1f5b34b48721fdec618f1a6415a06 100644 (file)
@@ -204,8 +204,8 @@ namespace Crow
                }
                public override void checkHoverWidget (MouseMoveEventArgs e)
                {
-                       if (CurrentInterface.HoverWidget != this) {
-                               CurrentInterface.HoverWidget = this;
+                       if (currentInterface.HoverWidget != this) {
+                               currentInterface.HoverWidget = this;
                                onMouseEnter (this, e);
                        }
                        if (Content != null){
@@ -225,10 +225,10 @@ namespace Crow
                        if (Content != null) {
                                Content.Visible = true;
                                if (Content.Parent == null)
-                                       CurrentInterface.AddWidget (Content, true);
+                                       currentInterface.AddWidget (Content, true);
                                if (Content.LogicalParent != this)
                                        Content.LogicalParent = this;
-                               CurrentInterface.PutOnTop (Content, true);
+                               currentInterface.PutOnTop (Content, true);
                                _content_LayoutChanged (this, new LayoutingEventArgs (LayoutingType.Sizing));
                        }
                        Popped.Raise (this, e);
index 02e251bea1bbdecb4bfbd0ca776cfdec310d1dd4..499f998f486557a97a2c50ec09d39c9069d9c6ca 100644 (file)
@@ -54,9 +54,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 (currentInterface.HoverWidget != null) {
+                                       if (this.Contains (currentInterface.HoverWidget))
+                                               currentInterface.HoverWidget = null;
                                }
                                contentSize = new Size (0, 0);
                                child.LayoutChanged -= OnChildLayoutChanges;
index 330b230d5680b40e6789defe04ce50abc601c1b1..8b9bc58aff54b01a01f776861a1e404e44b40c72 100644 (file)
@@ -141,7 +141,7 @@ namespace Crow
                public override void onMouseWheel (object sender, MouseWheelEventArgs e)
                {
                        base.onMouseWheel (sender, e);
-                       if (CurrentInterface.Keyboard.IsKeyDown (Key.ShiftLeft))
+                       if (currentInterface.Keyboard.IsKeyDown (Key.ShiftLeft))
                                ScrollY += e.Delta * MouseWheelSpeed;
                        else
                                ScrollX += e.Delta * MouseWheelSpeed;
index 2f5dd15b9601a2b6bcf68b72a8ab6fd0ad317608..503e1ecaf7612374e8d71a139283ee2e028f6032 100644 (file)
@@ -86,14 +86,14 @@ namespace Crow
                {
                        base.onMouseEnter (sender, e);
                        if ((Parent as GenericStack).Orientation == Orientation.Horizontal)
-                               CurrentInterface.MouseCursor = XCursor.H;
+                               currentInterface.MouseCursor = XCursor.H;
                        else
-                               CurrentInterface.MouseCursor = XCursor.V;
+                               currentInterface.MouseCursor = XCursor.V;
                }
                public override void onMouseLeave (object sender, MouseMoveEventArgs e)
                {
                        base.onMouseLeave (sender, e);
-                       CurrentInterface.MouseCursor = XCursor.Default;
+                       currentInterface.MouseCursor = XCursor.Default;
                }
                public override void onMouseDown (object sender, MouseButtonEventArgs e)
                {
index ecf38f109a692fb789c80f75b828cb3f69ec8a6a..c0c07fc760bb0557b7036dd489849e745de4d18a 100644 (file)
@@ -139,7 +139,7 @@ namespace Crow
 
                                //if no layouting remains in queue for item, registre for redraw
                                if (RegisteredLayoutings == LayoutingType.None && IsDirty)
-                                       CurrentInterface.EnqueueForRepaint (this);
+                                       currentInterface.EnqueueForRepaint (this);
 
                                return true;
                        }
@@ -177,8 +177,8 @@ namespace Crow
                #region Mouse handling
                public override void checkHoverWidget (MouseMoveEventArgs e)
                {
-                       if (CurrentInterface.HoverWidget != this) {
-                               CurrentInterface.HoverWidget = this;
+                       if (currentInterface.HoverWidget != this) {
+                               currentInterface.HoverWidget = this;
                                onMouseEnter (this, e);
                        }
 
index 0461a8eedf8a5bcb69cecca65a6d8946fd392073..b0d752eda18ff51b29b40e008a98675317f4325d 100644 (file)
@@ -59,7 +59,7 @@ namespace Crow
                                if (string.IsNullOrEmpty(_template))
                                        loadTemplate ();
                                else
-                                       loadTemplate (CurrentInterface.Load (_template));
+                                       loadTemplate (currentInterface.Load (_template));
                        }
                }
                [XmlAttributeAttribute()][DefaultValue("Templated Control")]
@@ -73,11 +73,6 @@ namespace Crow
                        }
                }
                #region GraphicObject overrides
-               public override void Initialize ()
-               {
-                       loadTemplate ();
-                       base.Initialize ();
-               }
                public override GraphicObject FindByName (string nameToFind)
                {
                        //prevent name searching in template
@@ -107,7 +102,7 @@ namespace Crow
                        if (template == null) {
                                if (!Interface.DefaultTemplates.ContainsKey (this.GetType ().FullName))
                                        throw new Exception (string.Format ("No default template found for '{0}'", this.GetType ().FullName));
-                               this.SetChild (CurrentInterface.Load (Interface.DefaultTemplates[this.GetType ().FullName]));
+                               this.SetChild (currentInterface.Load (Interface.DefaultTemplates[this.GetType ().FullName]));
                        }else
                                this.SetChild (template);
                }
index eea3a18477393d31ae20eb6fbb36b3054bb65d61..4e9975983b51b17229ee6aeb1951613cc8b5683b 100644 (file)
@@ -160,7 +160,7 @@ namespace Crow
 
                                NotifyValueChanged ("Data", data);
 
-                               lock (CurrentInterface.LayoutMutex)
+                               lock (currentInterface.LayoutMutex)
                                        ClearItems ();
 
                                if (data == null)
@@ -297,8 +297,8 @@ namespace Crow
                                itemPerPage = int.MaxValue;
                        } else if (typeof(GenericStack).IsAssignableFrom (items.GetType ())) {
                                GenericStack gs = new GenericStack ();
-                               gs.CurrentInterface = items.CurrentInterface;
-                               gs.Initialize ();
+                               gs.currentInterface = items.currentInterface;
+                               gs.loadDefaultValues ();
                                gs.Orientation = (items as GenericStack).Orientation;
                                gs.Width = items.Width;
                                gs.Height = items.Height;
@@ -324,7 +324,7 @@ namespace Crow
 
                        if (page == items)
                                return;
-                       lock (CurrentInterface.LayoutMutex)
+                       lock (currentInterface.LayoutMutex)
                                items.AddChild (page);
 
                        #if DEBUG_LOAD
@@ -377,8 +377,8 @@ namespace Crow
                                        iTemp = ItemTemplates ["default"];
                        }
 
-                       lock (CurrentInterface.LayoutMutex) {
-                               g = iTemp.CreateInstance(CurrentInterface);
+                       lock (currentInterface.LayoutMutex) {
+                               g = iTemp.CreateInstance(currentInterface);
                                page.AddChild (g);
                                //g.LogicalParent = this;
                                registerItemClick (g);
index 0cbee9f8a4e560b16731be318f1814bea79c6e11..5e2d55cbeac0fdc36210bda850455a5a2e0f71d0 100644 (file)
@@ -85,7 +85,7 @@ namespace Crow
                                        if (!MoveRight ())
                                                return;
                                }else if (e.Shift)
-                                       CurrentInterface.Clipboard = this.SelectedText;
+                                       currentInterface.Clipboard = this.SelectedText;
                                this.DeleteChar ();
                                break;
                        case Key.Enter:
@@ -134,9 +134,9 @@ namespace Crow
                                break;
                        case Key.Insert:
                                if (e.Shift)
-                                       this.Insert (CurrentInterface.Clipboard);
+                                       this.Insert (currentInterface.Clipboard);
                                else if (e.Control && !selectionIsEmpty)
-                                       CurrentInterface.Clipboard = this.SelectedText;
+                                       currentInterface.Clipboard = this.SelectedText;
                                break;
                        case Key.Left:
                                if (e.Shift) {
index 8a6903f601c41ee14f386617be8a0b5bfb654a74..e0c97ea99b7b8b0dc0d83038f38c3e58913be6de 100644 (file)
@@ -152,7 +152,7 @@ namespace Crow
                                alwaysOnTop = value;
 
                                if (alwaysOnTop && Parent != null)
-                                       CurrentInterface.PutOnTop (this);
+                                       currentInterface.PutOnTop (this);
 
                                NotifyValueChanged ("AlwaysOnTop", alwaysOnTop);
                        }
@@ -178,11 +178,11 @@ namespace Crow
                {
                        base.onMouseMove (sender, e);
 
-                       Interface otkgw = CurrentInterface;
+                       Interface otkgw = currentInterface;
 
                        if (!hoverBorder) {
                                currentDirection = Direction.None;
-                               CurrentInterface.MouseCursor = XCursor.Default;
+                               currentInterface.MouseCursor = XCursor.Default;
                                return;
                        }
 
@@ -323,7 +323,7 @@ namespace Crow
                #endregion
 
                protected void onMaximized (object sender, EventArgs e){
-                       lock (CurrentInterface.LayoutMutex) {
+                       lock (currentInterface.LayoutMutex) {
                                if (!IsMinimized)
                                        savedBounds = this.LastPaintedSlot;
                                this.Left = this.Top = 0;
@@ -342,7 +342,7 @@ namespace Crow
 
                }
                protected void onUnmaximized (object sender, EventArgs e){
-                       lock (CurrentInterface.LayoutMutex) {
+                       lock (currentInterface.LayoutMutex) {
                                this.Left = savedBounds.Left;
                                this.Top = savedBounds.Top;
                                this.Width = savedBounds.Width;
@@ -357,7 +357,7 @@ namespace Crow
                        Unmaximized.Raise (sender, e);
                }
                protected void onMinimized (object sender, EventArgs e){
-                       lock (CurrentInterface.LayoutMutex) {
+                       lock (currentInterface.LayoutMutex) {
                                if (IsNormal)
                                        savedBounds = this.LastPaintedSlot;
                                Width = 200;
@@ -375,7 +375,7 @@ namespace Crow
                {
                        hoverBorder = false;
                        currentDirection = Direction.None;
-                       CurrentInterface.MouseCursor = XCursor.Default;
+                       currentInterface.MouseCursor = XCursor.Default;
                }
                protected void onBorderMouseEnter (object sender, MouseMoveEventArgs e)
                {
@@ -385,13 +385,13 @@ namespace Crow
 
                protected void butQuitPress (object sender, MouseButtonEventArgs e)
                {
-                       CurrentInterface.MouseCursor = XCursor.Default;
+                       currentInterface.MouseCursor = XCursor.Default;
                        close ();
                }
 
                protected void close(){
                        Closing.Raise (this, null);
-                       CurrentInterface.DeleteWidget (this);
+                       currentInterface.DeleteWidget (this);
                }
        }
 }
index 8b282ebbce528908981925d1af7d6e5fee849031..224109193aaa2847c0ea9bca9edb078de560a1e9 100644 (file)
@@ -189,7 +189,7 @@ namespace Crow
 
                                //if no layouting remains in queue for item, registre for redraw
                                if (RegisteredLayoutings == LayoutingType.None && IsDirty)
-                                       CurrentInterface.EnqueueForRepaint (this);
+                                       currentInterface.EnqueueForRepaint (this);
 
                                return true;
                        }
index 7f272d982bacff25752ed9fc8ad4e928a7c9d5c6..47807a9939a2bd2d65150fde85de0ff522cd3ee5 100644 (file)
@@ -116,7 +116,7 @@ namespace Crow
                                #endif
                                if (LayoutingTries < Interface.MaxLayoutingTries) {
                                        Layoutable.RegisteredLayoutings |= LayoutType;
-                                       (Layoutable as GraphicObject).CurrentInterface.LayoutingQueue.Enqueue (this);
+                                       (Layoutable as GraphicObject).currentInterface.LayoutingQueue.Enqueue (this);
                                } else if (DiscardCount < Interface.MaxDiscardCount) {
                                        #if DEBUG_LAYOUTING
                                        Debug.WriteLine ("\t\tDiscarded");
@@ -124,7 +124,7 @@ namespace Crow
                                        LayoutingTries = 0;
                                        DiscardCount++;
                                        Layoutable.RegisteredLayoutings |= LayoutType;
-                                       (Layoutable as GraphicObject).CurrentInterface.DiscardQueue.Enqueue (this);
+                                       (Layoutable as GraphicObject).currentInterface.DiscardQueue.Enqueue (this);
                                }
                                #if DEBUG_LAYOUTING
                                else