aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs
diff options
context:
space:
mode:
authorAShifter <[email protected]>2017-11-25 08:59:48 -0700
committerAShifter <[email protected]>2017-11-25 08:59:48 -0700
commitc81573594f509177214bbc9b64427c8aabdc30a6 (patch)
tree0f16be1fffc1e1557adafbd1baa9ff7aa16a3381 /ShiftOS.Engine/WindowManager/InfoboxTemplate.cs
parent90b1bdca5f8f2bf634a0b83ed9b623843ada5661 (diff)
downloadshiftos-rewind-c81573594f509177214bbc9b64427c8aabdc30a6.tar.gz
shiftos-rewind-c81573594f509177214bbc9b64427c8aabdc30a6.tar.bz2
shiftos-rewind-c81573594f509177214bbc9b64427c8aabdc30a6.zip
Add SaveSystem, FullScreen Terminal and stuff
Git had a horrible seizure and removed our repo but Alex-TIMEHACK helped us get it back.
Diffstat (limited to 'ShiftOS.Engine/WindowManager/InfoboxTemplate.cs')
-rw-r--r--ShiftOS.Engine/WindowManager/InfoboxTemplate.cs39
1 files changed, 22 insertions, 17 deletions
diff --git a/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs b/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs
index 5d55cf2..72bb530 100644
--- a/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs
+++ b/ShiftOS.Engine/WindowManager/InfoboxTemplate.cs
@@ -23,32 +23,25 @@ namespace ShiftOS.Engine.WindowManager
Cancel,
Ok
}
-
- int _buttonChoice;
- int _buttonSelected;
Stream _str;
public InfoboxTemplate(ButtonType type)
{
InitializeComponent();
-
switch (type)
{
case ButtonType.Ok:
btnOpt1.Text = "OK";
btnOpt2.Hide();
- btnOpt1.Location = new Point(109, 134);
- _buttonChoice = 1;
+ btnOpt1.Location = new Point(156, 163);
break;
case ButtonType.OkCancel:
btnOpt1.Text = "OK";
btnOpt2.Text = "Cancel";
- _buttonChoice = 2;
break;
case ButtonType.YesNo:
btnOpt1.Text = "Yes";
btnOpt2.Text = "No";
- _buttonChoice = 3;
break;
}
}
@@ -58,11 +51,12 @@ namespace ShiftOS.Engine.WindowManager
switch (btnOpt1.Text)
{
case "OK":
- ParentForm?.Close();
+ btnOpt1.DialogResult = System.Windows.Forms.DialogResult.OK;
+ ParentForm?.Close();
break;
case "Yes":
- _buttonSelected = 2;
- ParentForm?.Close();
+ btnOpt1.DialogResult = System.Windows.Forms.DialogResult.Yes;
+ ParentForm?.Close();
break;
}
}
@@ -72,11 +66,12 @@ namespace ShiftOS.Engine.WindowManager
switch (btnOpt2.Text)
{
case "No":
- _buttonSelected = 3;
- break;
+ btnOpt2.DialogResult = System.Windows.Forms.DialogResult.No;
+ ParentForm?.Close();
+ break;
case "Cancel":
- _buttonSelected = 4;
- break;
+ btnOpt2.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ break;
}
}
@@ -89,6 +84,16 @@ namespace ShiftOS.Engine.WindowManager
}
void InfoboxTemplate_Load(object sender, EventArgs e)
- => Play();
- }
+ {
+ Play();
+ SizeAndLoad(label1.Size.Width, label1.Size.Width);
+ }
+ private Size SizeAndLoad(int x, int y)
+ {
+ this.Size = new Size(x, y);
+ Left = (Screen.PrimaryScreen.Bounds.Width - Width) / 2;
+ Top = (Screen.PrimaryScreen.Bounds.Top - Height) / 2;
+ return Size;
+ }
+ }
} \ No newline at end of file