Source/Editors/VisualButton.cs
(开头部分) 7KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
#if FRAMEWORK20
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.ComponentModel;
using System.Collections;
using DevComponents.DotNetBar;
using DevComponents.DotNetBar.Rendering;
namespace DevComponents.Editors
{
public class VisualButton : VisualButtonBase
{
#region Private Variables
#endregion
#region Events
#endregion
#region Constructor
#endregion
#region Internal Implementation
public override void PerformLayout(PaintInfo pi)
{
Size size = new Size(0, pi.AvailableSize.Height);
Graphics g = pi.Graphics;
size.Width += 6; // Border 2 pixels on each side and 1 pixels of padding between border and content
if (_Text.Length > 0)
{
Size textSize = TextDrawing.MeasureString(g, _Text, pi.DefaultFont);
size.Width += textSize.Width;
if (_Image != null)
size.Width += 4; // Padding between text and image
}
if (_Image != null)
{
size.Width += _Image.Width;
}
if (_Text.Length == 0 && _Image == null)
size.Width += 9;
this.Size = size;
base.PerformLayout(pi);
}
protected override void OnPaint(PaintInfo p)
{
Graphics g = p.Graphics;
Rectangle r = this.RenderBounds;
PaintButtonBackground(p);
Rectangle contentRect = r;
contentRect.Inflate(-3, -3); // Two pixels border + 1 pixels padding for content
后面还有 194 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。