using System;
using System.Drawing;
namespace OpenDiablo2.Common.Interfaces
{
///
/// A callback that is executed the button is activated (clicked).
///
public delegate void OnActivateDelegate();
///
/// A callback that is executed if the button is toggled.
///
/// When enabled, this is true, otherwise false
public delegate void OnToggleDelegate(bool isToggled);
///
/// Represents a visual button on the screen.
///
public interface IButton : IDisposable
{
///
/// Assigning a function to this property will cause that function to be called
/// when a button is pressed.
///
OnActivateDelegate OnActivate { get; set; }
///
/// If false, the button is visually darkened, and will ignore all user input.
///
bool Enabled { get; set; }
///
/// The position of the button on the screen.
///
Point Location { get; set; }
///
/// Assigning a function to this property will cause that function to be called
/// when the button is toggled on or off.
///
OnToggleDelegate OnToggle { get; set; }
string Text { get; set; }
///
/// Allows the button to update its internal state.
/// Call this in the Update method of your scene.
///
void Update();
///
/// Renders the button to the screen.
/// Call this in the render method of your scene.
///
void Render();
}
}