aboutsummaryrefslogtreecommitdiff
path: root/Histacom2.Engine
diff options
context:
space:
mode:
Diffstat (limited to 'Histacom2.Engine')
-rw-r--r--Histacom2.Engine/Template/WinXP.Designer.cs12
-rw-r--r--Histacom2.Engine/Template/WinXP.cs1
-rw-r--r--Histacom2.Engine/WindowManager.cs47
3 files changed, 23 insertions, 37 deletions
diff --git a/Histacom2.Engine/Template/WinXP.Designer.cs b/Histacom2.Engine/Template/WinXP.Designer.cs
index 0d1e060..a97f44b 100644
--- a/Histacom2.Engine/Template/WinXP.Designer.cs
+++ b/Histacom2.Engine/Template/WinXP.Designer.cs
@@ -90,7 +90,7 @@
// toprightcorner
//
this.toprightcorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.toprightcorner.BackColor = System.Drawing.Color.Magenta;
+ this.toprightcorner.BackColor = System.Drawing.Color.Transparent;
this.toprightcorner.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("toprightcorner.BackgroundImage")));
this.toprightcorner.Location = new System.Drawing.Point(294, 0);
this.toprightcorner.Name = "toprightcorner";
@@ -109,7 +109,7 @@
//
// topleftcorner
//
- this.topleftcorner.BackColor = System.Drawing.Color.Magenta;
+ this.topleftcorner.BackColor = System.Drawing.Color.Transparent;
this.topleftcorner.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("topleftcorner.BackgroundImage")));
this.topleftcorner.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.topleftcorner.Location = new System.Drawing.Point(0, 0);
@@ -178,11 +178,11 @@
//
this.programname.AutoSize = true;
this.programname.BackColor = System.Drawing.Color.Transparent;
- this.programname.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.programname.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.programname.ForeColor = System.Drawing.Color.White;
- this.programname.Location = new System.Drawing.Point(25, 8);
+ this.programname.Location = new System.Drawing.Point(25, 7);
this.programname.Name = "programname";
- this.programname.Size = new System.Drawing.Size(99, 13);
+ this.programname.Size = new System.Drawing.Size(112, 16);
this.programname.TabIndex = 3;
this.programname.Text = "Application Title";
this.programname.MouseDown += new System.Windows.Forms.MouseEventHandler(this.top_MouseDown);
@@ -221,11 +221,13 @@
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.BackColor = System.Drawing.Color.Magenta;
this.ClientSize = new System.Drawing.Size(300, 300);
this.Controls.Add(this.program);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "WinXP";
this.Text = "WinXP";
+ this.TransparencyKey = System.Drawing.Color.Magenta;
this.Load += new System.EventHandler(this.WinXP_Load);
this.program.ResumeLayout(false);
this.top.ResumeLayout(false);
diff --git a/Histacom2.Engine/Template/WinXP.cs b/Histacom2.Engine/Template/WinXP.cs
index fa26611..9406b87 100644
--- a/Histacom2.Engine/Template/WinXP.cs
+++ b/Histacom2.Engine/Template/WinXP.cs
@@ -17,6 +17,7 @@ namespace Histacom2.Engine.Template
public WinXP()
{
InitializeComponent();
+ SetStyle(ControlStyles.SupportsTransparentBackColor, true);
DoubleBuffered = true;
}
diff --git a/Histacom2.Engine/WindowManager.cs b/Histacom2.Engine/WindowManager.cs
index 12f7954..dec647f 100644
--- a/Histacom2.Engine/WindowManager.cs
+++ b/Histacom2.Engine/WindowManager.cs
@@ -10,38 +10,21 @@ namespace Histacom2.Engine
{
public static System.Drawing.Text.PrivateFontCollection pfc = new System.Drawing.Text.PrivateFontCollection();
+ /// <summary>
+ /// Creates and returns a WinClassic window.
+ /// </summary>
+ /// <param name="content">The UserControl to put inside the window.</param>
+ /// <param name="title">The name of the window.</param>
+ /// <param name="icon">The window's icon. If set to null, then the title moves over to compensate.</param>
+ /// <param name="MaxButton">Whether or not the maximize button is shown.</param>
+ /// <param name="MinButton">Whether or not the minimize button is shown.</param>
+ /// <param name="ShowApplicationAsDialog">Whether or not to interrupt all other processes while this window is open.</param>
+ /// <param name="resize">Whether or not this window is resizable.</param>
+ /// <returns></returns>
public WinClassic Init(UserControl content, string title, Image icon, bool MaxButton, bool MinButton, bool ShowApplicationAsDialog = false, bool resize = true)
{
- WinClassic app = null;
- // Setup Window
- switch (SaveSystem.CurrentSave.CurrentOS)
- {
- case "95":
- {
- app = new WinClassic();
- break;
- }
- case "98":
- {
- app = new WinClassic();
- break;
- }
- case "ME":
- {
- app = new WinClassic();
- break;
- }
- case "2000":
- {
- app = new WinClassic();
- break;
- }
- default:
- {
- app = new WinClassic();
- break;
- }
- }
+ WinClassic app = new WinClassic();
+
app.Text = title;
app.Title.Text = title;
app.Width = content.Width + 8;
@@ -128,8 +111,8 @@ namespace Histacom2.Engine
if (icon == null)
{
app.programIcon.Hide();
- app.programIcon.Image = Engine.Properties.Resources.nullIcon;
- app.programname.Location = new Point(2, 1);
+ app.programIcon.Image = Properties.Resources.nullIcon;
+ app.programname.Location = new Point(6, 7);
}
else app.programIcon.Image = icon;