source: Scheduling/trunk/cs/bsdx0200GUISourceCode/DSplash.cs@ 1731

Last change on this file since 1731 was 1728, checked in by Faisal Sami, 8 years ago

ClinicalScheduling version 2.0.

File size: 8.0 KB
Line 
1using System;
2using System.Drawing;
3using System.Collections;
4using System.ComponentModel;
5using System.Windows.Forms;
6
7namespace IndianHealthService.ClinicalScheduling
8{
9 /// <summary>
10 /// Program loading splash screen. Notice the numerous remote methods intended
11 /// to mickey mouse the form from another thread.
12 ///
13 /// I don't know of a better way of doing this right now.
14 /// </summary>
15 public class DSplash : System.Windows.Forms.Form
16 {
17 private System.Windows.Forms.LinkLabel lnkMail;
18 private System.Windows.Forms.Label lblStatus;
19 private Label lblVersion;
20 private ProgressBar progressBar1;
21 /// <summary>
22 /// Required designer variable.
23 /// </summary>
24 private System.ComponentModel.Container components = null;
25
26 public DSplash()
27 {
28 //
29 // Required for Windows Form Designer support
30 //
31 InitializeComponent();
32
33 //
34 // TODO: Add any constructor code after InitializeComponent call
35 //
36 }
37
38 /// <summary>
39 /// Clean up any resources being used.
40 /// </summary>
41 protected override void Dispose( bool disposing )
42 {
43 if( disposing )
44 {
45 if(components != null)
46 {
47 components.Dispose();
48 }
49 }
50 base.Dispose( disposing );
51 }
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.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DSplash));
61 this.lnkMail = new System.Windows.Forms.LinkLabel();
62 this.lblStatus = new System.Windows.Forms.Label();
63 this.lblVersion = new System.Windows.Forms.Label();
64 this.progressBar1 = new System.Windows.Forms.ProgressBar();
65 this.SuspendLayout();
66 //
67 // lnkMail
68 //
69 this.lnkMail.BackColor = System.Drawing.Color.Gray;
70 this.lnkMail.ForeColor = System.Drawing.SystemColors.HotTrack;
71 this.lnkMail.Location = new System.Drawing.Point(489, 229);
72 this.lnkMail.Name = "lnkMail";
73 this.lnkMail.Size = new System.Drawing.Size(100, 23);
74 this.lnkMail.TabIndex = 4;
75 this.lnkMail.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lnkMail_LinkClicked);
76 //
77 // lblStatus
78 //
79 this.lblStatus.BackColor = System.Drawing.Color.Gray;
80 this.lblStatus.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
81 this.lblStatus.ForeColor = System.Drawing.SystemColors.HotTrack;
82 this.lblStatus.Location = new System.Drawing.Point(261, 202);
83 this.lblStatus.Name = "lblStatus";
84 this.lblStatus.Size = new System.Drawing.Size(328, 16);
85 this.lblStatus.TabIndex = 3;
86 this.lblStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
87 this.lblStatus.Click += new System.EventHandler(this.lblStatus_Click);
88 //
89 // lblVersion
90 //
91 this.lblVersion.AutoSize = true;
92 this.lblVersion.BackColor = System.Drawing.Color.Gray;
93 this.lblVersion.ForeColor = System.Drawing.SystemColors.HotTrack;
94 this.lblVersion.Location = new System.Drawing.Point(239, 9);
95 this.lblVersion.Name = "lblVersion";
96 this.lblVersion.Size = new System.Drawing.Size(52, 13);
97 this.lblVersion.TabIndex = 5;
98 this.lblVersion.Text = "lblVersion";
99 this.lblVersion.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
100 //
101 // progressBar1
102 //
103 this.progressBar1.BackColor = System.Drawing.Color.Gray;
104 this.progressBar1.Location = new System.Drawing.Point(60, 164);
105 this.progressBar1.Name = "progressBar1";
106 this.progressBar1.Size = new System.Drawing.Size(458, 14);
107 this.progressBar1.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
108 this.progressBar1.TabIndex = 7;
109 //
110 // DSplash
111 //
112 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
113 this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
114 this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
115 this.ClientSize = new System.Drawing.Size(601, 403);
116 this.ControlBox = false;
117 this.Controls.Add(this.progressBar1);
118 this.Controls.Add(this.lblVersion);
119 this.Controls.Add(this.lblStatus);
120 this.Controls.Add(this.lnkMail);
121 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
122 this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
123 this.Name = "DSplash";
124 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
125 this.Text = "Clinical Scheduling";
126 this.Load += new System.EventHandler(this.DSplash_Load);
127 this.ResumeLayout(false);
128 this.PerformLayout();
129
130 }
131 #endregion
132
133 public delegate void dSetStatus(string sStatus);
134 public delegate void dAny();
135 public delegate void dProgressBarSet(int number);
136 public delegate DialogResult dMessageBox(IWin32Window owner, string message);
137 public delegate DialogResult dMessageBox2(IWin32Window owner, string message, string caption, MessageBoxButtons btns);
138
139 public void SetStatus(string sStatus)
140 {
141 if (this.InvokeRequired == true)
142 {
143 dSetStatus d = new dSetStatus(SetStatus);
144 this.Invoke(d, new object[] { sStatus });
145 return;
146 }
147
148 this.lblStatus.Text = sStatus;
149 }
150
151 private void DSplash_Load(object sender, System.EventArgs e)
152 {
153 this.lblVersion.Text = "Version " + Application.ProductVersion;
154 }
155
156 public DialogResult RemoteMsgBox(string msg)
157 {
158 dMessageBox d = new dMessageBox(MessageBox.Show);
159 return (DialogResult)this.Invoke(d, this, msg);
160 }
161
162 public DialogResult RemoteMsgBox(string msg, string caption, MessageBoxButtons btns)
163 {
164 dMessageBox2 d = new dMessageBox2(MessageBox.Show);
165 return (DialogResult)this.Invoke(d, this, msg, caption, btns);
166 }
167
168 public void RemoteClose()
169 {
170 dAny d = new dAny(this.Close);
171 this.Invoke(d);
172 }
173
174 public void RemoteActivate()
175 {
176 dAny d = new dAny(this.Activate);
177 this.Invoke(d);
178 }
179
180 public void RemoteHide()
181 {
182 dAny d = new dAny(this.Hide);
183 this.Invoke(d);
184 }
185
186 public void RemoteProgressBarMaxSet(int max)
187 {
188 if (this.InvokeRequired == true)
189 {
190 dProgressBarSet d = new dProgressBarSet(RemoteProgressBarMaxSet);
191 this.Invoke(d, new object[] { max });
192 return;
193 }
194
195 this.progressBar1.Maximum = max;
196 }
197
198 public void RemoteProgressBarValueSet(int val)
199 {
200 if (this.InvokeRequired == true)
201 {
202 dProgressBarSet d = new dProgressBarSet(RemoteProgressBarValueSet);
203 this.Invoke(d, new object[] { val });
204 return;
205 }
206
207 this.progressBar1.Value = val;
208 }
209
210 private void label2_Click(object sender, EventArgs e)
211 {
212
213 }
214
215 private void lblStatus_Click(object sender, EventArgs e)
216 {
217
218 }
219
220 private void lnkMail_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
221 {
222
223 }
224 }
225}
Note: See TracBrowser for help on using the repository browser.