diff --git a/SunnyUI/Forms/UIFormHelper.cs b/SunnyUI/Forms/UIFormHelper.cs
index ec2804c5..798674c1 100644
--- a/SunnyUI/Forms/UIFormHelper.cs
+++ b/SunnyUI/Forms/UIFormHelper.cs
@@ -22,6 +22,7 @@
* 2021-06-27: V3.0.4 增加一个反馈的接口,Feedback,Page可将对象反馈给Frame
* 2021-12-13: V3.0.9 增加全屏遮罩,Form的ShowDialogWithMask()扩展方法
* 2022-07-17: V3.2.1 解决ShowNotifier打开多个,全部关闭时出错的问题
+ * 2023-07-27: V3.4.1 默认提示弹窗TopMost为true
******************************************************************************/
using System;
@@ -197,7 +198,7 @@ namespace Sunny.UI
public static bool ShowMessageDialog(this Form form, string message, string title, bool isShowCancel, UIStyle style)
{
UIMessageForm frm = new UIMessageForm();
- frm.TopMost = form != null && form.TopMost;
+ frm.TopMost = true;
frm.ShowMessage(message, title, isShowCancel, style);
frm.ShowDialog();
bool isOk = frm.IsOK;
@@ -215,7 +216,7 @@ namespace Sunny.UI
/// 显示遮罩层
/// 置顶
/// 结果
- public static bool ShowMessageDialog(string message, string title, bool showCancelButton, UIStyle style, bool showMask = true, bool topMost = false)
+ public static bool ShowMessageDialog(string message, string title, bool showCancelButton, UIStyle style, bool showMask = true, bool topMost = true)
{
Point pt = SystemEx.GetCursorPos();
Rectangle screen = Screen.GetBounds(pt);
@@ -238,37 +239,37 @@ namespace Sunny.UI
public static class UIMessageBox
{
- public static void Show(string text, bool showMask = true, bool topMost = false)
+ public static void Show(string text, bool showMask = true, bool topMost = true)
{
Show(text, UILocalize.InfoTitle, UIStyle.Blue, UIMessageBoxButtons.OK, showMask, topMost);
}
- public static void ShowInfo(string text, bool showMask = true, bool topMost = false)
+ public static void ShowInfo(string text, bool showMask = true, bool topMost = true)
{
Show(text, UILocalize.InfoTitle, UIStyle.Gray, UIMessageBoxButtons.OK, showMask, topMost);
}
- public static void ShowSuccess(string text, bool showMask = true, bool topMost = false)
+ public static void ShowSuccess(string text, bool showMask = true, bool topMost = true)
{
Show(text, UILocalize.SuccessTitle, UIStyle.Green, UIMessageBoxButtons.OK, showMask, topMost);
}
- public static void ShowWarning(string text, bool showMask = true, bool topMost = false)
+ public static void ShowWarning(string text, bool showMask = true, bool topMost = true)
{
Show(text, UILocalize.WarningTitle, UIStyle.Orange, UIMessageBoxButtons.OK, showMask, topMost);
}
- public static void ShowError(string text, bool showMask = true, bool topMost = false)
+ public static void ShowError(string text, bool showMask = true, bool topMost = true)
{
Show(text, UILocalize.ErrorTitle, UIStyle.Red, UIMessageBoxButtons.OK, showMask, topMost);
}
- public static bool ShowAsk(string text, bool showMask = true, bool topMost = false)
+ public static bool ShowAsk(string text, bool showMask = true, bool topMost = true)
{
return Show(text, UILocalize.AskTitle, UIStyle.Blue, UIMessageBoxButtons.OKCancel, showMask, topMost);
}
- public static bool Show(string text, string caption, UIStyle style = UIStyle.Blue, UIMessageBoxButtons buttons = UIMessageBoxButtons.OK, bool showMask = true, bool topMost = false)
+ public static bool Show(string text, string caption, UIStyle style = UIStyle.Blue, UIMessageBoxButtons buttons = UIMessageBoxButtons.OK, bool showMask = true, bool topMost = true)
{
return UIMessageDialog.ShowMessageDialog(text, caption, buttons == UIMessageBoxButtons.OKCancel, style, showMask, topMost);
}
@@ -289,8 +290,7 @@ namespace Sunny.UI
public static class UIInputDialog
{
- public static bool InputStringDialog(ref string value, bool checkEmpty = true,
- string desc = "请输入字符串:", UIStyle style = UIStyle.Blue, bool topMost = false, bool showMask = false)
+ public static bool InputStringDialog(ref string value, bool checkEmpty = true, string desc = "请输入字符串:", UIStyle style = UIStyle.Blue, bool topMost = true, bool showMask = false)
{
UIInputForm frm = new UIInputForm();
frm.TopMost = topMost;
@@ -312,26 +312,22 @@ namespace Sunny.UI
return false;
}
- public static bool InputStringDialog(this UIForm form, ref string value, bool checkEmpty = true,
- string desc = "请输入字符串:", bool showMask = false)
+ public static bool InputStringDialog(this UIForm form, ref string value, bool checkEmpty = true, string desc = "请输入字符串:", bool showMask = false)
{
- return InputStringDialog(ref value, checkEmpty, desc, form != null ? form.Style : UIStyle.Blue, form != null && form.TopMost, showMask);
+ return InputStringDialog(ref value, checkEmpty, desc, form != null ? form.Style : UIStyle.Blue, true, showMask);
}
- public static bool InputStringDialog(this UIPage form, ref string value, bool checkEmpty = true,
- string desc = "请输入字符串:", bool showMask = false)
+ public static bool InputStringDialog(this UIPage form, ref string value, bool checkEmpty = true, string desc = "请输入字符串:", bool showMask = false)
{
- return InputStringDialog(ref value, checkEmpty, desc, form != null ? form.Style : UIStyle.Blue, form != null && form.TopMost, showMask);
+ return InputStringDialog(ref value, checkEmpty, desc, form != null ? form.Style : UIStyle.Blue, true, showMask);
}
- public static bool InputStringDialog(this Form form, ref string value, bool checkEmpty = true,
- string desc = "请输入字符串:", UIStyle style = UIStyle.Blue, bool showMask = false)
+ public static bool InputStringDialog(this Form form, ref string value, bool checkEmpty = true, string desc = "请输入字符串:", UIStyle style = UIStyle.Blue, bool showMask = false)
{
- return InputStringDialog(ref value, checkEmpty, desc, style, form != null && form.TopMost, showMask);
+ return InputStringDialog(ref value, checkEmpty, desc, style, true, showMask);
}
- public static bool InputPasswordDialog(ref string value, bool checkEmpty = true,
- string desc = "请输入密码:", UIStyle style = UIStyle.Blue, bool topMost = false, bool showMask = false)
+ public static bool InputPasswordDialog(ref string value, bool checkEmpty = true, string desc = "请输入密码:", UIStyle style = UIStyle.Blue, bool topMost = true, bool showMask = false)
{
UIInputForm frm = new UIInputForm();
frm.TopMost = topMost;
@@ -353,26 +349,22 @@ namespace Sunny.UI
return false;
}
- public static bool InputPasswordDialog(this UIForm form, ref string value, bool checkEmpty = true,
- string desc = "请输入密码:", bool showMask = false)
+ public static bool InputPasswordDialog(this UIForm form, ref string value, bool checkEmpty = true, string desc = "请输入密码:", bool showMask = false)
{
- return InputPasswordDialog(ref value, checkEmpty, desc, form != null ? form.Style : UIStyle.Blue, form != null && form.TopMost, showMask);
+ return InputPasswordDialog(ref value, checkEmpty, desc, form != null ? form.Style : UIStyle.Blue, true, showMask);
}
- public static bool InputPasswordDialog(this UIPage form, ref string value, bool checkEmpty = true,
- string desc = "请输入密码:", bool showMask = false)
+ public static bool InputPasswordDialog(this UIPage form, ref string value, bool checkEmpty = true, string desc = "请输入密码:", bool showMask = false)
{
- return InputPasswordDialog(ref value, checkEmpty, desc, form != null ? form.Style : UIStyle.Blue, form != null && form.TopMost, showMask);
+ return InputPasswordDialog(ref value, checkEmpty, desc, form != null ? form.Style : UIStyle.Blue, true, showMask);
}
- public static bool InputPasswordDialog(this Form form, ref string value, bool checkEmpty = true,
- string desc = "请输入密码:", UIStyle style = UIStyle.Blue, bool showMask = false)
+ public static bool InputPasswordDialog(this Form form, ref string value, bool checkEmpty = true, string desc = "请输入密码:", UIStyle style = UIStyle.Blue, bool showMask = false)
{
- return InputPasswordDialog(ref value, checkEmpty, desc, style, form != null && form.TopMost, showMask);
+ return InputPasswordDialog(ref value, checkEmpty, desc, style, true, showMask);
}
- public static bool InputIntegerDialog(ref int value, bool checkEmpty = true,
- string desc = "请输入数字:", UIStyle style = UIStyle.Blue, bool topMost = false, bool showMask = false)
+ public static bool InputIntegerDialog(ref int value, bool checkEmpty = true, string desc = "请输入数字:", UIStyle style = UIStyle.Blue, bool topMost = true, bool showMask = false)
{
UIInputForm frm = new UIInputForm();
frm.TopMost = topMost;
@@ -395,8 +387,7 @@ namespace Sunny.UI
return false;
}
- public static bool InputIntegerDialog(ref int value, int minimum, int maximum, bool checkEmpty = true,
- string desc = "请输入数字:", UIStyle style = UIStyle.Blue, bool topMost = false, bool showMask = false)
+ public static bool InputIntegerDialog(ref int value, int minimum, int maximum, bool checkEmpty = true, string desc = "请输入数字:", UIStyle style = UIStyle.Blue, bool topMost = true, bool showMask = false)
{
UIInputForm frm = new UIInputForm();
frm.TopMost = topMost;
@@ -422,44 +413,37 @@ namespace Sunny.UI
return false;
}
- public static bool InputIntegerDialog(this UIForm form, ref int value, bool checkEmpty = true,
- string desc = "请输入数字:", bool showMask = false)
+ public static bool InputIntegerDialog(this UIForm form, ref int value, bool checkEmpty = true, string desc = "请输入数字:", bool showMask = false)
{
- return InputIntegerDialog(ref value, checkEmpty, desc, form != null ? form.Style : UIStyle.Blue, form != null && form.TopMost, showMask);
+ return InputIntegerDialog(ref value, checkEmpty, desc, form != null ? form.Style : UIStyle.Blue, true, showMask);
}
- public static bool InputIntegerDialog(this UIPage form, ref int value, bool checkEmpty = true,
- string desc = "请输入数字:", bool showMask = false)
+ public static bool InputIntegerDialog(this UIPage form, ref int value, bool checkEmpty = true, string desc = "请输入数字:", bool showMask = false)
{
- return InputIntegerDialog(ref value, checkEmpty, desc, form != null ? form.Style : UIStyle.Blue, form != null && form.TopMost, showMask);
+ return InputIntegerDialog(ref value, checkEmpty, desc, form != null ? form.Style : UIStyle.Blue, true, showMask);
}
- public static bool InputIntegerDialog(this Form form, ref int value, bool checkEmpty = true,
- string desc = "请输入数字:", UIStyle style = UIStyle.Blue, bool showMask = false)
+ public static bool InputIntegerDialog(this Form form, ref int value, bool checkEmpty = true, string desc = "请输入数字:", UIStyle style = UIStyle.Blue, bool showMask = false)
{
- return InputIntegerDialog(ref value, checkEmpty, desc, style, form != null && form.TopMost, showMask);
+ return InputIntegerDialog(ref value, checkEmpty, desc, style, true, showMask);
}
- public static bool InputIntegerDialog(this UIForm form, ref int value, int minimum, int maximum, bool checkEmpty = true,
- string desc = "请输入数字:", bool showMask = false)
+ public static bool InputIntegerDialog(this UIForm form, ref int value, int minimum, int maximum, bool checkEmpty = true, string desc = "请输入数字:", bool showMask = false)
{
- return InputIntegerDialog(ref value, minimum, maximum, checkEmpty, desc, form != null ? form.Style : UIStyle.Blue, form != null && form.TopMost, showMask);
+ return InputIntegerDialog(ref value, minimum, maximum, checkEmpty, desc, form != null ? form.Style : UIStyle.Blue, true, showMask);
}
- public static bool InputIntegerDialog(this UIPage form, ref int value, int minimum, int maximum, bool checkEmpty = true,
- string desc = "请输入数字:", bool showMask = false)
+ public static bool InputIntegerDialog(this UIPage form, ref int value, int minimum, int maximum, bool checkEmpty = true, string desc = "请输入数字:", bool showMask = false)
{
- return InputIntegerDialog(ref value, minimum, maximum, checkEmpty, desc, form != null ? form.Style : UIStyle.Blue, form != null && form.TopMost, showMask);
+ return InputIntegerDialog(ref value, minimum, maximum, checkEmpty, desc, form != null ? form.Style : UIStyle.Blue, true, showMask);
}
- public static bool InputIntegerDialog(this Form form, ref int value, int minimum, int maximum, bool checkEmpty = true,
- string desc = "请输入数字:", UIStyle style = UIStyle.Blue, bool showMask = false)
+ public static bool InputIntegerDialog(this Form form, ref int value, int minimum, int maximum, bool checkEmpty = true, string desc = "请输入数字:", UIStyle style = UIStyle.Blue, bool showMask = false)
{
- return InputIntegerDialog(ref value, minimum, maximum, checkEmpty, desc, style, form != null && form.TopMost, showMask);
+ return InputIntegerDialog(ref value, minimum, maximum, checkEmpty, desc, style, true, showMask);
}
- public static bool InputDoubleDialog(ref double value, int decimals = 2, bool checkEmpty = true,
- string desc = "请输入数字:", UIStyle style = UIStyle.Blue, bool topMost = false, bool showMask = false)
+ public static bool InputDoubleDialog(ref double value, int decimals = 2, bool checkEmpty = true, string desc = "请输入数字:", UIStyle style = UIStyle.Blue, bool topMost = true, bool showMask = false)
{
UIInputForm frm = new UIInputForm();
frm.TopMost = topMost;
@@ -483,8 +467,7 @@ namespace Sunny.UI
return false;
}
- public static bool InputDoubleDialog(ref double value, double minimum, double maximum, int decimals = 2, bool checkEmpty = true,
- string desc = "请输入数字:", UIStyle style = UIStyle.Blue, bool topMost = false, bool showMask = false)
+ public static bool InputDoubleDialog(ref double value, double minimum, double maximum, int decimals = 2, bool checkEmpty = true, string desc = "请输入数字:", UIStyle style = UIStyle.Blue, bool topMost = true, bool showMask = false)
{
UIInputForm frm = new UIInputForm();
frm.TopMost = topMost;
@@ -510,46 +493,40 @@ namespace Sunny.UI
return false;
}
- public static bool InputDoubleDialog(this UIForm form, ref double value, int decimals = 2, bool checkEmpty = true,
- string desc = "请输入数字:", bool showMask = false)
+ public static bool InputDoubleDialog(this UIForm form, ref double value, int decimals = 2, bool checkEmpty = true, string desc = "请输入数字:", bool showMask = false)
{
- return InputDoubleDialog(ref value, decimals, checkEmpty, desc, form != null ? form.Style : UIStyle.Blue, form != null && form.TopMost, showMask);
+ return InputDoubleDialog(ref value, decimals, checkEmpty, desc, form != null ? form.Style : UIStyle.Blue, true, showMask);
}
- public static bool InputDoubleDialog(this UIPage form, ref double value, int decimals = 2, bool checkEmpty = true,
- string desc = "请输入数字:", bool showMask = false)
+ public static bool InputDoubleDialog(this UIPage form, ref double value, int decimals = 2, bool checkEmpty = true, string desc = "请输入数字:", bool showMask = false)
{
- return InputDoubleDialog(ref value, decimals, checkEmpty, desc, form != null ? form.Style : UIStyle.Blue, form != null && form.TopMost, showMask);
+ return InputDoubleDialog(ref value, decimals, checkEmpty, desc, form != null ? form.Style : UIStyle.Blue, true, showMask);
}
- public static bool InputDoubleDialog(this Form form, ref double value, int decimals = 2, bool checkEmpty = true,
- string desc = "请输入数字:", UIStyle style = UIStyle.Blue, bool showMask = false)
+ public static bool InputDoubleDialog(this Form form, ref double value, int decimals = 2, bool checkEmpty = true, string desc = "请输入数字:", UIStyle style = UIStyle.Blue, bool showMask = false)
{
- return InputDoubleDialog(ref value, decimals, checkEmpty, desc, style, form != null && form.TopMost, showMask);
+ return InputDoubleDialog(ref value, decimals, checkEmpty, desc, style, true, showMask);
}
- public static bool InputDoubleDialog(this UIForm form, ref double value, double minimum, double maximum, int decimals = 2, bool checkEmpty = true,
- string desc = "请输入数字:", bool showMask = false)
+ public static bool InputDoubleDialog(this UIForm form, ref double value, double minimum, double maximum, int decimals = 2, bool checkEmpty = true, string desc = "请输入数字:", bool showMask = false)
{
- return InputDoubleDialog(ref value, minimum, maximum, decimals, checkEmpty, desc, form != null ? form.Style : UIStyle.Blue, form != null && form.TopMost, showMask);
+ return InputDoubleDialog(ref value, minimum, maximum, decimals, checkEmpty, desc, form != null ? form.Style : UIStyle.Blue, true, showMask);
}
- public static bool InputDoubleDialog(this UIPage form, ref double value, double minimum, double maximum, int decimals = 2, bool checkEmpty = true,
- string desc = "请输入数字:", bool showMask = false)
+ public static bool InputDoubleDialog(this UIPage form, ref double value, double minimum, double maximum, int decimals = 2, bool checkEmpty = true, string desc = "请输入数字:", bool showMask = false)
{
- return InputDoubleDialog(ref value, minimum, maximum, decimals, checkEmpty, desc, form != null ? form.Style : UIStyle.Blue, form != null && form.TopMost, showMask);
+ return InputDoubleDialog(ref value, minimum, maximum, decimals, checkEmpty, desc, form != null ? form.Style : UIStyle.Blue, true, showMask);
}
- public static bool InputDoubleDialog(this Form form, ref double value, double minimum, double maximum, int decimals = 2, bool checkEmpty = true,
- string desc = "请输入数字:", UIStyle style = UIStyle.Blue, bool showMask = false)
+ public static bool InputDoubleDialog(this Form form, ref double value, double minimum, double maximum, int decimals = 2, bool checkEmpty = true, string desc = "请输入数字:", UIStyle style = UIStyle.Blue, bool showMask = false)
{
- return InputDoubleDialog(ref value, minimum, maximum, decimals, checkEmpty, desc, style, form != null && form.TopMost, showMask);
+ return InputDoubleDialog(ref value, minimum, maximum, decimals, checkEmpty, desc, style, true, showMask);
}
}
public static class UISelectDialog
{
- public static bool ShowSelectDialog(this Form form, ref int selectIndex, IList items, string title, string description, UIStyle style = UIStyle.Blue, bool topMost = false)
+ public static bool ShowSelectDialog(this Form form, ref int selectIndex, IList items, string title, string description, UIStyle style = UIStyle.Blue, bool topMost = true)
{
UISelectForm frm = new UISelectForm();
frm.TopMost = topMost;
@@ -572,7 +549,7 @@ namespace Sunny.UI
public static bool ShowSelectDialog(this Form form, ref int selectIndex, IList items, UIStyle style = UIStyle.Blue)
{
- return form.ShowSelectDialog(ref selectIndex, items, UILocalize.SelectTitle, "", style, form != null && form.TopMost);
+ return form.ShowSelectDialog(ref selectIndex, items, UILocalize.SelectTitle, "", style, true);
}
public static bool ShowSelectDialog(this UIForm form, ref int selectIndex, IList items)
@@ -587,12 +564,12 @@ namespace Sunny.UI
public static bool ShowSelectDialog(this UIForm form, ref int selectIndex, IList items, string title, string description)
{
- return form.ShowSelectDialog(ref selectIndex, items, title, description, form != null ? form.Style : UIStyle.Blue, form != null && form.TopMost);
+ return form.ShowSelectDialog(ref selectIndex, items, title, description, form != null ? form.Style : UIStyle.Blue, true);
}
public static bool ShowSelectDialog(this UIPage form, ref int selectIndex, IList items, string title, string description)
{
- return form.ShowSelectDialog(ref selectIndex, items, title, description, form != null ? form.Style : UIStyle.Blue, form != null && form.TopMost);
+ return form.ShowSelectDialog(ref selectIndex, items, title, description, form != null ? form.Style : UIStyle.Blue, true);
}
}