/// <summary>
 /// Reals the build button rect.
 /// </summary>
 /// <param name="buttonType">Type of the button.</param>
 /// <param name="act">delegate with button location building process(changing size if necessary).</param>
 /// <returns></returns>
 protected Rectangle RealBuildButtonRect(Button buttonType, ButtonBuilder act)
 {
   Point location;
   Size size = new Size(Convert.ToInt32(Res.Buttons[buttonType].Width * Scaling), Convert.ToInt32(Res.Buttons[buttonType].Height * Scaling));
   act(out location, ref size);
   return new Rectangle(location, size);
 }
 /// <summary>
 /// Builds the button rect(interface).
 /// </summary>
 /// <param name="buttonType">Type of the button.</param>
 /// <returns></returns>
 protected abstract Rectangle BuildButtonRect(Button buttonType);
 /// <summary>
 /// Sets the state of the render.
 /// </summary>
 /// <param name="buttonType">Type of the button.</param>
 /// <param name="state">if set to <c>true</c> [state].</param>
 internal void SetRenderState(Button buttonType, bool state)
 {
   if (!Buttons.ContainsKey(buttonType))
     throw new ArgumentException("buttonType");
   var tmp = Buttons[buttonType];
   tmp.Render = state;
   Buttons[buttonType] = tmp;
 }
 /// <summary>
 /// Gets the button position.
 /// </summary>
 /// <param name="buttonType">Type of the button.</param>
 /// <returns></returns>
 internal Point GetButtonPosition(Button buttonType)
 {
   if (!Buttons.ContainsKey(buttonType))
     throw new ArgumentException("buttonType");
   return Buttons[buttonType].Area.Location;
 }
 /// <summary>
 /// Optimization method. Checks click for one button.
 /// </summary>
 /// <param name="e">The <see cref="System.Windows.Forms.MouseEventArgs"/> instance containing the event data.</param>
 /// <param name="buttonType">Type of the button.</param>
 /// <returns></returns>
 internal bool MouseUpCheckOne(MouseEventArgs e, Button buttonType)
 {
   if (!Buttons.ContainsKey(buttonType))
     throw new ArgumentException("buttonType");
   return Buttons[buttonType].Area.Contains(e.X, e.Y);
 }