Permalink
Browse files

Sample test that shows scrolling behavoir.

svn path=/trunk/winforms/; revision=51529
  • Loading branch information...
1 parent 64fd532 commit 87681180daec89444fdfec29710476ee9e605fcf Jackson Harper committed Oct 10, 2005
Showing with 64 additions and 0 deletions.
  1. +10 −0 scrolling/Makefile
  2. +54 −0 scrolling/swf-scrolling.cs
View
@@ -0,0 +1,10 @@
+all: mono
+
+mono: swf-scrolling.cs
+ mcs swf-scrolling.cs /r:System.Windows.Forms.dll /r:System.Drawing.dll
+
+dotnet: swf-scrolling.cs
+ csc swf-scrolling.cs /r:System.Windows.Forms.dll /r:System.Drawing.dll
+
+clean:
+ rm swf-scrolling.exe -r -f
View
@@ -0,0 +1,54 @@
+//
+// Simple test of our scrolling behavoir
+//
+// Author(s):
+// Jackson Harper
+//
+// Copyright (c) 2005 Novell, Inc.
+//
+
+
+using System;
+using System.Drawing;
+using System.Windows.Forms;
+
+
+public class ScrollingTest : Form {
+
+ private ScrollableControl scrollable;
+ private int paint_count;
+ private Button paint_count_button;
+
+ public ScrollingTest ()
+ {
+ paint_count_button = new Button ();
+ paint_count_button.Text = "Print Paint Count (stdout)";
+ paint_count_button.Dock = DockStyle.Bottom;
+ paint_count_button.Click += new EventHandler (PrintPaintCount);
+
+ scrollable = new ScrollableControl ();
+ scrollable.Dock = DockStyle.Fill;
+ scrollable.BackColor = Color.Red;
+ scrollable.Paint += new PaintEventHandler (PaintArea);
+
+ Controls.Add (paint_count_button);
+ Controls.Add (scrollable);
+ }
+
+ private void PaintArea (object sender, PaintEventArgs pe)
+ {
+ pe.Graphics.FillRectangle (new SolidBrush (Color.Blue), pe.ClipRectangle);
+ paint_count++;
+ }
+
+ private void PrintPaintCount (object sender, EventArgs e)
+ {
+ Console.WriteLine ("Paint Count: {0}", paint_count);
+ }
+
+ public static void Main ()
+ {
+ Application.Run (new ScrollingTest ());
+ }
+}
+

0 comments on commit 8768118

Please sign in to comment.