📄 genericctrl.cs
字号:
////////////////////////////////////////////////
//
// Project: Lines.NET
// Version: 1.1
// Author: Vladimir L.
//
// homepage: http://www.boomsoft.org
// e-mail: support@boomsoft.org
//
// Copyright (c) 2003-2004, Boomsoft.org
//
using System;
using System.Drawing;
using Lines.Core;
namespace Lines.GUI
{
/// <summary>
/// Implements the set of common methods and properties for GUI components of Lines.NET.
/// </summary>
public class GenericCtrl : System.Windows.Forms.Control
{
/// <summary>
/// The reference to the <see cref="Game"/> object this component is representing on the screen.
/// </summary>
protected Game game;
/// <summary>
/// The reference to the graphics and color preferences of a game.
/// </summary>
protected Preferences preferences;
/// <summary>
/// Gets or sets the reference to the <see cref="Game"/> object this component is representing
/// on the screen.
/// </summary>
public Game Game
{
get {return game;}
set {game = value;}
}
/// <summary>
/// Gets or sets the graphics and color preferences of a game.
/// </summary>
public Preferences Preferences
{
get {return preferences;}
set {preferences = value;}
}
/// <summary>
/// Creates an instance of GenericCtrl class.
/// </summary>
/// <remarks>
/// May include a common for all GUI controls initialization logic.
/// </remarks>
public GenericCtrl()
{
}
/// <summary>
/// Draws the rectagle around component.
/// </summary>
/// <param name="e">Used to get reference to the Graphics object.</param>
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
{
/* Draw frame */
Graphics g = e.Graphics;
Rectangle box = new Rectangle(0, 0, this.Width - 1, this.Height - 1);
g.DrawRectangle(new Pen(Color.Black), box);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -