Author: jackson
Date: 2005-12-13 14:05:07 -0500 (Tue, 13 Dec 2005)
New Revision: 54311

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

        A very basic toolwindows demo.



Added: trunk/winforms/toolwindows/Makefile
===================================================================
--- trunk/winforms/toolwindows/Makefile 2005-12-13 17:44:08 UTC (rev 54310)
+++ trunk/winforms/toolwindows/Makefile 2005-12-13 19:05:07 UTC (rev 54311)
@@ -0,0 +1,10 @@
+all: mono
+
+mono: swf-toolwindows.cs
+       mcs swf-toolwindows.cs /r:System.Windows.Forms.dll /r:System.Drawing.dll
+
+dotnet: swf-toolwindows.cs
+       csc swf-toolwindows.cs /r:System.Windows.Forms.dll /r:System.Drawing.dll
+
+clean:
+       rm swf-toolwindows.exe -r -f
\ No newline at end of file

Added: trunk/winforms/toolwindows/swf-toolwindows.cs
===================================================================
--- trunk/winforms/toolwindows/swf-toolwindows.cs       2005-12-13 17:44:08 UTC 
(rev 54310)
+++ trunk/winforms/toolwindows/swf-toolwindows.cs       2005-12-13 19:05:07 UTC 
(rev 54311)
@@ -0,0 +1,43 @@
+
+using System;
+using System.Windows.Forms;
+
+
+public class ToolWindowTest : Form {
+
+       private bool sizable;
+       private Button button;
+
+       public ToolWindowTest ()
+       {
+               button = new Button ();
+               button.Text = "Gimme a Sizable Tool Window";
+
+               button.Dock = DockStyle.Fill;
+               button.Click += new EventHandler (ClickHandler);
+
+               Controls.Add (button);
+       }
+
+       public void ClickHandler (object sender, EventArgs e)
+       {
+               Form form = new Form ();
+               form.Text = "tool window";
+               if (sizable) {
+                       form.FormBorderStyle = 
FormBorderStyle.SizableToolWindow;
+                       button.Text = "Gimme a Fixed Tool Window";
+               } else {
+                       form.FormBorderStyle = FormBorderStyle.FixedToolWindow;
+                       button.Text = "Gimme a Sizable Tool Window";
+               }
+               sizable = !sizable;
+               
+               form.Show ();
+       }
+
+       public static void Main ()
+       {
+               Application.Run (new ToolWindowTest ());
+       }
+}
+

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

Reply via email to