diff options
| author | william341 <[email protected]> | 2017-05-28 12:37:00 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-05-28 12:37:00 -0700 |
| commit | 771c20cfb3a703e0f1550fdcf9eb07b78298c944 (patch) | |
| tree | 59cb532e15ebff313fdba2be264d78ec0033f407 /ShiftOS.WinForms/Applications/Dialog.cs | |
| parent | 496b0cbf8659c99203f48210fd39c572400ae623 (diff) | |
| parent | c7ba7d733c756d196f98dd4533289a1ef4db715f (diff) | |
| download | shiftos_thereturn-771c20cfb3a703e0f1550fdcf9eb07b78298c944.tar.gz shiftos_thereturn-771c20cfb3a703e0f1550fdcf9eb07b78298c944.tar.bz2 shiftos_thereturn-771c20cfb3a703e0f1550fdcf9eb07b78298c944.zip | |
Merge pull request #1 from shiftos-game/master
welp, no longer a dev.
Diffstat (limited to 'ShiftOS.WinForms/Applications/Dialog.cs')
| -rw-r--r-- | ShiftOS.WinForms/Applications/Dialog.cs | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/ShiftOS.WinForms/Applications/Dialog.cs b/ShiftOS.WinForms/Applications/Dialog.cs index 26e3040..f9d0b86 100644 --- a/ShiftOS.WinForms/Applications/Dialog.cs +++ b/ShiftOS.WinForms/Applications/Dialog.cs @@ -27,10 +27,13 @@ using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; +using System.IO; using System.Linq; +using System.Media; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using Microsoft.VisualBasic.Devices; using ShiftOS.Engine; namespace ShiftOS.WinForms.Applications @@ -49,6 +52,7 @@ namespace ShiftOS.WinForms.Applications public void OnLoad() { AppearanceManager.SetWindowTitle(this, this.Title); + ShiftOS.Engine.AudioManager.PlayStream(Properties.Resources.infobox); } public void OnSkinLoad() @@ -65,10 +69,10 @@ namespace ShiftOS.WinForms.Applications { } - internal void OpenInternal(string title, string msg) + internal void OpenInternal(string title, string msg, Action c) { - AppearanceManager.SetupWindow(this); Title = title; + AppearanceManager.SetupDialog(this); lbmessage.Text = msg; txtinput.Hide(); flyesno.Hide(); @@ -76,20 +80,22 @@ namespace ShiftOS.WinForms.Applications btnok.Click += (o, a) => { AppearanceManager.Close(this); + c?.Invoke(); }; } - public void Open(string title, string msg) + public void Open(string title, string msg, Action c = null) { - new Dialog().OpenInternal(title, msg); + new Dialog().OpenInternal(title, msg, c); } - public void PromptTextInternal(string title, string message, Action<string> callback) + public void PromptTextInternal(string title, string message, Action<string> callback, bool isPassword) { - AppearanceManager.SetupWindow(this); Title = title; + AppearanceManager.SetupDialog(this); lbmessage.Text = message; + txtinput.UseSystemPasswordChar = isPassword; txtinput.Show(); flyesno.Hide(); btnok.Show(); @@ -109,9 +115,9 @@ namespace ShiftOS.WinForms.Applications }; } - public void PromptText(string title, string message, Action<string> callback) + public void PromptText(string title, string message, Action<string> callback, bool isPassword) { - new Dialog().PromptTextInternal(title, message, callback); + new Dialog().PromptTextInternal(title, message, callback, isPassword); } public void PromptYesNo(string title, string message, Action<bool> callback) @@ -123,8 +129,8 @@ namespace ShiftOS.WinForms.Applications public void PromptYesNoInternal(string title, string message, Action<bool> callback) { - AppearanceManager.SetupWindow(this); Title = title; + AppearanceManager.SetupDialog(this); lbmessage.Text = message; txtinput.Hide(); flyesno.Show(); |
