Window Resizing.
This commit is contained in:
parent
9916fafefc
commit
7293e2f07f
4 changed files with 84 additions and 2 deletions
|
@ -14,7 +14,13 @@
|
|||
Dependencies: "screensavers;shifter",
|
||||
Category: "Customization"
|
||||
},
|
||||
|
||||
{
|
||||
Name: "Resizable Windows",
|
||||
Cost: 250,
|
||||
Dependencies: "draggable_windows",
|
||||
Description: "We can drag windows around, which is nice, but what if you want to give a window more working space? This upgrade allows you to resize windows.",
|
||||
Category: "Enhancements"
|
||||
},
|
||||
|
||||
// CALCULATOR UPGRADES
|
||||
{
|
||||
|
|
|
@ -10,11 +10,12 @@ namespace ShiftOS.WinForms
|
|||
[Namespace("test")]
|
||||
public static class TestCommandsForUpgrades
|
||||
{
|
||||
[ShiftoriumUpgrade("Test Command", 50, "This is a simple test command", null, "Test")]
|
||||
[Command("simpletest")]
|
||||
public static bool Simple()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
15
ShiftOS.WinForms/WindowBorder.Designer.cs
generated
15
ShiftOS.WinForms/WindowBorder.Designer.cs
generated
|
@ -173,6 +173,9 @@ namespace ShiftOS.WinForms
|
|||
this.pnlbottom.Name = "pnlbottom";
|
||||
this.pnlbottom.Size = new System.Drawing.Size(730, 2);
|
||||
this.pnlbottom.TabIndex = 1;
|
||||
this.pnlbottom.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pnlright_MouseDown);
|
||||
this.pnlbottom.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pnlbottom_MouseMove);
|
||||
this.pnlbottom.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pnlright_MouseUp);
|
||||
//
|
||||
// pnlbottomr
|
||||
//
|
||||
|
@ -181,6 +184,9 @@ namespace ShiftOS.WinForms
|
|||
this.pnlbottomr.Name = "pnlbottomr";
|
||||
this.pnlbottomr.Size = new System.Drawing.Size(2, 2);
|
||||
this.pnlbottomr.TabIndex = 3;
|
||||
this.pnlbottomr.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pnlright_MouseDown);
|
||||
this.pnlbottomr.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pnlbottomr_MouseMove);
|
||||
this.pnlbottomr.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pnlright_MouseUp);
|
||||
//
|
||||
// pnlbottoml
|
||||
//
|
||||
|
@ -189,6 +195,9 @@ namespace ShiftOS.WinForms
|
|||
this.pnlbottoml.Name = "pnlbottoml";
|
||||
this.pnlbottoml.Size = new System.Drawing.Size(2, 2);
|
||||
this.pnlbottoml.TabIndex = 2;
|
||||
this.pnlbottoml.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pnlright_MouseDown);
|
||||
this.pnlbottoml.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pnlbottoml_MouseMove);
|
||||
this.pnlbottoml.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pnlright_MouseUp);
|
||||
//
|
||||
// pnlleft
|
||||
//
|
||||
|
@ -198,6 +207,9 @@ namespace ShiftOS.WinForms
|
|||
this.pnlleft.Name = "pnlleft";
|
||||
this.pnlleft.Size = new System.Drawing.Size(2, 461);
|
||||
this.pnlleft.TabIndex = 2;
|
||||
this.pnlleft.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pnlright_MouseDown);
|
||||
this.pnlleft.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pnlleft_MouseMove);
|
||||
this.pnlleft.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pnlright_MouseUp);
|
||||
//
|
||||
// pnlright
|
||||
//
|
||||
|
@ -207,6 +219,9 @@ namespace ShiftOS.WinForms
|
|||
this.pnlright.Name = "pnlright";
|
||||
this.pnlright.Size = new System.Drawing.Size(2, 461);
|
||||
this.pnlright.TabIndex = 3;
|
||||
this.pnlright.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pnlright_MouseDown);
|
||||
this.pnlright.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pnlright_MouseMove);
|
||||
this.pnlright.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pnlright_MouseUp);
|
||||
//
|
||||
// pnlcontents
|
||||
//
|
||||
|
|
|
@ -293,9 +293,11 @@ namespace ShiftOS.WinForms
|
|||
pnlbottomr.BackColor = LoadedSkin.BorderBottomRightBackground;
|
||||
pnlbottomr.BackgroundImage = GetImage("bottomrborder");
|
||||
pnlbottomr.BackgroundImageLayout = GetImageLayout("bottomrborder");
|
||||
pnlbottomr.Width = pnlright.Width;
|
||||
pnlbottoml.BackColor = LoadedSkin.BorderBottomLeftBackground;
|
||||
pnlbottoml.BackgroundImage = GetImage("bottomlborder");
|
||||
pnlbottoml.BackgroundImageLayout = GetImageLayout("bottomlborder");
|
||||
pnlbottoml.Width = pnlleft.Width;
|
||||
|
||||
lbtitletext.ForeColor = LoadedSkin.TitleTextColor;
|
||||
lbtitletext.Font = LoadedSkin.TitleFont;
|
||||
|
@ -496,5 +498,63 @@ namespace ShiftOS.WinForms
|
|||
private void lbtitletext_MouseMove(object sender, MouseEventArgs e) {
|
||||
pnltitle_MouseMove(sender, e);
|
||||
}
|
||||
|
||||
bool resizing = false;
|
||||
|
||||
private void pnlright_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (Shiftorium.UpgradeInstalled("resizable_windows"))
|
||||
resizing = true;
|
||||
}
|
||||
|
||||
private void pnlright_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
if(resizing == true)
|
||||
{
|
||||
this.Width += e.X;
|
||||
}
|
||||
}
|
||||
|
||||
private void pnlright_MouseUp(object sender, MouseEventArgs e)
|
||||
{
|
||||
resizing = false;
|
||||
}
|
||||
|
||||
private void pnlleft_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
if(resizing == true)
|
||||
{
|
||||
this.Left += e.X;
|
||||
this.Width -= e.X;
|
||||
}
|
||||
}
|
||||
|
||||
private void pnlbottom_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
if(resizing == true)
|
||||
{
|
||||
this.Height += e.Y;
|
||||
}
|
||||
}
|
||||
|
||||
private void pnlbottomr_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
if(resizing == true)
|
||||
{
|
||||
this.Width += e.X;
|
||||
this.Height += e.Y;
|
||||
}
|
||||
}
|
||||
|
||||
private void pnlbottoml_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (resizing == true)
|
||||
{
|
||||
this.Width -= e.X;
|
||||
this.Height += e.Y;
|
||||
this.Left += e.X;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue