Author: gert
Date: 2007-05-27 04:56:52 -0400 (Sun, 27 May 2007)
New Revision: 78000

Added:
   trunk/gert/interactive/bug81708/
   trunk/gert/interactive/bug81708/MainForm.cs
   trunk/gert/interactive/bug81708/default.build
   trunk/gert/interactive/bug81744/
   trunk/gert/interactive/bug81744/MainForm.cs
   trunk/gert/interactive/bug81744/default.build
Modified:
   trunk/gert/interactive/bug81695/MainForm.cs
   trunk/gert/interactive/known_issues
Log:
Added tests for bug #81708 and #81744.


Modified: trunk/gert/interactive/bug81695/MainForm.cs
===================================================================
--- trunk/gert/interactive/bug81695/MainForm.cs 2007-05-27 07:25:48 UTC (rev 
77999)
+++ trunk/gert/interactive/bug81695/MainForm.cs 2007-05-27 08:56:52 UTC (rev 
78000)
@@ -138,9 +138,8 @@
                // _bugDescriptionText1
                // 
                _bugDescriptionText1 = new TextBox ();
-               _bugDescriptionText1.Multiline = true;
-               _bugDescriptionText1.Location = new Point (8, 8);
                _bugDescriptionText1.Dock = DockStyle.Fill;
+               _bugDescriptionText1.Multiline = true;
                _bugDescriptionText1.Text = string.Format 
