* UIForm2: 更新
This commit is contained in:
parent
feb8182a25
commit
882dbb3f40
@ -946,22 +946,6 @@ namespace Sunny.UI
|
|||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnActivated(EventArgs e)
|
|
||||||
{
|
|
||||||
base.OnActivated(e);
|
|
||||||
IsActive = true;
|
|
||||||
Invalidate();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnDeactivate(EventArgs e)
|
|
||||||
{
|
|
||||||
base.OnDeactivate(e);
|
|
||||||
IsActive = false;
|
|
||||||
Invalidate();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected bool IsActive;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 重载绘图
|
/// 重载绘图
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
11
SunnyUI/Forms/UIForm2.Designer.cs
generated
11
SunnyUI/Forms/UIForm2.Designer.cs
generated
@ -13,6 +13,16 @@
|
|||||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
protected override void Dispose(bool disposing)
|
protected override void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
|
this.UnRegister();
|
||||||
|
|
||||||
|
if (hotKeys != null)
|
||||||
|
{
|
||||||
|
foreach (var hotKey in hotKeys.Values)
|
||||||
|
{
|
||||||
|
Win32.User.UnregisterHotKey(System.IntPtr.Zero, hotKey.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (disposing && (components != null))
|
if (disposing && (components != null))
|
||||||
{
|
{
|
||||||
components.Dispose();
|
components.Dispose();
|
||||||
@ -35,6 +45,7 @@
|
|||||||
AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
|
AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
|
||||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
ClientSize = new System.Drawing.Size(800, 450);
|
ClientSize = new System.Drawing.Size(800, 450);
|
||||||
|
Icon = Sunny.UI.Properties.Resources.SunnyUI;
|
||||||
Name = "UIForm2";
|
Name = "UIForm2";
|
||||||
Padding = new System.Windows.Forms.Padding(0, 35, 0, 0);
|
Padding = new System.Windows.Forms.Padding(0, 35, 0, 0);
|
||||||
Text = "UIForm2";
|
Text = "UIForm2";
|
||||||
|
File diff suppressed because it is too large
Load Diff
10
SunnyUI/Properties/Resources.Designer.cs
generated
10
SunnyUI/Properties/Resources.Designer.cs
generated
@ -190,6 +190,16 @@ namespace Sunny.UI.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似于 (图标) 的 System.Drawing.Icon 类型的本地化资源。
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Icon SunnyUI {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("SunnyUI", resourceCulture);
|
||||||
|
return ((System.Drawing.Icon)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -157,6 +157,9 @@
|
|||||||
<data name="notifier" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="notifier" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\notifier.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\notifier.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="SunnyUI" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\SunnyUI.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
<data name="wind" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="wind" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\wind.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\wind.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
|
BIN
SunnyUI/Resources/SunnyUI.ico
Normal file
BIN
SunnyUI/Resources/SunnyUI.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 43 KiB |
@ -35,8 +35,6 @@ namespace Sunny.UI
|
|||||||
{
|
{
|
||||||
UIStyle Style { get; set; }
|
UIStyle Style { get; set; }
|
||||||
|
|
||||||
bool StyleCustomMode { get; set; }
|
|
||||||
|
|
||||||
string Version { get; }
|
string Version { get; }
|
||||||
|
|
||||||
string TagString { get; set; }
|
string TagString { get; set; }
|
||||||
@ -483,51 +481,5 @@ namespace Sunny.UI
|
|||||||
|
|
||||||
return values;
|
return values;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetRawControlStyle(ControlEventArgs e, UIStyle style)
|
|
||||||
{
|
|
||||||
if (e.Control is TableLayoutPanel)
|
|
||||||
{
|
|
||||||
List<Control> controls = e.Control.GetUIStyleControls("IStyleInterface");
|
|
||||||
foreach (var control in controls)
|
|
||||||
{
|
|
||||||
if (control is IStyleInterface item)
|
|
||||||
{
|
|
||||||
if (!item.StyleCustomMode)
|
|
||||||
item.Style = style;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (e.Control is FlowLayoutPanel)
|
|
||||||
{
|
|
||||||
List<Control> controls = e.Control.GetUIStyleControls("IStyleInterface");
|
|
||||||
foreach (var control in controls)
|
|
||||||
{
|
|
||||||
if (control is IStyleInterface item)
|
|
||||||
{
|
|
||||||
if (!item.StyleCustomMode)
|
|
||||||
item.Style = style;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (e.Control is Panel)
|
|
||||||
{
|
|
||||||
List<Control> controls = e.Control.GetUIStyleControls("IStyleInterface");
|
|
||||||
foreach (var control in controls)
|
|
||||||
{
|
|
||||||
if (control is IStyleInterface item)
|
|
||||||
{
|
|
||||||
if (!item.StyleCustomMode)
|
|
||||||
item.Style = style;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -207,6 +207,8 @@ namespace Sunny.UI
|
|||||||
private static readonly ConcurrentDictionary<UIStyle, UIBaseStyle> Styles = new ConcurrentDictionary<UIStyle, UIBaseStyle>();
|
private static readonly ConcurrentDictionary<UIStyle, UIBaseStyle> Styles = new ConcurrentDictionary<UIStyle, UIBaseStyle>();
|
||||||
private static readonly ConcurrentDictionary<Guid, UIForm> Forms = new ConcurrentDictionary<Guid, UIForm>();
|
private static readonly ConcurrentDictionary<Guid, UIForm> Forms = new ConcurrentDictionary<Guid, UIForm>();
|
||||||
private static readonly ConcurrentDictionary<Guid, UIPage> Pages = new ConcurrentDictionary<Guid, UIPage>();
|
private static readonly ConcurrentDictionary<Guid, UIPage> Pages = new ConcurrentDictionary<Guid, UIPage>();
|
||||||
|
private static readonly ConcurrentDictionary<Guid, UIForm2> Forms2 = new ConcurrentDictionary<Guid, UIForm2>();
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 菜单颜色集合
|
/// 菜单颜色集合
|
||||||
@ -295,6 +297,21 @@ namespace Sunny.UI
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 注册窗体
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="form">窗体</param>
|
||||||
|
public static bool Register(this UIForm2 form)
|
||||||
|
{
|
||||||
|
if (!Forms2.ContainsKey(form.Guid))
|
||||||
|
{
|
||||||
|
Forms2.Upsert(form.Guid, form);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 注册页面
|
/// 注册页面
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -331,6 +348,15 @@ namespace Sunny.UI
|
|||||||
Forms.TryRemove(form.Guid, out _);
|
Forms.TryRemove(form.Guid, out _);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 反注册窗体
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="form">窗体</param>
|
||||||
|
public static void UnRegister(this UIForm2 form)
|
||||||
|
{
|
||||||
|
Forms2.TryRemove(form.Guid, out _);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 反注册页面
|
/// 反注册页面
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user