Author: gert
Date: 2008-01-23 10:46:32 -0500 (Wed, 23 Jan 2008)
New Revision: 93663

Added:
   trunk/gert/interactive/bug82081/star-inactive.png
   trunk/gert/interactive/bug82081/star.png
Modified:
   trunk/gert/interactive/bug82081/MainForm.cs
Log:
Improve test.


Modified: trunk/gert/interactive/bug82081/MainForm.cs
===================================================================
--- trunk/gert/interactive/bug82081/MainForm.cs 2008-01-23 15:36:03 UTC (rev 
93662)
+++ trunk/gert/interactive/bug82081/MainForm.cs 2008-01-23 15:46:32 UTC (rev 
93663)
@@ -1,18 +1,25 @@
 using System;
 using System.Drawing;
 using System.Globalization;
+using System.IO;
 using System.Windows.Forms;
 
 public class MainForm : Form
 {
        public MainForm ()
        {
+               // 
+               // _okButton
+               // 
                _okButton = new Button ();
                _okButton.FlatAppearance.BorderSize = 0;
                _okButton.FlatStyle = FlatStyle.Flat;
                _okButton.Location = new Point (60, 20);
                _okButton.Text = "OK";
                Controls.Add (_okButton);
+               // 
+               // _cancelButton
+               // 
                _cancelButton = new Button ();
                _cancelButton.FlatAppearance.BorderSize = 0;
                _cancelButton.FlatStyle = FlatStyle.Flat;
@@ -20,8 +27,25 @@
                _cancelButton.Text = "Cancel";
                Controls.Add (_cancelButton);
                // 
+               // checkBox1
+               // 
+               _checkBox = new CheckBox ();
+               _checkBox.Appearance = Appearance.Button;
+               _checkBox.AutoSize = true;
+               _checkBox.FlatAppearance.BorderSize = 0;
+               _checkBox.FlatAppearance.CheckedBackColor = Color.Transparent;
+               _checkBox.FlatAppearance.MouseDownBackColor = Color.Transparent;
+               _checkBox.FlatAppearance.MouseOverBackColor = Color.Transparent;
+               _checkBox.FlatStyle = FlatStyle.Flat;
+               _checkBox.Location = new Point (8, 45);
+               _checkBox.Size = new Size (6, 6);
+               _checkBox.TabIndex = 0;
+               _checkBox.CheckedChanged += new EventHandler 
(CheckBox_CheckedChanged);
+               Controls.Add (_checkBox);
+               // 
                // MainForm
                // 
+               BackColor = Color.White;
                ClientSize = new Size (300, 70);
                Location = new Point (250, 100);
                StartPosition = FormStartPosition.Manual;
@@ -39,10 +63,39 @@
        {
                InstructionsForm instructionsForm = new InstructionsForm ();
                instructionsForm.Show ();
+
+               SetImage ();
        }
 
+
+       void CheckBox_CheckedChanged (object sender, EventArgs e)
+       {
+               SetImage ();
+               _checkBox.Refresh ();
+       }
+
+       void SetImage ()
+       {
+               _checkBox.Image = _checkBox.Checked ? CheckedImage :
+                       UncheckedImage;
+       }
+
+       static bool ReturnFalse ()
+       {
+               return false;
+       }
+
+       static Bitmap GetBitmap (string fileName)
+       {
+               string dir = AppDomain.CurrentDomain.BaseDirectory;
+               return new Bitmap (Path.Combine (dir, fileName));
+       }
+
+       private Image CheckedImage = GetBitmap ("star.png").GetThumbnailImage 
(20, 20, ReturnFalse, IntPtr.Zero);
+       private Image UncheckedImage = GetBitmap 
("star-inactive.png").GetThumbnailImage (20, 20, ReturnFalse, IntPtr.Zero);
        private Button _okButton;
        private Button _cancelButton;
+       private CheckBox _checkBox;
 }
 
 public class InstructionsForm : Form
@@ -65,7 +118,11 @@
                        "Expected result on start-up:{0}{0}" +
                        "1. The Cancel button is flat.{0}{0}" +
                        "2. The Cancel button has no border.{0}{0}" +
-                       "3. The Cancel button highlights on mouseover.",
+                       "3. The OK button is flat.{0}{0}" +
+                       "4. The OK button has no border.{0}{0}" +
+                       "5. The Star checkbox is flat.{0}{0}" +
+                       "6. The Star checkbox has no border.{0}{0}" +
+                       "7. The Cancel and OK buttons highlight on mouseover.",
                        Environment.NewLine);
                // 
                // _tabPage1