(CultureInfo.InvariantCulture,
                        "Steps to execute:{0}{0}" +
                        "1. Click the Button1 button.{0}{0}" +

Added: trunk/gert/interactive/bug81708/MainForm.cs
===================================================================
--- trunk/gert/interactive/bug81708/MainForm.cs 2007-05-27 07:25:48 UTC (rev 
77999)
+++ trunk/gert/interactive/bug81708/MainForm.cs 2007-05-27 08:56:52 UTC (rev 
78000)
@@ -0,0 +1,127 @@
+using System;
+using System.Drawing;
+using System.Drawing.Printing;
+using System.Globalization;
+using System.Windows.Forms;
+
+public class MainForm : Form
+{
+       public MainForm ()
+       {
+               // 
+               // _printPreviewControl
+               // 
+               _printPreviewControl = new PrintPreviewControl ();
+               _printPreviewControl.Anchor = (AnchorStyles.Top | 
AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
+               _printPreviewControl.Dock = DockStyle.Bottom;
+               _printPreviewControl.Height = 295;
+               _printPreviewControl.TabIndex = 0;
+               _printPreviewControl.Zoom = 1;
+               Controls.Add (_printPreviewControl);
+               // 
+               // _printButton
+               // 
+               _printButton = new Button ();
+               _printButton.Location = new Point (12, 12);
+               _printButton.Size = new Size (75, 23);
+               _printButton.TabIndex = 1;
+               _printButton.Text = "Print";
+               _printButton.Click += new System.EventHandler 
(PrintButton_Click);
+               Controls.Add (_printButton);
+               // 
+               // _printDocument
+               // 
+               _printDocument = new PrintDocument ();
+               _printDocument.PrintPage += new PrintPageEventHandler 
(PrintDocument_PrintPage);
+               _printPreviewControl.Document = _printDocument;
+               // 
+               // MainForm
+               // 
+               ClientSize = new Size (350, 350);
+               Location = new Point (200, 100);
+               StartPosition = FormStartPosition.Manual;
+               Text = "bug #81708";
+               Load += new EventHandler (MainForm_Load);
+       }
+
+       [STAThread]
+       static void Main ()
+       {
+               Application.EnableVisualStyles ();
+               Application.Run (new MainForm ());
+       }
+
+       void MainForm_Load (object sender, EventArgs e)
+       {
+               InstructionsForm instructionsForm = new InstructionsForm ();
+               instructionsForm.Show ();
+       }
+
+       void PrintDocument_PrintPage (object sender, PrintPageEventArgs e)
+       {
+               using (Pen linePen = new Pen (Color.Black, 1f)) {
+                       e.Graphics.DrawLine (linePen, 20, 20, 160, 20);
+                       e.Graphics.DrawLine (linePen, 20, 40, 160, 40);
+               }
+
+               using (SolidBrush stringBrush = new SolidBrush (Color.Black)) {
+                       e.Graphics.DrawString ("This is a test string.", new 
Font (FontFamily.GenericSansSerif, 12f), stringBrush, new PointF (20f, 20f));
+               }
+       }
+
+       void PrintButton_Click (object sender, EventArgs e)
+       {
+               _printDocument.PrintController = new StandardPrintController ();
+               _printPreviewControl.Document.Print ();
+       }
+
+       private PrintPreviewControl _printPreviewControl;
+       private PrintDocument _printDocument;
+       private Button _printButton;
+}
+
+public class InstructionsForm : Form
+{
+       public InstructionsForm ()
+       {
+               // 
+               // _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. Click the Print button.{0}{0}" +
+                       "Expected result:{0}{0}" +
+                       "1. The printed document contains the following 
text:{0}{0}" +
+                       "   -----------------------------{0}" +
+                       "   This is a test string.{0}" +
+                       "   -----------------------------",
+                       Environment.NewLine);
+               // 
+               // _tabPage1
+               // 
+               _tabPage1 = new TabPage ();
+               _tabPage1.Text = "#1";
+               _tabPage1.Controls.Add (_bugDescriptionText1);
+               _tabControl.Controls.Add (_tabPage1);
+               // 
+               // InstructionsForm
+               // 
+               ClientSize = new Size (360, 210);
+               Location = new Point (600, 100);
+               StartPosition = FormStartPosition.Manual;
+               Text = "Instructions - bug #81708";
+       }
+
+       private TextBox _bugDescriptionText1;
+       private TabControl _tabControl;
+       private TabPage _tabPage1;
+}


Property changes on: trunk/gert/interactive/bug81708/MainForm.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/interactive/bug81708/default.build
===================================================================
--- trunk/gert/interactive/bug81708/default.build       2007-05-27 07:25:48 UTC 
(rev 77999)
+++ trunk/gert/interactive/bug81708/default.build       2007-05-27 08:56:52 UTC 
(rev 78000)
@@ -0,0 +1,62 @@
+<project name="bug81708" 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/bug81708/default.build
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/interactive/bug81744/MainForm.cs
===================================================================
--- trunk/gert/interactive/bug81744/MainForm.cs 2007-05-27 07:25:48 UTC (rev 
77999)
+++ trunk/gert/interactive/bug81744/MainForm.cs 2007-05-27 08:56:52 UTC (rev 
78000)
@@ -0,0 +1,152 @@
+using System;
+using System.Drawing;
+using System.Drawing.Printing;
+using System.Globalization;
+using System.Windows.Forms;
+
+public class MainForm : Form
+{
+       public MainForm ()
+       {
+               // 
+               // _printPreviewControl
+               // 
+               _printPreviewControl = new PrintPreviewControl ();
+               _printPreviewControl.Anchor = (AnchorStyles.Top | 
AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
+               _printPreviewControl.Dock = DockStyle.Bottom;
+               _printPreviewControl.Height = 295;
+               _printPreviewControl.TabIndex = 0;
+               _printPreviewControl.Zoom = 1;
+               Controls.Add (_printPreviewControl);
+               // 
+               // _printButton
+               // 
+               _zoomTrackBar = new TrackBar ();
+               _zoomTrackBar.Location = new Point (12, 12);
+               _zoomTrackBar.Maximum = 100;
+               _zoomTrackBar.Minimum = 1;
+               _zoomTrackBar.Size = new Size (330, 23);
+               _zoomTrackBar.TabIndex = 1;
+               _zoomTrackBar.Text = "Zoom";
+               _zoomTrackBar.Value = 10;
+               _zoomTrackBar.ValueChanged += new EventHandler 
(ZoomTrackBar_ValueChanged);
+               Controls.Add (_zoomTrackBar);
+               // 
+               // _printDocument
+               // 
+               _printDocument = new PrintDocument ();
+               _printDocument.PrintPage += new PrintPageEventHandler 
(PrintDocument_PrintPage);
+               _printPreviewControl.Document = _printDocument;
+               // 
+               // MainForm
+               // 
+               ClientSize = new Size (350, 350);
+               Location = new Point (200, 100);
+               StartPosition = FormStartPosition.Manual;
+               Text = "bug #81744";
+               Load += new EventHandler (MainForm_Load);
+       }
+
+       [STAThread]
+       static void Main ()
+       {
+               Application.EnableVisualStyles ();
+               Application.Run (new MainForm ());
+       }
+
+       void MainForm_Load (object sender, EventArgs e)
+       {
+               InstructionsForm instructionsForm = new InstructionsForm ();
+               instructionsForm.Show ();
+       }
+
+       void PrintDocument_PrintPage (object sender, PrintPageEventArgs e)
+       {
+               using (Pen linePen = new Pen (Color.Black, 1f)) {
+                       e.Graphics.DrawLine (linePen, 20, 20, 160, 20);
+                       e.Graphics.DrawLine (linePen, 20, 40, 160, 40);
+               }
+
+               using (SolidBrush stringBrush = new SolidBrush (Color.Black)) {
+                       e.Graphics.DrawString ("This is a test string.", new 
Font (FontFamily.GenericSansSerif, 12f), stringBrush, new PointF (20f, 20f));
+               }
+       }
+
+       void ZoomTrackBar_ValueChanged (object sender, EventArgs e)
+       {
+               _printPreviewControl.Zoom = (double) _zoomTrackBar.Value / 10d;
+       }
+
+       private PrintPreviewControl _printPreviewControl;
+       private PrintDocument _printDocument;
+       private TrackBar _zoomTrackBar;
+}
+
+public class InstructionsForm : Form
+{
+       public InstructionsForm ()
+       {
+               // 
+               // _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,
+                       "Expected result on start-up:{0}{0}" +
+                       "1. The document in the PrintPreviewControl contains 
the following " +
+                       "text:{0}{0}" +
+                       "   -----------------------------{0}" +
+                       "   This is a test string.{0}" +
+                       "   -----------------------------{0}{0}" +
+                       "2. The text can easily be read.{0}{0}" +
+                       "3. Scrollbars are displayed that can be used to scroll 
though " +
+                       "the document.",
+                       Environment.NewLine);
+               // 
+               // _tabPage1
+               // 
+               _tabPage1 = new TabPage ();
+               _tabPage1.Text = "#1";
+               _tabPage1.Controls.Add (_bugDescriptionText1);
+               _tabControl.Controls.Add (_tabPage1);
+               // 
+               // _bugDescriptionText2
+               // 
+               _bugDescriptionText2 = new TextBox ();
+               _bugDescriptionText2.Dock = DockStyle.Fill;
+               _bugDescriptionText2.Multiline = true;
+               _bugDescriptionText2.Text = string.Format 
(CultureInfo.InvariantCulture,
+                       "Steps to execute:{0}{0}" +
+                       "1. Move the grip of the TrackBar in either 
direction.{0}{0}" +
+                       "Expected result:{0}{0}" +
+                       "1. The zoom level of the displayed document modifies 
accordingly.",
+                       Environment.NewLine);
+               // 
+               // _tabPage2
+               // 
+               _tabPage2 = new TabPage ();
+               _tabPage2.Text = "#2";
+               _tabPage2.Controls.Add (_bugDescriptionText2);
+               _tabControl.Controls.Add (_tabPage2);
+               // 
+               // InstructionsForm
+               // 
+               ClientSize = new Size (360, 210);
+               Location = new Point (600, 100);
+               StartPosition = FormStartPosition.Manual;
+               Text = "Instructions - bug #81744";
+       }
+
+       private TextBox _bugDescriptionText1;
+       private TextBox _bugDescriptionText2;
+       private TabControl _tabControl;
+       private TabPage _tabPage1;
+       private TabPage _tabPage2;
+}


Property changes on: trunk/gert/interactive/bug81744/MainForm.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/interactive/bug81744/default.build
===================================================================
--- trunk/gert/interactive/bug81744/default.build       2007-05-27 07:25:48 UTC 
(rev 77999)
+++ trunk/gert/interactive/bug81744/default.build       2007-05-27 08:56:52 UTC 
(rev 78000)
@@ -0,0 +1,62 @@
+<project name="bug81744" 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/bug81744/default.build
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/gert/interactive/known_issues
===================================================================
--- trunk/gert/interactive/known_issues 2007-05-27 07:25:48 UTC (rev 77999)
+++ trunk/gert/interactive/known_issues 2007-05-27 08:56:52 UTC (rev 78000)
@@ -39,3 +39,4 @@
 bug81718/**
 bug81721/**
 bug81722/**
+bug81744/**

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

Reply via email to