📄 statuspanel.cs
字号:
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version>$Revision: 915 $</version>
// </file>
using System;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Xml;
using ICSharpCode.Core;
namespace ICSharpCode.SharpDevelop.Gui
{
public class StatusPanel : UserControl
{
WizardDialog wizard;
Font smallFont;
Font normalFont;
Font boldFont;
public StatusPanel(WizardDialog wizard)
{
smallFont = ResourceService.LoadFont("Tahoma", 14, GraphicsUnit.World);
normalFont = ResourceService.LoadFont("Tahoma", 14, GraphicsUnit.World);
boldFont = ResourceService.LoadFont("Tahoma", 14, FontStyle.Bold, GraphicsUnit.World);
this.wizard = wizard;
this.BackgroundImage = ResourceService.GetBitmap("GeneralWizardBackground");
Size = new Size(198, 400);
ResizeRedraw = false;
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
}
protected override void OnPaint(PaintEventArgs pe)
{
// base.OnPaint(pe);
Graphics g = pe.Graphics;
g.DrawString(ResourceService.GetString("SharpDevelop.Gui.Dialogs.WizardDialog.StepsLabel"),
smallFont,
SystemBrushes.WindowText,
10,
24 - smallFont.Height);
g.DrawLine(SystemPens.WindowText, 10, 24, Width - 10, 24);
int curNumber = 0;
for (int i = 0; i < wizard.WizardPanels.Count; i = wizard.GetSuccessorNumber(i)) {
Font curFont = wizard.ActivePanelNumber == i ? boldFont : normalFont;
IDialogPanelDescriptor descriptor = ((IDialogPanelDescriptor)wizard.WizardPanels[i]);
g.DrawString((1 + curNumber) + ". " + descriptor.Label, curFont, SystemBrushes.WindowText, 10, 40 + curNumber * curFont.Height);
++curNumber;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -