/** Licensed Materials - Property of IBM IBM Cognos Products: DOCS (C) Copyright IBM Corp. 2005 US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */ using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; namespace CreateReport { /// /// Summary description for ReportNameDlg. /// public class ReportNameDlg : System.Windows.Forms.Form { private System.Windows.Forms.Label label1; private System.Windows.Forms.TextBox reportNameTB; private System.Windows.Forms.Button buttonOK; private System.Windows.Forms.Button buttonCancel; /// /// Required designer variable. /// private System.ComponentModel.Container components = null; public bool isOKed = false; public ReportNameDlg() { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // } /// /// Clean up any resources being used. /// protected override void Dispose( bool disposing ) { if( disposing ) { if(components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region Windows Form Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ReportNameDlg)); this.label1 = new System.Windows.Forms.Label(); this.reportNameTB = new System.Windows.Forms.TextBox(); this.buttonOK = new System.Windows.Forms.Button(); this.buttonCancel = new System.Windows.Forms.Button(); this.SuspendLayout(); // // label1 // this.label1.Location = new System.Drawing.Point(16, 16); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(264, 23); this.label1.TabIndex = 0; this.label1.Text = "Please enter a name for the report to be created:"; // // reportNameTB // this.reportNameTB.Location = new System.Drawing.Point(16, 40); this.reportNameTB.Name = "reportNameTB"; this.reportNameTB.Size = new System.Drawing.Size(344, 20); this.reportNameTB.TabIndex = 1; this.reportNameTB.Text = ""; // // buttonOK // this.buttonOK.Location = new System.Drawing.Point(192, 80); this.buttonOK.Name = "buttonOK"; this.buttonOK.TabIndex = 2; this.buttonOK.Text = "OK"; this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); // // buttonCancel // this.buttonCancel.Location = new System.Drawing.Point(280, 80); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.TabIndex = 3; this.buttonCancel.Text = "Cancel"; this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); // // ReportNameDlg // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(376, 110); this.ControlBox = false; this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonOK); this.Controls.Add(this.reportNameTB); this.Controls.Add(this.label1); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "ReportNameDlg"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Report Name"; this.ResumeLayout(false); } #endregion private void buttonOK_Click(object sender, System.EventArgs e) { isOKed = true; if ( (reportNameTB.Text == null) || (0 == reportNameTB.Text.CompareTo("")) ) { MessageBox.Show("Please enter a name for the report to be created."); } else { this.Close(); } } private void buttonCancel_Click(object sender, System.EventArgs e) { isOKed = false; this.Close(); } public string getReportName() { return reportNameTB.Text; } } }