ReportNameDlg.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. /**
  2. Licensed Materials - Property of IBM
  3. IBM Cognos Products: DOCS
  4. (C) Copyright IBM Corp. 2005
  5. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with
  6. IBM Corp.
  7. */
  8. using System;
  9. using System.Drawing;
  10. using System.Collections;
  11. using System.ComponentModel;
  12. using System.Windows.Forms;
  13. namespace CreateReport
  14. {
  15. /// <summary>
  16. /// Summary description for ReportNameDlg.
  17. /// </summary>
  18. public class ReportNameDlg : System.Windows.Forms.Form
  19. {
  20. private System.Windows.Forms.Label label1;
  21. private System.Windows.Forms.TextBox reportNameTB;
  22. private System.Windows.Forms.Button buttonOK;
  23. private System.Windows.Forms.Button buttonCancel;
  24. /// <summary>
  25. /// Required designer variable.
  26. /// </summary>
  27. private System.ComponentModel.Container components = null;
  28. public bool isOKed = false;
  29. public ReportNameDlg()
  30. {
  31. //
  32. // Required for Windows Form Designer support
  33. //
  34. InitializeComponent();
  35. //
  36. // TODO: Add any constructor code after InitializeComponent call
  37. //
  38. }
  39. /// <summary>
  40. /// Clean up any resources being used.
  41. /// </summary>
  42. protected override void Dispose( bool disposing )
  43. {
  44. if( disposing )
  45. {
  46. if(components != null)
  47. {
  48. components.Dispose();
  49. }
  50. }
  51. base.Dispose( disposing );
  52. }
  53. #region Windows Form Designer generated code
  54. /// <summary>
  55. /// Required method for Designer support - do not modify
  56. /// the contents of this method with the code editor.
  57. /// </summary>
  58. private void InitializeComponent()
  59. {
  60. System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ReportNameDlg));
  61. this.label1 = new System.Windows.Forms.Label();
  62. this.reportNameTB = new System.Windows.Forms.TextBox();
  63. this.buttonOK = new System.Windows.Forms.Button();
  64. this.buttonCancel = new System.Windows.Forms.Button();
  65. this.SuspendLayout();
  66. //
  67. // label1
  68. //
  69. this.label1.Location = new System.Drawing.Point(16, 16);
  70. this.label1.Name = "label1";
  71. this.label1.Size = new System.Drawing.Size(264, 23);
  72. this.label1.TabIndex = 0;
  73. this.label1.Text = "Please enter a name for the report to be created:";
  74. //
  75. // reportNameTB
  76. //
  77. this.reportNameTB.Location = new System.Drawing.Point(16, 40);
  78. this.reportNameTB.Name = "reportNameTB";
  79. this.reportNameTB.Size = new System.Drawing.Size(344, 20);
  80. this.reportNameTB.TabIndex = 1;
  81. this.reportNameTB.Text = "";
  82. //
  83. // buttonOK
  84. //
  85. this.buttonOK.Location = new System.Drawing.Point(192, 80);
  86. this.buttonOK.Name = "buttonOK";
  87. this.buttonOK.TabIndex = 2;
  88. this.buttonOK.Text = "OK";
  89. this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
  90. //
  91. // buttonCancel
  92. //
  93. this.buttonCancel.Location = new System.Drawing.Point(280, 80);
  94. this.buttonCancel.Name = "buttonCancel";
  95. this.buttonCancel.TabIndex = 3;
  96. this.buttonCancel.Text = "Cancel";
  97. this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
  98. //
  99. // ReportNameDlg
  100. //
  101. this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  102. this.ClientSize = new System.Drawing.Size(376, 110);
  103. this.ControlBox = false;
  104. this.Controls.Add(this.buttonCancel);
  105. this.Controls.Add(this.buttonOK);
  106. this.Controls.Add(this.reportNameTB);
  107. this.Controls.Add(this.label1);
  108. this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
  109. this.MaximizeBox = false;
  110. this.MinimizeBox = false;
  111. this.Name = "ReportNameDlg";
  112. this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
  113. this.Text = "Report Name";
  114. this.ResumeLayout(false);
  115. }
  116. #endregion
  117. private void buttonOK_Click(object sender, System.EventArgs e)
  118. {
  119. isOKed = true;
  120. if ( (reportNameTB.Text == null) || (0 == reportNameTB.Text.CompareTo("")) )
  121. {
  122. MessageBox.Show("Please enter a name for the report to be created.");
  123. }
  124. else
  125. {
  126. this.Close();
  127. }
  128. }
  129. private void buttonCancel_Click(object sender, System.EventArgs e)
  130. {
  131. isOKed = false;
  132. this.Close();
  133. }
  134. public string getReportName()
  135. {
  136. return reportNameTB.Text;
  137. }
  138. }
  139. }