@@ -82,11 +139,10 @@
                _bugDescriptionText2.Multiline = true;
                _bugDescriptionText2.Text = string.Format 
(CultureInfo.InvariantCulture,
                        "Steps to execute:{0}{0}" +
-                       "1. Click on the OK button.{0}{0}" +
-                       "2. Press Tab key.{0}{0}" +
+                       "1. Click on the Star checkbox (2x).{0}{0}" +
                        "Expected result:{0}{0}" +
-                       "1. Focus rectangle is drawn around the Cancel 
button.{0}{0}" +
-                       "2. The Cancel button highlights on mouseover.",
+                       "1. The image of checkbox changes on each click.{0}{0}" 
+
+                       "2. The Star checkbox has no border.",
                        Environment.NewLine);
                // 
                // _tabPage2
@@ -96,9 +152,37 @@
                _tabPage2.Controls.Add (_bugDescriptionText2);
                _tabControl.Controls.Add (_tabPage2);
                // 
+               // _bugDescriptionText3
+               // 
+               _bugDescriptionText3 = new TextBox ();
+               _bugDescriptionText3.Dock = DockStyle.Fill;
+               _bugDescriptionText3.Multiline = true;
+               _bugDescriptionText3.Text = string.Format 
(CultureInfo.InvariantCulture,
+                       "Steps to execute:{0}{0}" +
+                       "1. Click on the OK button.{0}{0}" +
+                       "2. Press Tab key.{0}{0}" +
+                       "3. Press Tab key.{0}{0}" +
+                       "4. Press Tab key.{0}{0}" +
+                       "Expected result:{0}{0}" +
+                       "1. On step 2, a focus rectangle is drawn around the " +
+                       "Cancel button.{0}{0}" +
+                       "2. On step 3, a focus rectangle is drawn around the " +
+                       "Star checkbox.{0}{0}" +
+                       "3. On step 4, a focus rectangle is drawn around the " +
+                       "OK button.{0}{0}" +
+                       "4. The Cancel and OK buttons highlight on mouseover.",
+                       Environment.NewLine);
+               // 
+               // _tabPage3
+               // 
+               _tabPage3 = new TabPage ();
+               _tabPage3.Text = "#2";
+               _tabPage3.Controls.Add (_bugDescriptionText3);
+               _tabControl.Controls.Add (_tabPage3);
+               // 
                // InstructionsForm
                // 
-               ClientSize = new Size (360, 190);
+               ClientSize = new Size (360, 300);
                Location = new Point (600, 100);
                StartPosition = FormStartPosition.Manual;
                Text = "Instructions - bug #82081";
@@ -106,7 +190,9 @@
 
        private TextBox _bugDescriptionText1;
        private TextBox _bugDescriptionText2;
+       private TextBox _bugDescriptionText3;
        private TabControl _tabControl;
        private TabPage _tabPage1;
        private TabPage _tabPage2;
+       private TabPage _tabPage3;
 }

Added: trunk/gert/interactive/bug82081/star-inactive.png
===================================================================
(Binary files differ)


Property changes on: trunk/gert/interactive/bug82081/star-inactive.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/gert/interactive/bug82081/star.png
===================================================================
(Binary files differ)


Property changes on: trunk/gert/interactive/bug82081/star.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

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

Reply via email to