diff --git a/Bin/SunnyUI.dll b/Bin/SunnyUI.dll index 175a208f..3564a414 100644 Binary files a/Bin/SunnyUI.dll and b/Bin/SunnyUI.dll differ diff --git a/Bin/SunnyUI.pdb b/Bin/SunnyUI.pdb index 92937635..50b163e6 100644 Binary files a/Bin/SunnyUI.pdb and b/Bin/SunnyUI.pdb differ diff --git a/SunnyUI.Demo/Bin/SunnyUI.dll b/SunnyUI.Demo/Bin/SunnyUI.dll index 175a208f..3564a414 100644 Binary files a/SunnyUI.Demo/Bin/SunnyUI.dll and b/SunnyUI.Demo/Bin/SunnyUI.dll differ diff --git a/SunnyUI/Charts/UIBarChart.cs b/SunnyUI/Charts/UIBarChart.cs index 79f89c3b..8d3085e0 100644 --- a/SunnyUI/Charts/UIBarChart.cs +++ b/SunnyUI/Charts/UIBarChart.cs @@ -55,6 +55,12 @@ namespace Sunny.UI max = 0; } + if ((max - min).IsZero()) + { + max = 100; + min = 0; + } + UIChartHelper.CalcDegreeScale(min, max, o.YAxis.SplitNumber, out int start, out int end, out double interval); diff --git a/SunnyUI/Forms/UIEditForm.cs b/SunnyUI/Forms/UIEditForm.cs index 0f627b98..86172af4 100644 --- a/SunnyUI/Forms/UIEditForm.cs +++ b/SunnyUI/Forms/UIEditForm.cs @@ -36,6 +36,9 @@ namespace Sunny.UI public bool IsOK { get; private set; } + public event EventHandler ButtonOkClick; + public event EventHandler ButtonCancelClick; + protected void btnOK_Click(object sender, EventArgs e) { if (!CheckData()) @@ -43,16 +46,30 @@ namespace Sunny.UI return; } - DialogResult = DialogResult.OK; - IsOK = true; - Close(); + if (ButtonOkClick != null) + { + ButtonOkClick.Invoke(sender,e); + } + else + { + DialogResult = DialogResult.OK; + IsOK = true; + Close(); + } } private void btnCancel_Click(object sender, EventArgs e) { - DialogResult = DialogResult.Cancel; - IsOK = false; - Close(); + if (ButtonCancelClick != null) + { + ButtonCancelClick.Invoke(sender,e); + } + else + { + DialogResult = DialogResult.Cancel; + IsOK = false; + Close(); + } } protected virtual bool CheckData()