[Agate-svn-commit] SF.net SVN: agate:[1526] trunk/AgateLib/UserInterface/Widgets
Status: Alpha
Brought to you by:
kanato
|
From: <ka...@us...> - 2014-09-16 03:21:41
|
Revision: 1526
http://sourceforge.net/p/agate/code/1526
Author: kanato
Date: 2014-09-16 03:21:33 +0000 (Tue, 16 Sep 2014)
Log Message:
-----------
Minor fixes to UserInterface classes.
Modified Paths:
--------------
trunk/AgateLib/UserInterface/Widgets/Container.cs
trunk/AgateLib/UserInterface/Widgets/Gui.cs
trunk/AgateLib/UserInterface/Widgets/Panel.cs
trunk/AgateLib/UserInterface/Widgets/WidgetList.cs
Modified: trunk/AgateLib/UserInterface/Widgets/Container.cs
===================================================================
--- trunk/AgateLib/UserInterface/Widgets/Container.cs 2014-09-14 03:19:31 UTC (rev 1525)
+++ trunk/AgateLib/UserInterface/Widgets/Container.cs 2014-09-16 03:21:33 UTC (rev 1526)
@@ -63,7 +63,7 @@
throw new InvalidOperationException("Selected child is not part of this container!");
Children.Remove(item);
- Children.Insert(0, item);
+ Children.Add(item);
}
public override void Update(double delta_t, ref bool processInput)
Modified: trunk/AgateLib/UserInterface/Widgets/Gui.cs
===================================================================
--- trunk/AgateLib/UserInterface/Widgets/Gui.cs 2014-09-14 03:19:31 UTC (rev 1525)
+++ trunk/AgateLib/UserInterface/Widgets/Gui.cs 2014-09-16 03:21:33 UTC (rev 1526)
@@ -488,9 +488,17 @@
public void AddWindow(Window wind)
{
+ if (Desktop.Children.Contains(wind))
+ return;
+
Desktop.Children.Add(wind);
}
+
+ public void RemoveWindow(Window wind)
+ {
+ Desktop.Children.Remove(wind);
+ }
}
class WindowList : IList<Window>
Modified: trunk/AgateLib/UserInterface/Widgets/Panel.cs
===================================================================
--- trunk/AgateLib/UserInterface/Widgets/Panel.cs 2014-09-14 03:19:31 UTC (rev 1525)
+++ trunk/AgateLib/UserInterface/Widgets/Panel.cs 2014-09-16 03:21:33 UTC (rev 1526)
@@ -25,5 +25,10 @@
{
public class Panel : Container
{
+ public Panel() { }
+ public Panel(string name) : this()
+ {
+ this.Name = name;
+ }
}
}
Modified: trunk/AgateLib/UserInterface/Widgets/WidgetList.cs
===================================================================
--- trunk/AgateLib/UserInterface/Widgets/WidgetList.cs 2014-09-14 03:19:31 UTC (rev 1525)
+++ trunk/AgateLib/UserInterface/Widgets/WidgetList.cs 2014-09-16 03:21:33 UTC (rev 1526)
@@ -101,6 +101,9 @@
}
public void Add(params Widget[] items)
{
+ if (items.Length == 0)
+ throw new ArgumentException("No items to add.");
+
AddRange(items);
}
public void AddRange(IEnumerable<Widget> items)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|