Permalink
Browse files

Testcase for Help class

svn path=/trunk/winforms/; revision=44931
  • Loading branch information...
1 parent ce7a189 commit 5ff649b23951df0fcfac860492b4d44289870ac8 Peter Dennis Bartok committed May 24, 2005
Showing with 111 additions and 0 deletions.
  1. +7 −0 help/Makefile
  2. BIN help/swf-help.chm
  3. +104 −0 help/swf-help.cs
View
7 help/Makefile
@@ -0,0 +1,7 @@
+all: mono
+
+mono: swf-help.cs
+ mcs swf-help.cs /r:System.Windows.Forms.dll /r:System.Drawing.dll
+
+clean:
+ rm swf-help.exe -r -f
View
BIN help/swf-help.chm
Binary file not shown.
View
104 help/swf-help.cs
@@ -0,0 +1,104 @@
+using System;
+using System.Drawing;
+using System.Globalization;
+using System.Windows.Forms;
+using System.Threading;
+
+namespace MyFormProject
+{
+ public class MainForm : System.Windows.Forms.Form
+ {
+ static int count;
+
+ // Calendar
+ private System.Windows.Forms.Button button1;
+
+ public MainForm()
+ {
+ InitializeComponent();
+
+ }
+
+ private void InitializeComponent()
+ {
+ count = 0;
+
+ this.button1 = new Button();
+
+ this.button1.Location = new System.Drawing.Point(0, 0);
+ this.button1.Name = "label1";
+ this.button1.Size = new System.Drawing.Size(472, 23);
+ this.button1.TabIndex = 0;
+ this.button1.Text = "Click me for ShowHelp(parent, url)";
+ this.button1.Dock = DockStyle.Fill;
+ this.button1.TextAlign = ContentAlignment.MiddleCenter;
+
+ this.button1.Click +=new EventHandler(button1_Click);
+
+ //
+ // MainForm
+ //
+ this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+ this.ClientSize = new System.Drawing.Size(472, 382);
+
+ this.Controls.Add(this.button1);
+
+ this.Name = "MainForm";
+ this.Text = "SWF-Help";
+ }
+
+ [STAThread]
+ static void Main()
+ {
+ Thread.CurrentThread.CurrentUICulture = new CultureInfo( "de-DE", false );
+ Application.Run(new MainForm());
+ }
+
+ private void button1_Click(object sender, EventArgs e) {
+ switch (count) {
+ case 0: {
+ Help.ShowHelp(this, "swf-help.chm");
+ this.button1.Text = "Click me for ShowHelp(parent, url, HelpNavigator.KeywordIndex, \"Page 2\")";
+ break;
+ }
+
+ case 1: {
+ Help.ShowHelp(this, "swf-help.chm", HelpNavigator.KeywordIndex, "Page 2");
+ this.button1.Text = "Click me for ShowHelp(parent, url, HelpNavigator.Keyword, \"swf-help.chm::/page1.htm\")";
+ break;
+ }
+
+ case 2: {
+ Help.ShowHelp(this, "swf-help.chm", HelpNavigator.Topic, "swf-help.chm::/page1.htm");
+ this.button1.Text = "Click me for ShowHelp(parent, url, \"swf-help.chm::/topic1\"";
+ break;
+ }
+
+ case 3: {
+ Help.ShowHelp(this, "swf-help.chm", "swf-help.chm::/topic1");
+ this.button1.Text = "Click me for ShowHelpIndex(parent, url)";
+ break;
+ }
+
+ case 4: {
+ Help.ShowHelpIndex(this, "swf-help.chm");
+ this.button1.Text = "Click me for ShowHelpPopup(parent, url, Control.MousePosition)";
+ break;
+ }
+
+ case 5: {
+ Help.ShowPopup(this, "swf-help.chm", Control.MousePosition);
+ this.button1.Text = "Click me to exit";
+ break;
+ }
+
+ case 6: {
+ Application.Exit();
+ break;
+ }
+ }
+
+ count++;
+ }
+ }
+}

0 comments on commit 5ff649b

Please sign in to comment.