# HG changeset patch # User Ivo Smits # Date 1393171187 -3600 # Node ID 4ca44dd25a6a8d16e7223d1ac6c17a43f73ba566 # Parent 0d389692be32a2af1f8117992bf4b144ecc78206# Parent 3352f89cf6f513aabecfd5bcc6f5d8f86b53708f Merge diff -r 0d389692be32 -r 4ca44dd25a6a FBGUI/FBGUI.cs --- a/FBGUI/FBGUI.cs Mon Feb 17 22:35:52 2014 +0100 +++ b/FBGUI/FBGUI.cs Sun Feb 23 16:59:47 2014 +0100 @@ -216,7 +216,7 @@ protected List controls = new List(); protected IFBGControl mouseCaptureControl = null; protected IFBGControl keyboardCaptureControl = null; - public virtual Rectangle ClientRectangle { get { return Bounds; } } + public virtual Rectangle ClientRectangle { get { return new Rectangle(Point.Empty, Bounds.Size); } } public virtual Size ClientSize { get { return ClientRectangle.Size; } set { Bounds = new Rectangle(Bounds.Location, Bounds.Size - ClientRectangle.Size + value); } } public FBGContainerControl(IFBGContainerControl parent) : base(parent) { } void IFBGContainerControl.AddControl(IFBGControl control) { AddControl(control); } @@ -232,6 +232,7 @@ control.Orphaned(); } } + public IList Controls { get { return controls.AsReadOnly(); } } public virtual Point PointToChild(IFBGControl child, Point point) { return point - (Size)child.Bounds.Location - (Size)ClientRectangle.Location; } @@ -314,7 +315,7 @@ else keyboardCaptureControl.HandleEvent(e); } protected virtual void HandleKeyboardCaptureMessage(IFBGControl sender, FBGKeyboardCaptureMessage e) { - if (!e.Capture && !(ReferenceEquals(mouseCaptureControl, null) || ReferenceEquals(mouseCaptureControl, sender))) e.Capture = false; + if (!e.Capture && !(ReferenceEquals(keyboardCaptureControl, null) || ReferenceEquals(keyboardCaptureControl, sender))) e.Capture = false; else { Parent.HandleMessage(this, e); IFBGControl prev = keyboardCaptureControl; diff -r 0d389692be32 -r 4ca44dd25a6a UCIS.Core.csproj --- a/UCIS.Core.csproj Mon Feb 17 22:35:52 2014 +0100 +++ b/UCIS.Core.csproj Sun Feb 23 16:59:47 2014 +0100 @@ -48,7 +48,6 @@ - Component Code diff -r 0d389692be32 -r 4ca44dd25a6a Util/ArrayUtil.cs --- a/Util/ArrayUtil.cs Mon Feb 17 22:35:52 2014 +0100 +++ b/Util/ArrayUtil.cs Sun Feb 23 16:59:47 2014 +0100 @@ -122,38 +122,45 @@ foreach (T v in array) h ^= v.GetHashCode(); return h; } - public static void Add(ref T[] array, params T[] items) { + public static int Add(ref T[] array, params T[] items) { if (array == null) { array = new T[items.Length]; items.CopyTo(array, 0); + return 0; } else { int index = array.Length; Array.Resize(ref array, index + items.Length); items.CopyTo(array, index); + return index; } } - public static void Add(ref T[] array, ICollection items) { + public static int Add(ref T[] array, ICollection items) { if (array == null) { array = new T[items.Count]; items.CopyTo(array, 0); + return 0; } else { int index = array.Length; Array.Resize(ref array, index + items.Count); items.CopyTo(array, index); + return index; } } - public static void Add(ref T[] array, T item) { + public static int Add(ref T[] array, T item) { if (array == null) { array = new T[] { item }; + return 0; } else { int index = array.Length; Array.Resize(ref array, index + 1); array[index] = item; + return index; } } - public static void AddUnique(ref T[] array, T item) { - if (Array.IndexOf(array, item) != -1) return; - Add(ref array, item); + public static int AddUnique(ref T[] array, T item) { + int index = Array.IndexOf(array, item); + if (index == -1) index = Add(ref array, item); + return index; } } }