public GridControl()
{
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
SetStyle(ControlStyles.ResizeRedraw, true);
SetStyle(ControlStyles.UserPaint, true);
BackColor = Color.White;
ToolShape = ToolShape.Point;
ToolSize = 40;
m_cellHeight = 16.0f;
m_cellWidth = 16.0f;
m_translateX = 0.0f;
m_translateY = 0.0f;
m_scale = 1.0f;
m_rotateAngle = 0.0f;
m_translateStep = 10.0f;
m_scaleStep = 1.1f;
m_rotateStep = 15.0f;
m_scaleMin = (float)System.Math.Pow(m_scaleStep, -15.0f);
m_scaleMax = (float)System.Math.Pow(m_scaleStep, 15.0f);
m_mouseLocation = new Point(0, 0);
m_highlightedCellLocation = new Point(0, 0);
m_selectedCellLocation = new Point(0, 0);
m_selectedCellBrush = new SolidBrush(Color.FromArgb(192, Color.Blue));
m_highlightedCellBrush = new SolidBrush(Color.FromArgb(128, Color.SkyBlue));
m_gridPen = new Pen(Color.LightGray, 1);
m_viewport = new Rectangle(0, 0, (int)(ClientRectangle.Right / m_cellWidth) + 1, (int)(ClientRectangle.Bottom / m_cellHeight) + 1);
m_debug = new SortedDictionary<string, object>();
m_debugFont = new Font(FontFamily.GenericMonospace, 9);
m_debugBackgroundBrush = new SolidBrush(Color.FromArgb(192, Color.White));
m_debugForegroundBrush = new SolidBrush(Color.FromArgb(192, Color.Black));
m_originBrush = new SolidBrush(Color.FromArgb(128, Color.Orange));
}