Added titlebar button hughlighting / pushing

This commit is contained in:
FloppyDiskDrive 2017-09-25 17:49:40 -05:00
parent 44d8d5c507
commit dc7533184a
8 changed files with 70 additions and 19 deletions

Binary file not shown.

View file

@ -28,10 +28,12 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container();
this.btnOpt1 = new System.Windows.Forms.Button(); this.btnOpt1 = new System.Windows.Forms.Button();
this.btnOpt2 = new System.Windows.Forms.Button(); this.btnOpt2 = new System.Windows.Forms.Button();
this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.label1 = new System.Windows.Forms.Label(); this.changeSize = new System.Windows.Forms.Timer(this.components);
this.label1 = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
@ -75,18 +77,21 @@
this.pictureBox1.TabIndex = 2; this.pictureBox1.TabIndex = 2;
this.pictureBox1.TabStop = false; this.pictureBox1.TabStop = false;
// //
// changeSize
//
this.changeSize.Interval = 1;
this.changeSize.Tick += new System.EventHandler(this.changeSize_Tick);
//
// label1 // label1
// //
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.label1.BackColor = System.Drawing.SystemColors.Window;
| System.Windows.Forms.AnchorStyles.Left) this.label1.BorderStyle = System.Windows.Forms.BorderStyle.None;
| System.Windows.Forms.AnchorStyles.Right))); this.label1.Font = new System.Drawing.Font("Lucida Console", 9F);
this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(111, 61);
this.label1.Font = new System.Drawing.Font("Lucida Console", 9.25F); this.label1.Multiline = true;
this.label1.Location = new System.Drawing.Point(106, 57);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(103, 13); this.label1.Size = new System.Drawing.Size(219, 57);
this.label1.TabIndex = 3; this.label1.TabIndex = 3;
this.label1.Text = "Generic Body";
// //
// InfoboxTemplate // InfoboxTemplate
// //
@ -110,6 +115,7 @@
public System.Windows.Forms.Button btnOpt1; public System.Windows.Forms.Button btnOpt1;
public System.Windows.Forms.Button btnOpt2; public System.Windows.Forms.Button btnOpt2;
public System.Windows.Forms.PictureBox pictureBox1; public System.Windows.Forms.PictureBox pictureBox1;
public System.Windows.Forms.Label label1; private System.Windows.Forms.Timer changeSize;
public System.Windows.Forms.TextBox label1;
} }
} }

View file

@ -20,12 +20,13 @@ namespace ShiftOS.Engine.WindowManager
public InfoboxTemplate(buttonType type) public InfoboxTemplate(buttonType type)
{ {
InitializeComponent(); InitializeComponent();
switch (type) switch (type)
{ {
case buttonType.OK: case buttonType.OK:
btnOpt1.Text = "OK"; btnOpt1.Text = "OK";
btnOpt2.Hide(); btnOpt2.Hide();
btnOpt1.Location = new Point(122, 134); btnOpt1.Location = new Point(109, 134);
buttonChoice = 1; buttonChoice = 1;
break; break;
case buttonType.OKCancel: case buttonType.OKCancel:
@ -86,5 +87,11 @@ namespace ShiftOS.Engine.WindowManager
{ {
Play(); Play();
} }
private void changeSize_Tick(object sender, EventArgs e)
{
this.Height += label1.Height;
this.Width += label1.Width;
}
} }
} }

View file

@ -117,4 +117,7 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="changeSize.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root> </root>

View file

