* UIMessageBox: 询问窗口的Focus按钮的绘制线换成背景色
This commit is contained in:
parent
a471882183
commit
15ba594d3f
@ -149,13 +149,6 @@ namespace Sunny.UI
|
||||
return region;
|
||||
}
|
||||
|
||||
public static Color Alpha(this Color color, int alpha)
|
||||
{
|
||||
alpha = Math.Max(0, alpha);
|
||||
alpha = Math.Min(255, alpha);
|
||||
return Color.FromArgb(alpha, color);
|
||||
}
|
||||
|
||||
private static Graphics TempGraphics;
|
||||
|
||||
/// <summary>
|
||||
|
@ -437,7 +437,7 @@ namespace Sunny.UI
|
||||
if (selected)
|
||||
color = rectSelectedColor;
|
||||
if (ShowFocusColor && Focused)
|
||||
color = rectPressColor;
|
||||
color = rectHoverColor;
|
||||
if (isReadOnly)
|
||||
color = rectReadOnlyColor;
|
||||
return Enabled ? color : rectDisableColor;
|
||||
@ -468,7 +468,7 @@ namespace Sunny.UI
|
||||
if (selected)
|
||||
color = foreSelectedColor;
|
||||
if (ShowFocusColor && Focused)
|
||||
color = forePressColor;
|
||||
color = foreHoverColor;
|
||||
if (isReadOnly)
|
||||
color = foreReadOnlyColor;
|
||||
return Enabled ? color : foreDisableColor;
|
||||
@ -489,7 +489,7 @@ namespace Sunny.UI
|
||||
if (selected)
|
||||
color = fillSelectedColor;
|
||||
if (ShowFocusColor && Focused)
|
||||
color = fillPressColor;
|
||||
color = fillHoverColor;
|
||||
if (isReadOnly)
|
||||
color = fillReadOnlyColor;
|
||||
return Enabled ? color : fillDisableColor;
|
||||
|
13
SunnyUI/Forms/UIMessageForm.Designer.cs
generated
13
SunnyUI/Forms/UIMessageForm.Designer.cs
generated
@ -37,17 +37,17 @@
|
||||
//
|
||||
this.btnCancel.BackColor = System.Drawing.Color.Transparent;
|
||||
this.btnCancel.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.btnCancel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
this.btnCancel.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.btnCancel.Location = new System.Drawing.Point(224, 220);
|
||||
this.btnCancel.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.btnCancel.MinimumSize = new System.Drawing.Size(1, 1);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
|
||||
this.btnCancel.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Top)));
|
||||
this.btnCancel.Size = new System.Drawing.Size(224, 48);
|
||||
this.btnCancel.TabIndex = 6;
|
||||
this.btnCancel.Text = "取消";
|
||||
this.btnCancel.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnCancel.TipsText = null;
|
||||
this.btnCancel.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
|
||||
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
|
||||
this.btnCancel.MouseEnter += new System.EventHandler(this.btnOK_MouseEnter);
|
||||
this.btnCancel.MouseLeave += new System.EventHandler(this.btnOK_MouseLeave);
|
||||
@ -56,17 +56,17 @@
|
||||
//
|
||||
this.btnOK.BackColor = System.Drawing.Color.Transparent;
|
||||
this.btnOK.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.btnOK.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
this.btnOK.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.btnOK.Location = new System.Drawing.Point(2, 220);
|
||||
this.btnOK.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.btnOK.MinimumSize = new System.Drawing.Size(1, 1);
|
||||
this.btnOK.Name = "btnOK";
|
||||
this.btnOK.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
|
||||
this.btnOK.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)));
|
||||
this.btnOK.Size = new System.Drawing.Size(223, 48);
|
||||
this.btnOK.TabIndex = 5;
|
||||
this.btnOK.Text = "确定";
|
||||
this.btnOK.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnOK.TipsText = null;
|
||||
this.btnOK.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
|
||||
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
|
||||
this.btnOK.MouseEnter += new System.EventHandler(this.btnOK_MouseEnter);
|
||||
this.btnOK.MouseLeave += new System.EventHandler(this.btnOK_MouseLeave);
|
||||
@ -98,6 +98,7 @@
|
||||
this.Padding = new System.Windows.Forms.Padding(1, 35, 1, 3);
|
||||
this.ShowInTaskbar = false;
|
||||
this.Text = "UIMsgBox";
|
||||
this.ZoomScaleRect = new System.Drawing.Rectangle(15, 15, 450, 270);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
@ -65,14 +65,15 @@ namespace Sunny.UI
|
||||
|
||||
if (_showCancel)
|
||||
{
|
||||
btnOK.RectSides = ToolStripStatusLabelBorderSides.Top | ToolStripStatusLabelBorderSides.Right;
|
||||
//btnOK.RectSides = ToolStripStatusLabelBorderSides.Top | ToolStripStatusLabelBorderSides.Right;
|
||||
//btnOK.RectSides = btnCancel.RectSides = ToolStripStatusLabelBorderSides.All;
|
||||
btnOK.Width = btnCancel.Width = Width / 2 - 2;
|
||||
btnCancel.Left = btnOK.Left + btnOK.Width - 1;
|
||||
btnCancel.Width = Width - btnCancel.Left - 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
btnOK.RectSides = ToolStripStatusLabelBorderSides.Top;
|
||||
//btnOK.RectSides = ToolStripStatusLabelBorderSides.Top;
|
||||
btnOK.Width = Width - 4;
|
||||
}
|
||||
|
||||
@ -131,12 +132,12 @@ namespace Sunny.UI
|
||||
|
||||
private void btnOK_MouseEnter(object sender, EventArgs e)
|
||||
{
|
||||
((UIButton)sender).RadiusSides = UICornerRadiusSides.All;
|
||||
//((UIButton)sender).RadiusSides = UICornerRadiusSides.All;
|
||||
}
|
||||
|
||||
private void btnOK_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
((UIButton)sender).RadiusSides = UICornerRadiusSides.None;
|
||||
//((UIButton)sender).RadiusSides = UICornerRadiusSides.None;
|
||||
}
|
||||
|
||||
public void ShowMessage(string message, string title, bool showCancel, UIStyle style = UIStyle.Blue)
|
||||
@ -145,7 +146,8 @@ namespace Sunny.UI
|
||||
Text = title;
|
||||
lbMsg.Text = message;
|
||||
ShowCancel = showCancel;
|
||||
btnOK.ShowFocusLine = btnCancel.ShowFocusLine = showCancel;
|
||||
//btnOK.ShowFocusLine = btnCancel.ShowFocusLine = showCancel;
|
||||
btnOK.ShowFocusColor = btnCancel.ShowFocusColor = showCancel;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,64 @@
|
||||
<root>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
|
Loading…
x
Reference in New Issue
Block a user