aboutsummaryrefslogtreecommitdiff
path: root/TimeHACK.Engine/Template
diff options
context:
space:
mode:
Diffstat (limited to 'TimeHACK.Engine/Template')
-rw-r--r--TimeHACK.Engine/Template/Infobox95.Designer.cs73
-rw-r--r--TimeHACK.Engine/Template/Infobox95.cs66
2 files changed, 116 insertions, 23 deletions
diff --git a/TimeHACK.Engine/Template/Infobox95.Designer.cs b/TimeHACK.Engine/Template/Infobox95.Designer.cs
index 5c88e92..3c05dbd 100644
--- a/TimeHACK.Engine/Template/Infobox95.Designer.cs
+++ b/TimeHACK.Engine/Template/Infobox95.Designer.cs
@@ -29,10 +29,12 @@
private void InitializeComponent()
{
this.programContent = new System.Windows.Forms.Panel();
+ this.button1 = new System.Windows.Forms.Button();
+ this.button3 = new System.Windows.Forms.Button();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.panel1 = new System.Windows.Forms.Panel();
this.infoText = new System.Windows.Forms.Label();
- this.ok = new System.Windows.Forms.Button();
+ this.button2 = new System.Windows.Forms.Button();
this.programContent.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.panel1.SuspendLayout();
@@ -41,22 +43,51 @@
// programContent
//
this.programContent.BackColor = System.Drawing.Color.Silver;
+ this.programContent.Controls.Add(this.button1);
+ this.programContent.Controls.Add(this.button3);
this.programContent.Controls.Add(this.pictureBox1);
this.programContent.Controls.Add(this.panel1);
- this.programContent.Controls.Add(this.ok);
+ this.programContent.Controls.Add(this.button2);
this.programContent.Dock = System.Windows.Forms.DockStyle.Fill;
this.programContent.Location = new System.Drawing.Point(0, 0);
this.programContent.Name = "programContent";
- this.programContent.Size = new System.Drawing.Size(421, 164);
+ this.programContent.Size = new System.Drawing.Size(413, 138);
this.programContent.TabIndex = 10;
this.programContent.Tag = "gnoreFormOnTaskbar";
//
+ // button1
+ //
+ this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
+ this.button1.Location = new System.Drawing.Point(150, 104);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(80, 23);
+ this.button1.TabIndex = 5;
+ this.button1.Text = "Yes";
+ this.button1.UseVisualStyleBackColor = true;
+ //
+ // button3
+ //
+ this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
+ this.button3.Location = new System.Drawing.Point(323, 104);
+ this.button3.Name = "button3";
+ this.button3.Size = new System.Drawing.Size(80, 23);
+ this.button3.TabIndex = 4;
+ this.button3.Text = "Cancel";
+ this.button3.UseVisualStyleBackColor = true;
+ this.button3.Click += new System.EventHandler(this.button3_Click);
+ //
// pictureBox1
//
this.pictureBox1.ErrorImage = null;
this.pictureBox1.Image = global::TimeHACK.Engine.Properties.Resources.Win95Warning;
this.pictureBox1.InitialImage = null;
- this.pictureBox1.Location = new System.Drawing.Point(8, 33);
+ this.pictureBox1.Location = new System.Drawing.Point(15, 16);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(32, 32);
this.pictureBox1.TabIndex = 3;
@@ -65,34 +96,33 @@
// panel1
//
this.panel1.Controls.Add(this.infoText);
- this.panel1.Location = new System.Drawing.Point(57, 33);
+ this.panel1.Location = new System.Drawing.Point(62, 16);
this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(337, 96);
+ this.panel1.Size = new System.Drawing.Size(341, 82);
this.panel1.TabIndex = 2;
//
// infoText
//
- this.infoText.AutoSize = true;
this.infoText.Dock = System.Windows.Forms.DockStyle.Fill;
this.infoText.Location = new System.Drawing.Point(0, 0);
this.infoText.Name = "infoText";
- this.infoText.Size = new System.Drawing.Size(35, 13);
+ this.infoText.Size = new System.Drawing.Size(341, 82);
this.infoText.TabIndex = 0;
this.infoText.Text = "label1";
//
- // ok
+ // button2
//
- this.ok.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
- this.ok.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
- this.ok.Location = new System.Drawing.Point(169, 135);
- this.ok.Name = "ok";
- this.ok.Size = new System.Drawing.Size(83, 23);
- this.ok.TabIndex = 1;
- this.ok.Text = "OK";
- this.ok.UseVisualStyleBackColor = true;
- this.ok.Click += new System.EventHandler(this.ok_Click);
+ this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
+ this.button2.Location = new System.Drawing.Point(236, 104);
+ this.button2.Name = "button2";
+ this.button2.Size = new System.Drawing.Size(80, 23);
+ this.button2.TabIndex = 1;
+ this.button2.Text = "No";
+ this.button2.UseVisualStyleBackColor = true;
+ this.button2.Click += new System.EventHandler(this.button2_Click);
//
// Infobox95
//
@@ -100,11 +130,10 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.programContent);
this.Name = "Infobox95";
- this.Size = new System.Drawing.Size(421, 164);
+ this.Size = new System.Drawing.Size(413, 138);
this.programContent.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.panel1.ResumeLayout(false);
- this.panel1.PerformLayout();
this.ResumeLayout(false);
}
@@ -115,6 +144,8 @@
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Panel panel1;
public System.Windows.Forms.Label infoText;
- private System.Windows.Forms.Button ok;
+ private System.Windows.Forms.Button button2;
+ private System.Windows.Forms.Button button3;
+ private System.Windows.Forms.Button button1;
}
} \ No newline at end of file
diff --git a/TimeHACK.Engine/Template/Infobox95.cs b/TimeHACK.Engine/Template/Infobox95.cs
index e764e47..ea257b2 100644
--- a/TimeHACK.Engine/Template/Infobox95.cs
+++ b/TimeHACK.Engine/Template/Infobox95.cs
@@ -1,5 +1,6 @@
using System;
using System.Drawing;
+using System.Media;
using System.Runtime.InteropServices;
using System.Windows.Forms;
@@ -7,14 +8,75 @@ namespace TimeHACK.Engine.Template
{
public partial class Infobox95 : UserControl
{
- public Infobox95()
+ int btnStatus = 0;
+
+ public Infobox95(InfoboxType type, InfoboxButtons btns)
{
InitializeComponent();
+ button1.Paint += (sender, args) => Paintbrush.PaintClassicBorders(sender, args, 2);
+ button2.Paint += (sender, args) => Paintbrush.PaintClassicBorders(sender, args, 2);
+ button3.Paint += (sender, args) => Paintbrush.PaintClassicBorders(sender, args, 2);
+
+ switch (type)
+ {
+ case InfoboxType.Info:
+ pictureBox1.Image = Properties.Resources.Win95Info;
+ SoundPlayer spa = new SoundPlayer(SaveSystem.currentTheme.asteriskSound);
+ spa.Play();
+ break;
+ case InfoboxType.Question:
+ pictureBox1.Image = Properties.Resources.Win95Question;
+ SoundPlayer spq = new SoundPlayer(SaveSystem.currentTheme.questionSound);
+ spq.Play();
+ break;
+ case InfoboxType.Warning:
+ pictureBox1.Image = Properties.Resources.Win95Warning;
+ SoundPlayer spw = new SoundPlayer(SaveSystem.currentTheme.exclamationSound);
+ spw.Play();
+ break;
+ case InfoboxType.Error:
+ pictureBox1.Image = Properties.Resources.Win95Error;
+ SoundPlayer spe = new SoundPlayer(SaveSystem.currentTheme.critStopSound);
+ spe.Play();
+ break;
+ }
+
+ btnStatus = (int)btns;
+ switch (btns)
+ {
+ case InfoboxButtons.OK:
+ button1.Hide();
+ button2.Hide();
+ button3.Text = "OK";
+ break;
+ }
}
- private void ok_Click(object sender, EventArgs e)
+ private void button2_Click(object sender, EventArgs e)
{
this.ParentForm.Close();
}
+
+ private void button3_Click(object sender, EventArgs e)
+ {
+ if (btnStatus == 0) this.ParentForm.Close();
+ }
+ }
+
+ public enum InfoboxType
+ {
+ Info,
+ Question,
+ Warning,
+ Error
+ }
+
+ public enum InfoboxButtons
+ {
+ OK,
+ OKCancel,
+ YesNo,
+ YesNoCancel,
+ AbortRetryFail
}
}