@ -155,25 +155,29 @@
// //
this.maximizebutton.Anchor = System.Windows.Forms.AnchorStyles.Right; this.maximizebutton.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.maximizebutton.BackColor = System.Drawing.Color.Black; this.maximizebutton.BackColor = System.Drawing.Color.Black;
this.maximizebutton.Location = new System.Drawing.Point(231, 4); this.maximizebutton.Location = new System.Drawing.Point(230, 4);
this.maximizebutton.Name = "maximizebutton"; this.maximizebutton.Name = "maximizebutton";
this.maximizebutton.Size = new System.Drawing.Size(21, 21); this.maximizebutton.Size = new System.Drawing.Size(21, 21);
this.maximizebutton.TabIndex = 6; this.maximizebutton.TabIndex = 6;
this.maximizebutton.TabStop = false; this.maximizebutton.TabStop = false;
this.maximizebutton.MouseDown += new System.Windows.Forms.MouseEventHandler(this.maximizebutton_MouseDown);
this.maximizebutton.MouseEnter += new System.EventHandler(this.maximizebutton_MouseEnter); this.maximizebutton.MouseEnter += new System.EventHandler(this.maximizebutton_MouseEnter);
this.maximizebutton.MouseLeave += new System.EventHandler(this.maximizebutton_MouseLeave); this.maximizebutton.MouseLeave += new System.EventHandler(this.maximizebutton_MouseLeave);
this.maximizebutton.MouseUp += new System.Windows.Forms.MouseEventHandler(this.maximizebutton_MouseUp);
// //
// minimizebutton // minimizebutton
// //
this.minimizebutton.Anchor = System.Windows.Forms.AnchorStyles.Right; this.minimizebutton.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.minimizebutton.BackColor = System.Drawing.Color.Black; this.minimizebutton.BackColor = System.Drawing.Color.Black;
this.minimizebutton.Location = new System.Drawing.Point(208, 4); this.minimizebutton.Location = new System.Drawing.Point(207, 4);
this.minimizebutton.Name = "minimizebutton"; this.minimizebutton.Name = "minimizebutton";
this.minimizebutton.Size = new System.Drawing.Size(21, 21); this.minimizebutton.Size = new System.Drawing.Size(21, 21);
this.minimizebutton.TabIndex = 5; this.minimizebutton.TabIndex = 5;
this.minimizebutton.TabStop = false; this.minimizebutton.TabStop = false;
this.minimizebutton.MouseDown += new System.Windows.Forms.MouseEventHandler(this.minimizebutton_MouseDown);
this.minimizebutton.MouseEnter += new System.EventHandler(this.minimizebutton_MouseEnter); this.minimizebutton.MouseEnter += new System.EventHandler(this.minimizebutton_MouseEnter);
this.minimizebutton.MouseLeave += new System.EventHandler(this.minimizebutton_MouseLeave); this.minimizebutton.MouseLeave += new System.EventHandler(this.minimizebutton_MouseLeave);
this.minimizebutton.MouseUp += new System.Windows.Forms.MouseEventHandler(this.minimizebutton_MouseUp);
// //
// Title // Title
// //
@ -192,14 +196,16 @@
// //
this.closebutton.Anchor = System.Windows.Forms.AnchorStyles.Right; this.closebutton.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.closebutton.BackColor = System.Drawing.Color.Black; this.closebutton.BackColor = System.Drawing.Color.Black;
this.closebutton.Location = new System.Drawing.Point(254, 4); this.closebutton.Location = new System.Drawing.Point(253, 4);
this.closebutton.Name = "closebutton"; this.closebutton.Name = "closebutton";
this.closebutton.Size = new System.Drawing.Size(21, 21); this.closebutton.Size = new System.Drawing.Size(21, 21);
this.closebutton.TabIndex = 4; this.closebutton.TabIndex = 4;
this.closebutton.TabStop = false; this.closebutton.TabStop = false;
this.closebutton.Click += new System.EventHandler(this.closebutton_Click); this.closebutton.Click += new System.EventHandler(this.closebutton_Click);
this.closebutton.MouseDown += new System.Windows.Forms.MouseEventHandler(this.closebutton_MouseDown);
this.closebutton.MouseEnter += new System.EventHandler(this.closebutton_MouseEnter); this.closebutton.MouseEnter += new System.EventHandler(this.closebutton_MouseEnter);
this.closebutton.MouseLeave += new System.EventHandler(this.closebutton_MouseLeave); this.closebutton.MouseLeave += new System.EventHandler(this.closebutton_MouseLeave);
this.closebutton.MouseUp += new System.Windows.Forms.MouseEventHandler(this.closebutton_MouseUp);
// //
// right // right
// //

View file

@ -69,5 +69,35 @@ namespace ShiftOS.Engine.WindowManager
{ {
minimizebutton.BackColor = Color.Black; minimizebutton.BackColor = Color.Black;
} }
private void closebutton_MouseDown(object sender, MouseEventArgs e)
{
closebutton.BackColor = Color.Black;
}
private void maximizebutton_MouseDown(object sender, MouseEventArgs e)
{
maximizebutton.BackColor = Color.Black;
}
private void minimizebutton_MouseDown(object sender, MouseEventArgs e)
{
minimizebutton.BackColor = Color.Black;
}
private void minimizebutton_MouseUp(object sender, MouseEventArgs e)
{
minimizebutton.BackColor = Color.Gray;
}
private void maximizebutton_MouseUp(object sender, MouseEventArgs e)
{
maximizebutton.BackColor = Color.Gray;
}
private void closebutton_MouseUp(object sender, MouseEventArgs e)
{
closebutton.BackColor = Color.Gray;
}
} }
} }

View file

@ -32,9 +32,9 @@ namespace ShiftOS.Main.ShiftOS.Apps
colorType2 = Convert.ToInt32(textBox2.Text); colorType2 = Convert.ToInt32(textBox2.Text);
colorType3 = Convert.ToInt32(textBox3.Text); colorType3 = Convert.ToInt32(textBox3.Text);
} }
catch catch(Exception ex)
{ {
shiftWM.StartInfoboxSession("Error!", "Cannot parse a string.", InfoboxTemplate.buttonType.OK); shiftWM.StartInfoboxSession("Error!", "Failed to parse integer. Error:\n" + ex, InfoboxTemplate.buttonType.OK);
} }
if (colorType1 > 255 || colorType2 > 255 || colorType3 > 255) if (colorType1 > 255 || colorType2 > 255 || colorType3 > 255)
@ -52,7 +52,7 @@ namespace ShiftOS.Main.ShiftOS.Apps
} }
catch (Exception ex) catch (Exception ex)
{ {
shiftWM.StartInfoboxSession("Error!", "An exception occured while setting the color! Exception: \n" + ex, InfoboxTemplate.buttonType.OK); shiftWM.StartInfoboxSession("Error!", "An error occured while setting the color.", InfoboxTemplate.buttonType.OK);
} }
} }
} }

View file

@ -24,7 +24,6 @@ namespace ShiftOS.Main
private void button2_Click(object sender, EventArgs e) private void button2_Click(object sender, EventArgs e)
{ {
shiftWM.Init(new Shifter(), "Shifter", Properties.Resources.iconShifter); shiftWM.Init(new Shifter(), "Shifter", Properties.Resources.iconShifter); }
}
} }
} }