SamplesAbout.cs 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. /**
  2. Licensed Materials - Property of IBM
  3. IBM Cognos Products: DOCS
  4. (C) Copyright IBM Corp. 2005, 2008
  5. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with
  6. IBM Corp.
  7. */
  8. // Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  9. // Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  10. using System;
  11. using System.Drawing;
  12. using System.Collections;
  13. using System.ComponentModel;
  14. using System.Windows.Forms;
  15. namespace SamplesCommon
  16. {
  17. /// <summary>
  18. /// A standard "About" dialog box for the samples.
  19. ///
  20. /// You need to add an Activated event handler after creating the
  21. /// dialog; your event handler needs to set the applicationName
  22. /// and applicationVersion properties there.
  23. /// </summary>
  24. public class SamplesAbout : System.Windows.Forms.Form
  25. {
  26. private System.Windows.Forms.PictureBox aboutIcon;
  27. private System.Windows.Forms.Label appName;
  28. private System.Windows.Forms.Label versionText;
  29. private System.Windows.Forms.PictureBox line;
  30. private System.Windows.Forms.Label descriptionText;
  31. private System.Windows.Forms.Label warningLabel;
  32. private System.Windows.Forms.Label warningText;
  33. private System.Windows.Forms.Button okButton;
  34. /// <summary>
  35. /// Required designer variable.
  36. /// </summary>
  37. private System.ComponentModel.Container components = null;
  38. public SamplesAbout()
  39. {
  40. //
  41. // Required for Windows Form Designer support
  42. //
  43. InitializeComponent();
  44. }
  45. /// <summary>
  46. /// Clean up any resources being used.
  47. /// </summary>
  48. protected override void Dispose( bool disposing )
  49. {
  50. if( disposing )
  51. {
  52. if(components != null)
  53. {
  54. components.Dispose();
  55. }
  56. }
  57. base.Dispose( disposing );
  58. }
  59. #region Windows Form Designer generated code
  60. /// <summary>
  61. /// Required method for Designer support - do not modify
  62. /// the contents of this method with the code editor.
  63. /// </summary>
  64. private void InitializeComponent()
  65. {
  66. System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(SamplesAbout));
  67. this.aboutIcon = new System.Windows.Forms.PictureBox();
  68. this.appName = new System.Windows.Forms.Label();
  69. this.versionText = new System.Windows.Forms.Label();
  70. this.line = new System.Windows.Forms.PictureBox();
  71. this.descriptionText = new System.Windows.Forms.Label();
  72. this.warningLabel = new System.Windows.Forms.Label();
  73. this.warningText = new System.Windows.Forms.Label();
  74. this.okButton = new System.Windows.Forms.Button();
  75. this.SuspendLayout();
  76. //
  77. // aboutIcon
  78. //
  79. this.aboutIcon.Image = ((System.Drawing.Image)(resources.GetObject("aboutIcon.Image")));
  80. this.aboutIcon.Location = new System.Drawing.Point(16, 16);
  81. this.aboutIcon.Name = "aboutIcon";
  82. this.aboutIcon.Size = new System.Drawing.Size(32, 32);
  83. this.aboutIcon.TabIndex = 0;
  84. this.aboutIcon.TabStop = false;
  85. //
  86. // appName
  87. //
  88. this.appName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  89. | System.Windows.Forms.AnchorStyles.Right)));
  90. this.appName.Location = new System.Drawing.Point(64, 16);
  91. this.appName.Name = "appName";
  92. this.appName.Size = new System.Drawing.Size(208, 24);
  93. this.appName.TabIndex = 1;
  94. this.appName.Text = "(Application Name)";
  95. //
  96. // versionText
  97. //
  98. this.versionText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  99. | System.Windows.Forms.AnchorStyles.Right)));
  100. this.versionText.Location = new System.Drawing.Point(64, 48);
  101. this.versionText.Name = "versionText";
  102. this.versionText.Size = new System.Drawing.Size(208, 24);
  103. this.versionText.TabIndex = 2;
  104. this.versionText.Text = "(Version)";
  105. //
  106. // line
  107. //
  108. this.line.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
  109. this.line.Location = new System.Drawing.Point(8, 128);
  110. this.line.Name = "line";
  111. this.line.Size = new System.Drawing.Size(272, 4);
  112. this.line.TabIndex = 3;
  113. this.line.TabStop = false;
  114. //
  115. // descriptionText
  116. //
  117. this.descriptionText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  118. | System.Windows.Forms.AnchorStyles.Right)));
  119. this.descriptionText.Location = new System.Drawing.Point(64, 80);
  120. this.descriptionText.Name = "descriptionText";
  121. this.descriptionText.Size = new System.Drawing.Size(208, 40);
  122. this.descriptionText.TabIndex = 4;
  123. this.descriptionText.Text = "This application demonstrates the IBM Cognos Software Development Kit.";
  124. //
  125. // warningLabel
  126. //
  127. this.warningLabel.Location = new System.Drawing.Point(8, 152);
  128. this.warningLabel.Name = "warningLabel";
  129. this.warningLabel.Size = new System.Drawing.Size(56, 23);
  130. this.warningLabel.TabIndex = 5;
  131. this.warningLabel.Text = "Warning:";
  132. this.warningLabel.TextAlign = System.Drawing.ContentAlignment.TopRight;
  133. //
  134. // warningText
  135. //
  136. this.warningText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  137. | System.Windows.Forms.AnchorStyles.Right)));
  138. this.warningText.Location = new System.Drawing.Point(72, 152);
  139. this.warningText.Name = "warningText";
  140. this.warningText.Size = new System.Drawing.Size(200, 32);
  141. this.warningText.TabIndex = 6;
  142. this.warningText.Text = "This application is not supported by Cognos.";
  143. //
  144. // okButton
  145. //
  146. this.okButton.Location = new System.Drawing.Point(200, 200);
  147. this.okButton.Name = "okButton";
  148. this.okButton.TabIndex = 7;
  149. this.okButton.Text = "OK";
  150. this.okButton.Click += new System.EventHandler(this.okButton_Click);
  151. //
  152. // SamplesAbout
  153. //
  154. this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  155. this.ClientSize = new System.Drawing.Size(292, 238);
  156. this.Controls.Add(this.okButton);
  157. this.Controls.Add(this.warningText);
  158. this.Controls.Add(this.warningLabel);
  159. this.Controls.Add(this.descriptionText);
  160. this.Controls.Add(this.line);
  161. this.Controls.Add(this.versionText);
  162. this.Controls.Add(this.appName);
  163. this.Controls.Add(this.aboutIcon);
  164. this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
  165. this.Name = "SamplesAbout";
  166. this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
  167. this.Text = "About this sample...";
  168. this.ResumeLayout(false);
  169. }
  170. #endregion
  171. /// <summary>
  172. /// Close the dialog when the OK button is clicked.
  173. /// </summary>
  174. /// <param name="sender">What object sent this event? (not used)</param>
  175. /// <param name="e">Event-specific data. (not used)</param>
  176. private void okButton_Click(object sender, System.EventArgs e) {
  177. this.Close();
  178. }
  179. /// <summary>
  180. /// The application's name, as shown in the About dialog box.
  181. /// </summary>
  182. public string applicationName {
  183. set {
  184. appName.Text = value;
  185. }
  186. get {
  187. return appName.Text;
  188. }
  189. }
  190. /// <summary>
  191. /// The application's version string, as shown in the About dialog box.
  192. /// </summary>
  193. public string applicationVersion {
  194. set {
  195. versionText.Text = value;
  196. }
  197. get {
  198. return versionText.Text;
  199. }
  200. }
  201. }
  202. }