00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 using System;
00020 using System.Drawing;
00021 using System.Collections;
00022 using System.ComponentModel;
00023 using System.Windows.Forms;
00024
00025 namespace SimImmuno
00026 {
00027 public class frmOptions : System.Windows.Forms.Form
00028 {
00029 #region Déclarations et initialisation
00030 private System.Windows.Forms.CheckBox cbDebug;
00031 private System.Windows.Forms.Button button1;
00032 private System.Windows.Forms.Button button2;
00033 private System.Windows.Forms.GroupBox groupBox1;
00034 private System.Windows.Forms.CheckBox cbLogLimit;
00035 private System.Windows.Forms.Label label6;
00036 private System.Windows.Forms.TextBox txtLimit;
00037 private System.Windows.Forms.GroupBox groupBox2;
00038 private System.Windows.Forms.CheckBox cbAOTLog;
00039 private System.Windows.Forms.CheckBox cbAOTControl;
00040 private System.ComponentModel.Container components = null;
00041
00042 public frmOptions()
00043 {
00044 InitializeComponent();
00045 }
00046 #endregion
00047
00048 #region Fonctions de base .NET
00049 protected override void Dispose( bool disposing )
00050 {
00051 if( disposing )
00052 {
00053 if(components != null)
00054 {
00055 components.Dispose();
00056 }
00057 }
00058 base.Dispose( disposing );
00059 }
00060
00061 #region Windows Form Designer generated code
00066 private void InitializeComponent()
00067 {
00068 System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmOptions));
00069 this.cbDebug = new System.Windows.Forms.CheckBox();
00070 this.button1 = new System.Windows.Forms.Button();
00071 this.button2 = new System.Windows.Forms.Button();
00072 this.groupBox1 = new System.Windows.Forms.GroupBox();
00073 this.txtLimit = new System.Windows.Forms.TextBox();
00074 this.label6 = new System.Windows.Forms.Label();
00075 this.cbLogLimit = new System.Windows.Forms.CheckBox();
00076 this.groupBox2 = new System.Windows.Forms.GroupBox();
00077 this.cbAOTControl = new System.Windows.Forms.CheckBox();
00078 this.cbAOTLog = new System.Windows.Forms.CheckBox();
00079 this.groupBox1.SuspendLayout();
00080 this.groupBox2.SuspendLayout();
00081 this.SuspendLayout();
00082
00083
00084
00085 this.cbDebug.Location = new System.Drawing.Point(8, 16);
00086 this.cbDebug.Name = "cbDebug";
00087 this.cbDebug.TabIndex = 0;
00088 this.cbDebug.Text = "Mode DEBUG";
00089
00090
00091
00092 this.button1.Location = new System.Drawing.Point(88, 152);
00093 this.button1.Name = "button1";
00094 this.button1.TabIndex = 6;
00095 this.button1.Text = "Annuler";
00096 this.button1.Click += new System.EventHandler(this.button1_Click);
00097
00098
00099
00100 this.button2.Location = new System.Drawing.Point(8, 152);
00101 this.button2.Name = "button2";
00102 this.button2.TabIndex = 7;
00103 this.button2.Text = "OK";
00104 this.button2.Click += new System.EventHandler(this.button2_Click);
00105
00106
00107
00108 this.groupBox1.Controls.Add(this.txtLimit);
00109 this.groupBox1.Controls.Add(this.label6);
00110 this.groupBox1.Controls.Add(this.cbLogLimit);
00111 this.groupBox1.Controls.Add(this.cbDebug);
00112 this.groupBox1.Location = new System.Drawing.Point(8, 0);
00113 this.groupBox1.Name = "groupBox1";
00114 this.groupBox1.Size = new System.Drawing.Size(152, 80);
00115 this.groupBox1.TabIndex = 8;
00116 this.groupBox1.TabStop = false;
00117 this.groupBox1.Text = "Evénements";
00118
00119
00120
00121 this.txtLimit.Enabled = false;
00122 this.txtLimit.Location = new System.Drawing.Point(96, 56);
00123 this.txtLimit.Name = "txtLimit";
00124 this.txtLimit.Size = new System.Drawing.Size(32, 20);
00125 this.txtLimit.TabIndex = 3;
00126 this.txtLimit.Text = "20";
00127
00128
00129
00130 this.label6.Location = new System.Drawing.Point(40, 60);
00131 this.label6.Name = "label6";
00132 this.label6.Size = new System.Drawing.Size(56, 16);
00133 this.label6.TabIndex = 2;
00134 this.label6.Text = "Nombre :";
00135
00136
00137
00138 this.cbLogLimit.Location = new System.Drawing.Point(8, 40);
00139 this.cbLogLimit.Name = "cbLogLimit";
00140 this.cbLogLimit.Size = new System.Drawing.Size(136, 16);
00141 this.cbLogLimit.TabIndex = 1;
00142 this.cbLogLimit.Text = "Limiter les événements";
00143 this.cbLogLimit.CheckedChanged += new System.EventHandler(this.cbLogLimit_CheckedChanged);
00144
00145
00146
00147 this.groupBox2.Controls.Add(this.cbAOTControl);
00148 this.groupBox2.Controls.Add(this.cbAOTLog);
00149 this.groupBox2.Location = new System.Drawing.Point(8, 80);
00150 this.groupBox2.Name = "groupBox2";
00151 this.groupBox2.Size = new System.Drawing.Size(152, 64);
00152 this.groupBox2.TabIndex = 9;
00153 this.groupBox2.TabStop = false;
00154 this.groupBox2.Text = "Toujours au 1er plan";
00155
00156
00157
00158 this.cbAOTControl.Checked = true;
00159 this.cbAOTControl.CheckState = System.Windows.Forms.CheckState.Checked;
00160 this.cbAOTControl.Location = new System.Drawing.Point(8, 40);
00161 this.cbAOTControl.Name = "cbAOTControl";
00162 this.cbAOTControl.Size = new System.Drawing.Size(128, 16);
00163 this.cbAOTControl.TabIndex = 1;
00164 this.cbAOTControl.Text = "Fenêtre de Contrôle";
00165
00166
00167
00168 this.cbAOTLog.Checked = true;
00169 this.cbAOTLog.CheckState = System.Windows.Forms.CheckState.Checked;
00170 this.cbAOTLog.Location = new System.Drawing.Point(8, 16);
00171 this.cbAOTLog.Name = "cbAOTLog";
00172 this.cbAOTLog.Size = new System.Drawing.Size(136, 16);
00173 this.cbAOTLog.TabIndex = 0;
00174 this.cbAOTLog.Text = "Fenêtre d\'événements";
00175
00176
00177
00178 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
00179 this.ClientSize = new System.Drawing.Size(170, 183);
00180 this.Controls.Add(this.groupBox2);
00181 this.Controls.Add(this.groupBox1);
00182 this.Controls.Add(this.button2);
00183 this.Controls.Add(this.button1);
00184 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
00185 this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
00186 this.MaximizeBox = false;
00187 this.MinimizeBox = false;
00188 this.Name = "frmOptions";
00189 this.ShowInTaskbar = false;
00190 this.Text = "Options";
00191 this.Load += new System.EventHandler(this.frmOptions_Load);
00192 this.groupBox1.ResumeLayout(false);
00193 this.groupBox2.ResumeLayout(false);
00194 this.ResumeLayout(false);
00195
00196 }
00197 #endregion
00198 #endregion
00199
00200 #region Fct Options
00201 private void frmOptions_Load(object sender, System.EventArgs e)
00202 {
00203
00204 cbDebug.Checked = frmMain.log_debug;
00205 cbAOTControl.Checked = frmMain.control.TopMost;
00206 cbAOTLog.Checked = frmMain.log.TopMost;
00207 cbLogLimit.Checked = frmMain.log_limit;
00208 if(cbLogLimit.Checked)
00209 {
00210 txtLimit.Enabled = true;
00211 txtLimit.Text = frmMain.log_limit_size.ToString();
00212 }
00213 }
00214
00215 private void button2_Click(object sender, System.EventArgs e)
00216 {
00217
00218 try
00219 {
00220 frmMain.control.TopMost = cbAOTControl.Checked;
00221 frmMain.log.TopMost = cbAOTLog.Checked;
00222 frmMain.SetLog(cbDebug.Checked,cbLogLimit.Checked,Convert.ToInt16(txtLimit.Text));
00223 MessageBox.Show("Options validées","SimImmuno",MessageBoxButtons.OK,MessageBoxIcon.Information);
00224 this.Hide();
00225 }
00226 catch(Exception exx)
00227 {
00228 MessageBox.Show("Erreur : " + exx.Message.ToString(),"SimImmuno",MessageBoxButtons.OK,MessageBoxIcon.Error);
00229 }
00230 }
00231
00232 private void button1_Click(object sender, System.EventArgs e)
00233 {
00234
00235 this.Hide();
00236 }
00237
00238 private void cbLogLimit_CheckedChanged(object sender, System.EventArgs e)
00239 {
00240
00241 if(txtLimit.Enabled)
00242 txtLimit.Enabled = false;
00243 else
00244 txtLimit.Enabled = true;
00245 }
00246 #endregion
00247 }
00248 }