Author: gert
Date: 2007-05-20 08:58:21 -0400 (Sun, 20 May 2007)
New Revision: 77717
Added:
trunk/gert/interactive/bug81689/
trunk/gert/interactive/bug81689/MainForm.cs
trunk/gert/interactive/bug81689/default.build
Log:
Added test for bug #81689.
Added: trunk/gert/interactive/bug81689/MainForm.cs
===================================================================
--- trunk/gert/interactive/bug81689/MainForm.cs 2007-05-20 12:46:26 UTC (rev
77716)
+++ trunk/gert/interactive/bug81689/MainForm.cs 2007-05-20 12:58:21 UTC (rev
77717)
@@ -0,0 +1,262 @@
+using System;
+using System.ComponentModel;
+using System.Drawing;
+using System.Globalization;
+using System.Windows.Forms;
+
+public class MainForm : Form
+{
+ public MainForm ()
+ {
+ //
+ // menuStrip
+ //
+ menuStrip = new MenuStrip ();
+ menuStrip.Location = new Point (0, 0);
+ menuStrip.Size = new Size (632, 24);
+ menuStrip.TabIndex = 0;
+ menuStrip.Text = "MenuStrip";
+ Controls.Add (menuStrip);
+ //
+ // fileMenu
+ //
+ fileMenu = new ToolStripMenuItem ();
+ fileMenu.ImageTransparentColor = SystemColors.ActiveBorder;
+ fileMenu.Size = new Size (35, 20);
+ fileMenu.MergeAction = MergeAction.Append;
+ fileMenu.MergeIndex = 1;
+ fileMenu.Text = "&File";
+ fileMenu.DropDownOpened += new EventHandler
(FileMenu_DropDownOpened);
+ menuStrip.Items.Add (fileMenu);
+ //
+ // openToolStripMenuItem
+ //
+ openToolStripMenuItem = new ToolStripMenuItem ();
+ openToolStripMenuItem.ShortcutKeys = ((Keys) ((Keys.Control |
Keys.O)));
+ openToolStripMenuItem.Size = new Size (151, 22);
+ openToolStripMenuItem.Text = "&Open";
+ openToolStripMenuItem.Click += new EventHandler (OpenFile);
+ openToolStripMenuItem.MergeAction = MergeAction.Append;
+ openToolStripMenuItem.MergeIndex = 2;
+ fileMenu.DropDownItems.Add (openToolStripMenuItem);
+ //
+ // toolStripSeparator4
+ //
+ toolStripSeparator4 = new ToolStripSeparator ();
+ toolStripSeparator4.Size = new Size (148, 6);
+ toolStripSeparator4.MergeAction = MergeAction.Append;
+ toolStripSeparator4.MergeIndex = 7;
+ //
+ // exitToolStripMenuItem
+ //
+ exitToolStripMenuItem = new ToolStripMenuItem ();
+ exitToolStripMenuItem.Size = new Size (151, 22);
+ exitToolStripMenuItem.Text = "E&xit";
+ exitToolStripMenuItem.Click += new EventHandler
(ExitToolsStripMenuItem_Click);
+ exitToolStripMenuItem.MergeAction = MergeAction.Append;
+ exitToolStripMenuItem.MergeIndex = 11;
+ fileMenu.DropDownItems.Add (exitToolStripMenuItem);
+ //
+ // windowsMenu
+ //
+ windowsMenu = new ToolStripMenuItem ();
+ windowsMenu.Size = new Size (62, 20);
+ windowsMenu.Text = "&Windows";
+ menuStrip.MdiWindowListItem = windowsMenu;
+ menuStrip.Items.Add (windowsMenu);
+ //
+ // cascadeToolStripMenuItem
+ //
+ cascadeToolStripMenuItem = new ToolStripMenuItem ();
+ cascadeToolStripMenuItem.Size = new Size (153, 22);
+ cascadeToolStripMenuItem.Text = "&Cascade";
+ cascadeToolStripMenuItem.Click += new EventHandler
(CascadeToolStripMenuItem_Click);
+ windowsMenu.DropDownItems.Add (cascadeToolStripMenuItem);
+ //
+ // tileVerticalToolStripMenuItem
+ //
+ tileVerticalToolStripMenuItem = new ToolStripMenuItem ();
+ tileVerticalToolStripMenuItem.Size = new Size (153, 22);
+ tileVerticalToolStripMenuItem.Text = "Tile &Vertical";
+ windowsMenu.DropDownItems.Add (tileVerticalToolStripMenuItem);
+ //
+ // tileHorizontalToolStripMenuItem
+ //
+ tileHorizontalToolStripMenuItem = new ToolStripMenuItem ();
+ tileHorizontalToolStripMenuItem.Size = new Size (153, 22);
+ tileHorizontalToolStripMenuItem.Text = "Tile &Horizontal";
+ tileHorizontalToolStripMenuItem.Click += new EventHandler
(TileHorizontalToolStripMenuItem_Click);
+ windowsMenu.DropDownItems.Add (tileHorizontalToolStripMenuItem);
+ //
+ // closeAllToolStripMenuItem
+ //
+ closeAllToolStripMenuItem = new ToolStripMenuItem ();
+ closeAllToolStripMenuItem.Size = new Size (153, 22);
+ closeAllToolStripMenuItem.Text = "C&lose All";
+ closeAllToolStripMenuItem.Click += new EventHandler
(CloseAllToolStripMenuItem_Click);
+ windowsMenu.DropDownItems.Add (closeAllToolStripMenuItem);
+ //
+ // arrangeIconsToolStripMenuItem
+ //
+ arrangeIconsToolStripMenuItem = new ToolStripMenuItem ();
+ arrangeIconsToolStripMenuItem.Size = new Size (153, 22);
+ arrangeIconsToolStripMenuItem.Text = "&Arrange Icons";
+ arrangeIconsToolStripMenuItem.Click += new EventHandler
(ArrangeIconsToolStripMenuItem_Click);
+ windowsMenu.DropDownItems.Add (arrangeIconsToolStripMenuItem);
+ //
+ // MainForm
+ //
+ AutoScaleDimensions = new SizeF (6F, 13F);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new Size (400, 300);
+ IsMdiContainer = true;
+ Location = new Point (200, 100);
+ MainMenuStrip = menuStrip;
+ StartPosition = FormStartPosition.Manual;
+ Text = "bug #81484";
+ Load += new EventHandler (MainForm_Load);
+ }
+
+ [STAThread]
+ static void Main ()
+ {
+ Application.EnableVisualStyles ();
+ Application.SetCompatibleTextRenderingDefault (false);
+ Application.Run (new MainForm ());
+ }
+
+ void MainForm_Load (object sender, EventArgs e)
+ {
+ InstructionsForm instructionsForm = new InstructionsForm ();
+ instructionsForm.Show ();
+ }
+
+ void FileMenu_DropDownOpened (object sender, EventArgs e)
+ {
+ }
+
+ void OpenFile (object sender, EventArgs e)
+ {
+ ChildForm child = new ChildForm ();
+ child.MdiParent = this;
+ child.Text = "Child " + childFormNumber++;
+ child.Show ();
+ }
+
+ void ExitToolsStripMenuItem_Click (object sender, EventArgs e)
+ {
+ Application.Exit ();
+ }
+
+ void CascadeToolStripMenuItem_Click (object sender, EventArgs e)
+ {
+ LayoutMdi (MdiLayout.Cascade);
+ }
+
+ void TileHorizontalToolStripMenuItem_Click (object sender, EventArgs e)
+ {
+ LayoutMdi (MdiLayout.TileHorizontal);
+ }
+
+ void ArrangeIconsToolStripMenuItem_Click (object sender, EventArgs e)
+ {
+ LayoutMdi (MdiLayout.ArrangeIcons);
+ }
+
+ void CloseAllToolStripMenuItem_Click (object sender, EventArgs e)
+ {
+ foreach (Form childForm in MdiChildren)
+ childForm.Close ();
+ }
+
+ private int childFormNumber;
+ private MenuStrip menuStrip;
+ private ToolStripSeparator toolStripSeparator4;
+ private ToolStripMenuItem tileHorizontalToolStripMenuItem;
+ private ToolStripMenuItem fileMenu;
+ private ToolStripMenuItem openToolStripMenuItem;
+ private ToolStripMenuItem exitToolStripMenuItem;
+ private ToolStripMenuItem windowsMenu;
+ private ToolStripMenuItem cascadeToolStripMenuItem;
+ private ToolStripMenuItem tileVerticalToolStripMenuItem;
+ private ToolStripMenuItem closeAllToolStripMenuItem;
+ private ToolStripMenuItem arrangeIconsToolStripMenuItem;
+}
+
+class ChildForm : Form
+{
+ public ChildForm ()
+ {
+ //
+ // ChildForm
+ //
+ AutoScaleDimensions = new SizeF (6F, 13F);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new Size (150, 150);
+ }
+}
+
+public class InstructionsForm : Form
+{
+ public InstructionsForm ()
+ {
+ //
+ // _tabControl
+ //
+ _tabControl = new TabControl ();
+ _tabControl.Dock = DockStyle.Fill;
+ Controls.Add (_tabControl);
+ //
+ // _bugDescriptionText1
+ //
+ _bugDescriptionText1 = new TextBox ();
+ _bugDescriptionText1.Multiline = true;
+ _bugDescriptionText1.Dock = DockStyle.Fill;
+ _bugDescriptionText1.Text = string.Format
(CultureInfo.InvariantCulture,
+ "Steps to execute:{0}{0}" +
+ "1. In the File menu, click the Open menu item.{0}{0}" +
+ "2. Maximize the child form.{0}{0}" +
+ "Expected result:{0}{0}" +
+ "1. The menu strip folds into the title bar of the
child form.",
+ Environment.NewLine);
+ //
+ // _tabPage1
+ //
+ _tabPage1 = new TabPage ();
+ _tabPage1.Text = "#1";
+ _tabPage1.Controls.Add (_bugDescriptionText1);
+ _tabControl.Controls.Add (_tabPage1);
+ //
+ // _bugDescriptionText2
+ //
+ _bugDescriptionText2 = new TextBox ();
+ _bugDescriptionText2.Multiline = true;
+ _bugDescriptionText2.Dock = DockStyle.Fill;
+ _bugDescriptionText2.Text = string.Format
(CultureInfo.InvariantCulture,
+ "Steps to execute:{0}{0}" +
+ "1. Restore the child form to its original size and
position.{0}{0}" +
+ "Expected result:{0}{0}" +
+ "1. The menu strip unfolds from the title bar of the
child form.",
+ Environment.NewLine);
+ //
+ // _tabPage2
+ //
+ _tabPage2 = new TabPage ();
+ _tabPage2.Text = "#2";
+ _tabPage2.Controls.Add (_bugDescriptionText2);
+ _tabControl.Controls.Add (_tabPage2);
+ //
+ // InstructionsForm
+ //
+ ClientSize = new Size (300, 170);
+ Location = new Point (650, 100);
+ StartPosition = FormStartPosition.Manual;
+ Text = "Instructions - bug #XXXXX";
+ }
+
+ private TextBox _bugDescriptionText1;
+ private TextBox _bugDescriptionText2;
+ private TabControl _tabControl;
+ private TabPage _tabPage1;
+ private TabPage _tabPage2;
+}
Property changes on: trunk/gert/interactive/bug81689/MainForm.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/gert/interactive/bug81689/default.build
===================================================================
--- trunk/gert/interactive/bug81689/default.build 2007-05-20 12:46:26 UTC
(rev 77716)
+++ trunk/gert/interactive/bug81689/default.build 2007-05-20 12:58:21 UTC
(rev 77717)
@@ -0,0 +1,54 @@
+<project name="bug81689" default="rebuild">
+ <target name="mono-2.0">
+ <property name="csc.defines"
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0,MONO" />
+ </target>
+
+ <target name="net-2.0">
+ <property name="csc.defines"
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0" />
+ </target>
+
+ <property name="frameworks" value="mono-2.0,net-2.0" />
+
+ <target name="clean">
+ <delete>
+ <fileset>
+ <include name="out" />
+ <include name="test.exe" />
+ </fileset>
+ </delete>
+ </target>
+
+ <target name="build">
+ <property name="original.targetframework"
value="${nant.settings.currentframework}" />
+
+ <foreach property="framework" item="String" in="${frameworks}"
delim=",">
+ <if test="${framework::exists(framework)}">
+ <property name="nant.settings.currentframework"
value="${framework}" />
+ <call
target="${nant.settings.currentframework}" />
+ <call target="run" />
+ <call target="clean" />
+ </if>
+ </foreach>
+
+ <property name="nant.settings.currentframework"
value="${original.targetframework}" />
+ </target>
+
+ <target name="compile">
+ <csc target="winexe" define="${csc.defines}" output="test.exe"
warnaserror="true" warninglevel="4">
+ <sources>
+ <include name="MainForm.cs" />
+ </sources>
+ <references>
+ <include name="System.Drawing.dll" />
+ <include name="System.Windows.Forms.dll" />
+ </references>
+ </csc>
+ </target>
+
+ <target name="run" depends="compile">
+ <exec program="test.exe" managed="true" output="out" />
+ <fail if="${file::exists('out')}" />
+ </target>
+
+ <target name="rebuild" depends="clean, build" />
+</project>
Property changes on: trunk/gert/interactive/bug81689/default.build
___________________________________________________________________
Name: svn:eol-style
+ native
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches