From: Jean-Philippe Bruyère Date: Sat, 26 Aug 2017 08:24:39 +0000 (+0200) Subject: remove Initialise, currentInterface is set by instanciator X-Git-Tag: 0.6.0~30 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=65cf1452510c336fcd69f9922774389d6c3b1aee;p=jp%2Fcrow.git remove Initialise, currentInterface is set by instanciator --- diff --git a/Tests/CrowWindow.cs b/Tests/CrowWindow.cs index 2934af23..e66fa7b3 100644 --- a/Tests/CrowWindow.cs +++ b/Tests/CrowWindow.cs @@ -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) diff --git a/src/CrowThread.cs b/src/CrowThread.cs index ece87fa8..857ec1a3 100644 --- a/src/CrowThread.cs +++ b/src/CrowThread.cs @@ -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); } } } diff --git a/src/GraphicObjects/ColorSelector.cs b/src/GraphicObjects/ColorSelector.cs index c9f3a198..596d332e 100644 --- a/src/GraphicObjects/ColorSelector.cs +++ b/src/GraphicObjects/ColorSelector.cs @@ -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); } diff --git a/src/GraphicObjects/FileDialog.cs b/src/GraphicObjects/FileDialog.cs index 8182e021..47a6fb54 100644 --- a/src/GraphicObjects/FileDialog.cs +++ b/src/GraphicObjects/FileDialog.cs @@ -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); diff --git a/src/GraphicObjects/GenericStack.cs b/src/GraphicObjects/GenericStack.cs index cecdaffd..77f1cb1f 100644 --- a/src/GraphicObjects/GenericStack.cs +++ b/src/GraphicObjects/GenericStack.cs @@ -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; } diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index 41738802..aad6e327 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -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; - /// - /// Initialize this Graphic object instance by setting style and default values and loading template if required - /// - 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); } /// query an update of the content, a redraw [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; } /// By default in groups, LayoutingType.ArrangeChildren is reset - 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); } } diff --git a/src/GraphicObjects/Grid.cs b/src/GraphicObjects/Grid.cs index 3d1847a2..b2a13150 100644 --- a/src/GraphicObjects/Grid.cs +++ b/src/GraphicObjects/Grid.cs @@ -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; } diff --git a/src/GraphicObjects/Group.cs b/src/GraphicObjects/Group.cs index f3c357d2..a02b9669 100644 --- a/src/GraphicObjects/Group.cs +++ b/src/GraphicObjects/Group.cs @@ -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--) { diff --git a/src/GraphicObjects/Image.cs b/src/GraphicObjects/Image.cs index 6a4c590d..f2d540be 100644 --- a/src/GraphicObjects/Image.cs +++ b/src/GraphicObjects/Image.cs @@ -79,7 +79,7 @@ namespace Crow if (string.IsNullOrEmpty(value)) Picture = null; else { - lock(CurrentInterface.LayoutMutex){ + lock(currentInterface.LayoutMutex){ LoadImage (value); } } diff --git a/src/GraphicObjects/Label.cs b/src/GraphicObjects/Label.cs index 64ee9688..7a802bda 100644 --- a/src/GraphicObjects/Label.cs +++ b/src/GraphicObjects/Label.cs @@ -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) { diff --git a/src/GraphicObjects/MessageBox.cs b/src/GraphicObjects/MessageBox.cs index d8ce1dae..8c8380ef 100644 --- a/src/GraphicObjects/MessageBox.cs +++ b/src/GraphicObjects/MessageBox.cs @@ -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)) diff --git a/src/GraphicObjects/Popper.cs b/src/GraphicObjects/Popper.cs index 0e5364d6..3ba6d711 100644 --- a/src/GraphicObjects/Popper.cs +++ b/src/GraphicObjects/Popper.cs @@ -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); diff --git a/src/GraphicObjects/PrivateContainer.cs b/src/GraphicObjects/PrivateContainer.cs index 02e251be..499f998f 100644 --- a/src/GraphicObjects/PrivateContainer.cs +++ b/src/GraphicObjects/PrivateContainer.cs @@ -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; diff --git a/src/GraphicObjects/ScrollingObject.cs b/src/GraphicObjects/ScrollingObject.cs index 330b230d..8b9bc58a 100644 --- a/src/GraphicObjects/ScrollingObject.cs +++ b/src/GraphicObjects/ScrollingObject.cs @@ -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; diff --git a/src/GraphicObjects/Splitter.cs b/src/GraphicObjects/Splitter.cs index 2f5dd15b..503e1eca 100644 --- a/src/GraphicObjects/Splitter.cs +++ b/src/GraphicObjects/Splitter.cs @@ -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) { diff --git a/src/GraphicObjects/TabView.cs b/src/GraphicObjects/TabView.cs index ecf38f10..c0c07fc7 100644 --- a/src/GraphicObjects/TabView.cs +++ b/src/GraphicObjects/TabView.cs @@ -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); } diff --git a/src/GraphicObjects/TemplatedControl.cs b/src/GraphicObjects/TemplatedControl.cs index 0461a8ee..b0d752ed 100644 --- a/src/GraphicObjects/TemplatedControl.cs +++ b/src/GraphicObjects/TemplatedControl.cs @@ -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); } diff --git a/src/GraphicObjects/TemplatedGroup.cs b/src/GraphicObjects/TemplatedGroup.cs index eea3a184..4e997598 100644 --- a/src/GraphicObjects/TemplatedGroup.cs +++ b/src/GraphicObjects/TemplatedGroup.cs @@ -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); diff --git a/src/GraphicObjects/TextBox.cs b/src/GraphicObjects/TextBox.cs index 0cbee9f8..5e2d55cb 100644 --- a/src/GraphicObjects/TextBox.cs +++ b/src/GraphicObjects/TextBox.cs @@ -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) { diff --git a/src/GraphicObjects/Window.cs b/src/GraphicObjects/Window.cs index 8a6903f6..e0c97ea9 100644 --- a/src/GraphicObjects/Window.cs +++ b/src/GraphicObjects/Window.cs @@ -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); } } } diff --git a/src/GraphicObjects/Wrapper.cs b/src/GraphicObjects/Wrapper.cs index 8b282ebb..22410919 100644 --- a/src/GraphicObjects/Wrapper.cs +++ b/src/GraphicObjects/Wrapper.cs @@ -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; } diff --git a/src/LayoutingQueueItem.cs b/src/LayoutingQueueItem.cs index 7f272d98..47807a99 100644 --- a/src/LayoutingQueueItem.cs +++ b/src/LayoutingQueueItem.cs @@ -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