Author: gert
Date: 2007-07-22 07:37:39 -0400 (Sun, 22 Jul 2007)
New Revision: 82436
Added:
trunk/gert/interactive/bug82160/
trunk/gert/interactive/bug82160/MainForm.cs
trunk/gert/interactive/bug82160/default.build
trunk/gert/interactive/bug82162/
trunk/gert/interactive/bug82162/MainForm.cs
trunk/gert/interactive/bug82162/default.build
Modified:
trunk/gert/interactive/bug81904/MainForm.cs
trunk/gert/interactive/known_issues
Log:
Added test for bug #82160 and bug #82162.
Modified: trunk/gert/interactive/bug81904/MainForm.cs
===================================================================
--- trunk/gert/interactive/bug81904/MainForm.cs 2007-07-22 11:18:24 UTC (rev
82435)
+++ trunk/gert/interactive/bug81904/MainForm.cs 2007-07-22 11:37:39 UTC (rev
82436)
@@ -33,6 +33,19 @@
_activateMenuItem.Click += new EventHandler
(ActivateMenuItem_Click);
_contextMenu.MenuItems.Add (_activateMenuItem);
//
+ // _separatorMenuItem
+ //
+ _separatorMenuItem = new MenuItem ();
+ _separatorMenuItem.Text = "-";
+ _contextMenu.MenuItems.Add (_separatorMenuItem);
+ //
+ // _activateOnClickMenuItem
+ //
+ _activateOnClickMenuItem = new MenuItem ();
+ _activateOnClickMenuItem.Text = "Activate on Click";
+ _activateOnClickMenuItem.Click += new EventHandler
(ActivateOnClickMenuItem_Click);
+ _contextMenu.MenuItems.Add (_activateOnClickMenuItem);
+ //
// _tabControl
//
_tabControl = new TabControl ();
@@ -94,8 +107,10 @@
_bugDescriptionText3.Multiline = true;
_bugDescriptionText3.Text = string.Format
(CultureInfo.InvariantCulture,
"Steps to execute:{0}{0}" +
- "1. Ensure another form is displayed on top of this
one.{0}{0}" +
- "2. Left-click the notify icon.{0}{0}" +
+ "1. Right-click the notify icon.{0}{0}" +
+ "2. Click the Activate on Click menu item.{0}{0}" +
+ "3. Ensure another form is displayed on top of this
one.{0}{0}" +
+ "4. Left-click the notify icon.{0}{0}" +
"Expected result:{0}{0}" +
"1. The form is moved to the top of the z-order.{0}{0}"
+
"2. The form is activated.",
@@ -133,14 +148,15 @@
}
void MainForm_Load (object sender, EventArgs e)
- {
- _notifyIcon.Icon = Icon;
+ {
+ _notifyIcon.Icon = Icon;
_notifyIcon.Visible = true;
}
void NotifyIcon_Click (object sender, EventArgs e)
{
- Activate ();
+ if (_activateOnClickMenuItem.Checked)
+ Activate ();
}
void BringToFrontMenuItem_Click (object sender, EventArgs e)
@@ -153,10 +169,17 @@
Activate ();
}
+ void ActivateOnClickMenuItem_Click (object sender, EventArgs e)
+ {
+ _activateOnClickMenuItem.Checked =
!_activateOnClickMenuItem.Checked;
+ }
+
private NotifyIcon _notifyIcon;
private ContextMenu _contextMenu;
private MenuItem _bringToFrontMenuItem;
private MenuItem _activateMenuItem;
+ private MenuItem _activateOnClickMenuItem;
+ private MenuItem _separatorMenuItem;
private TextBox _bugDescriptionText1;
private TextBox _bugDescriptionText2;
private TextBox _bugDescriptionText3;
Added: trunk/gert/interactive/bug82160/MainForm.cs
===================================================================
--- trunk/gert/interactive/bug82160/MainForm.cs 2007-07-22 11:18:24 UTC (rev
82435)
+++ trunk/gert/interactive/bug82160/MainForm.cs 2007-07-22 11:37:39 UTC (rev
82436)
@@ -0,0 +1,132 @@
+using System;
+using System.Drawing;
+using System.Globalization;
+using System.Text;
+using System.Windows.Forms;
+
+public class MainForm : Form
+{
+ public MainForm ()
+ {
+ //
+ // _contextMenu
+ //
+ _contextMenu = new ContextMenu ();
+ //
+ // _notifyIcon
+ //
+ _notifyIcon = new NotifyIcon ();
+ _notifyIcon.ContextMenu = _contextMenu;
+ //
+ // _bringToFrontMenuItem
+ //
+ _bringToFrontMenuItem = new MenuItem ();
+ _bringToFrontMenuItem.Text = "Bring to front...";
+ _bringToFrontMenuItem.Click += new EventHandler
(BringToFrontMenuItem_Click);
+ _contextMenu.MenuItems.Add (_bringToFrontMenuItem);
+ //
+ // _activateMenuItem
+ //
+ _activateMenuItem = new MenuItem ();
+ _activateMenuItem.Text = "Activate...";
+ _activateMenuItem.Click += new EventHandler
(ActivateMenuItem_Click);
+ _contextMenu.MenuItems.Add (_activateMenuItem);
+ //
+ // _tabControl
+ //
+ _tabControl = new TabControl ();
+ _tabControl.Dock = DockStyle.Fill;
+ Controls.Add (_tabControl);
+ //
+ // _bugDescriptionText1
+ //
+ _bugDescriptionText1 = new TextBox ();
+ _bugDescriptionText1.Dock = DockStyle.Fill;
+ _bugDescriptionText1.Multiline = true;
+ _bugDescriptionText1.Text = string.Format
(CultureInfo.InvariantCulture,
+ "Steps to execute:{0}{0}" +
+ "1. Right-click the notificy icon.{0}{0}" +
+ "2. Click on another part of the notification
area.{0}{0}" +
+ "Expected result:{0}{0}" +
+ "1. The context menu is closed.{0}{0}" +
+ "2. The notify icon is redrawn.",
+ Environment.NewLine);
+ //
+ // _tabPage1
+ //
+ _tabPage1 = new TabPage ();
+ _tabPage1.Text = "#1";
+ _tabPage1.Controls.Add (_bugDescriptionText1);
+ _tabControl.Controls.Add (_tabPage1);
+ //
+ // _bugDescriptionText1
+ //
+ _bugDescriptionText1 = new TextBox ();
+ _bugDescriptionText1.Dock = DockStyle.Fill;
+ _bugDescriptionText1.Multiline = true;
+ _bugDescriptionText1.Text = string.Format
(CultureInfo.InvariantCulture,
+ "Steps to execute:{0}{0}" +
+ "1. Right-click the notificy icon.{0}{0}" +
+ "2. Right-click the notificy icon.{0}{0}" +
+ "Expected result:{0}{0}" +
+ "1. On step 2, the first context menu is closed and a
new " +
+ "context menu is displayed.{0}{0}" +
+ "Applies to:{0}" +
+ "Microsoft Windows",
+ Environment.NewLine);
+ //
+ // _tabPage1
+ //
+ _tabPage1 = new TabPage ();
+ _tabPage1.Text = "#1";
+ _tabPage1.Controls.Add (_bugDescriptionText1);
+ _tabControl.Controls.Add (_tabPage1);
+ //
+ // MainForm
+ //
+ ClientSize = new Size (300, 220);
+ StartPosition = FormStartPosition.CenterScreen;
+ Text = "bug #82160";
+ Load += new EventHandler (MainForm_Load);
+ }
+
+ [STAThread]
+ static void Main ()
+ {
+ Application.Run (new MainForm ());
+ }
+
+ protected override void Dispose (bool disposing)
+ {
+ if (disposing) {
+ if (_notifyIcon != null) {
+ _notifyIcon.Dispose ();
+ }
+ }
+ base.Dispose (disposing);
+ }
+
+ void MainForm_Load (object sender, EventArgs e)
+ {
+ _notifyIcon.Icon = Icon;
+ _notifyIcon.Visible = true;
+ }
+
+ void BringToFrontMenuItem_Click (object sender, EventArgs e)
+ {
+ BringToFront ();
+ }
+
+ void ActivateMenuItem_Click (object sender, EventArgs e)
+ {
+ Activate ();
+ }
+
+ private NotifyIcon _notifyIcon;
+ private ContextMenu _contextMenu;
+ private MenuItem _bringToFrontMenuItem;
+ private MenuItem _activateMenuItem;
+ private TextBox _bugDescriptionText1;
+ private TabControl _tabControl;
+ private TabPage _tabPage1;
+}
Property changes on: trunk/gert/interactive/bug82160/MainForm.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/gert/interactive/bug82160/default.build
===================================================================
--- trunk/gert/interactive/bug82160/default.build 2007-07-22 11:18:24 UTC
(rev 82435)
+++ trunk/gert/interactive/bug82160/default.build 2007-07-22 11:37:39 UTC
(rev 82436)
@@ -0,0 +1,62 @@
+<project name="bug82160" default="rebuild">
+ <target name="mono-1.0">
+ <property name="csc.defines"
value="NET_1_0,NET_1_1,ONLY_1_1,MONO" />
+ </target>
+
+ <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-1.1">
+ <property name="csc.defines" value="NET_1_0,NET_1_1,ONLY_1_1" />
+ </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-1.0,mono-2.0,net-1.1,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/bug82160/default.build
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/gert/interactive/bug82162/MainForm.cs
===================================================================
--- trunk/gert/interactive/bug82162/MainForm.cs 2007-07-22 11:18:24 UTC (rev
82435)
+++ trunk/gert/interactive/bug82162/MainForm.cs 2007-07-22 11:37:39 UTC (rev
82436)
@@ -0,0 +1,113 @@
+using System;
+using System.Drawing;
+using System.Globalization;
+using System.Windows.Forms;
+
+public class MainForm : Form
+{
+ public MainForm ()
+ {
+ //
+ // _contextMenu
+ //
+ _contextMenu = new ContextMenu ();
+ //
+ // _notifyIcon
+ //
+ _notifyIcon = new NotifyIcon ();
+ _notifyIcon.ContextMenu = _contextMenu;
+ _notifyIcon.Click += new EventHandler (NotifyIcon_Click);
+ //
+ // _bringToFrontMenuItem
+ //
+ _bringToFrontMenuItem = new MenuItem ();
+ _bringToFrontMenuItem.Text = "Bring to front...";
+ _bringToFrontMenuItem.Click += new EventHandler
(BringToFrontMenuItem_Click);
+ _contextMenu.MenuItems.Add (_bringToFrontMenuItem);
+ //
+ // _activateMenuItem
+ //
+ _activateMenuItem = new MenuItem ();
+ _activateMenuItem.Text = "Activate...";
+ _activateMenuItem.Click += new EventHandler
(ActivateMenuItem_Click);
+ _contextMenu.MenuItems.Add (_activateMenuItem);
+ //
+ // _tabControl
+ //
+ _tabControl = new TabControl ();
+ _tabControl.Dock = DockStyle.Fill;
+ Controls.Add (_tabControl);
+ //
+ // _bugDescriptionText1
+ //
+ _bugDescriptionText1 = new TextBox ();
+ _bugDescriptionText1.Dock = DockStyle.Fill;
+ _bugDescriptionText1.Multiline = true;
+ _bugDescriptionText1.Text = string.Format
(CultureInfo.InvariantCulture,
+ "Steps to execute:{0}{0}" +
+ "1. Right-click the notify icon.{0}{0}" +
+ "2. Click any of the menu items in the context
menu.{0}{0}" +
+ "Expected result:{0}{0}" +
+ "1. The form is closed after the menu item is clicked.",
+ Environment.NewLine);
+ //
+ // _tabPage1
+ //
+ _tabPage1 = new TabPage ();
+ _tabPage1.Text = "#1";
+ _tabPage1.Controls.Add (_bugDescriptionText1);
+ _tabControl.Controls.Add (_tabPage1);
+ //
+ // MainForm
+ //
+ ClientSize = new Size (300, 170);
+ StartPosition = FormStartPosition.CenterScreen;
+ Text = "bug #82162";
+ Load += new EventHandler (MainForm_Load);
+ }
+
+ [STAThread]
+ static void Main ()
+ {
+ Application.Run (new MainForm ());
+ }
+
+ protected override void Dispose (bool disposing)
+ {
+ if (disposing) {
+ if (_notifyIcon != null) {
+ _notifyIcon.Dispose ();
+ }
+ }
+ base.Dispose (disposing);
+ }
+
+ void MainForm_Load (object sender, EventArgs e)
+ {
+ _notifyIcon.Icon = Icon;
+ _notifyIcon.Visible = true;
+ }
+
+ void NotifyIcon_Click (object sender, EventArgs e)
+ {
+ Application.Exit ();
+ }
+
+ void BringToFrontMenuItem_Click (object sender, EventArgs e)
+ {
+ BringToFront ();
+ }
+
+ void ActivateMenuItem_Click (object sender, EventArgs e)
+ {
+ Activate ();
+ }
+
+ private NotifyIcon _notifyIcon;
+ private ContextMenu _contextMenu;
+ private MenuItem _bringToFrontMenuItem;
+ private MenuItem _activateMenuItem;
+ private TextBox _bugDescriptionText1;
+ private TabControl _tabControl;
+ private TabPage _tabPage1;
+}
Property changes on: trunk/gert/interactive/bug82162/MainForm.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/gert/interactive/bug82162/default.build
===================================================================
--- trunk/gert/interactive/bug82162/default.build 2007-07-22 11:18:24 UTC
(rev 82435)
+++ trunk/gert/interactive/bug82162/default.build 2007-07-22 11:37:39 UTC
(rev 82436)
@@ -0,0 +1,62 @@
+<project name="bug82162" default="rebuild">
+ <target name="mono-1.0">
+ <property name="csc.defines"
value="NET_1_0,NET_1_1,ONLY_1_1,MONO" />
+ </target>
+
+ <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-1.1">
+ <property name="csc.defines" value="NET_1_0,NET_1_1,ONLY_1_1" />
+ </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-1.0,mono-2.0,net-1.1,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/bug82162/default.build
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/gert/interactive/known_issues
===================================================================
--- trunk/gert/interactive/known_issues 2007-07-22 11:18:24 UTC (rev 82435)
+++ trunk/gert/interactive/known_issues 2007-07-22 11:37:39 UTC (rev 82436)
@@ -96,3 +96,5 @@
bug82136/**
bug82154/**
bug82155/**
+bug82160/**
+bug82162/**
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches