Author: jackson
Date: 2005-12-14 19:06:31 -0500 (Wed, 14 Dec 2005)
New Revision: 54424

Added:
   trunk/winforms/setpos/
   trunk/winforms/setpos/Makefile
   trunk/winforms/setpos/swf-setpos.cs
Log:

        Little test for setting positions of windows manually.




Added: trunk/winforms/setpos/Makefile
===================================================================
--- trunk/winforms/setpos/Makefile      2005-12-14 23:37:00 UTC (rev 54423)
+++ trunk/winforms/setpos/Makefile      2005-12-15 00:06:31 UTC (rev 54424)
@@ -0,0 +1,10 @@
+all: mono
+
+mono: swf-setpos.cs
+       mcs swf-setpos.cs /r:System.Windows.Forms.dll /r:System.Drawing.dll
+
+dotnet: swf-setpos.cs
+       csc swf-setpos.cs /r:System.Windows.Forms.dll /r:System.Drawing.dll
+
+clean:
+       rm swf-setpos.exe -r -f
\ No newline at end of file

Added: trunk/winforms/setpos/swf-setpos.cs
===================================================================
--- trunk/winforms/setpos/swf-setpos.cs 2005-12-14 23:37:00 UTC (rev 54423)
+++ trunk/winforms/setpos/swf-setpos.cs 2005-12-15 00:06:31 UTC (rev 54424)
@@ -0,0 +1,70 @@
+
+using System;
+using System.Windows.Forms;
+
+public class SetPosTest : Form {
+
+       private NumericUpDown left_pos;
+       private NumericUpDown top_pos;
+       private Form tool_window;
+       
+       public SetPosTest ()
+       {
+               left_pos = new NumericUpDown ();
+               top_pos = new NumericUpDown ();
+
+               tool_window = new Form ();
+               tool_window.FormBorderStyle = FormBorderStyle.FixedToolWindow;
+               tool_window.LocationChanged += new EventHandler 
(ToolWindowLocationChanged);
+
+               Label xlabel = new Label ();
+               xlabel.Text = "Left:";
+               Label ylabel = new Label ();
+               ylabel.Text = "Top:";
+
+               xlabel.Width = 45;
+               ylabel.Width = 45;
+
+               xlabel.Left = 10;
+               left_pos.Left = 55;
+               ylabel.Left = 10;
+               top_pos.Left = 55;
+               ylabel.Top = left_pos.Bottom + 25;
+               top_pos.Top = left_pos.Bottom + 25;
+
+               left_pos.Minimum = top_pos.Minimum = Int32.MinValue;
+               left_pos.Maximum = top_pos.Maximum = Int32.MaxValue;
+
+               left_pos.ValueChanged += new EventHandler (LeftPosChanged);
+               top_pos.ValueChanged += new EventHandler (TopPosChanged);
+
+               Controls.Add (xlabel);
+               Controls.Add (ylabel);
+               Controls.Add (left_pos);
+               Controls.Add (top_pos);
+
+               tool_window.Show ();
+       }
+
+       private void LeftPosChanged (object sender, EventArgs e)
+       {
+               tool_window.Left = (int) left_pos.Value;
+       }
+
+       private void TopPosChanged (object sender, EventArgs e)
+       {
+               tool_window.Top = (int) top_pos.Value;
+       }
+
+       private void ToolWindowLocationChanged (object sender, EventArgs e)
+       {
+//             left_pos.Value = tool_window.Left;
+//             top_pos.Value = tool_window.Top;
+       }
+
+       public static void Main ()
+       {
+               Application.Run (new SetPosTest ());
+       }
+}
+

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to