|
|
|
@ -32,12 +32,11 @@ public class CustomButton : Drawable
|
|
|
|
get { return base.Enabled; }
|
|
|
|
get { return base.Enabled; }
|
|
|
|
set
|
|
|
|
set
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (base.Enabled != value)
|
|
|
|
if (base.Enabled == value)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
base.Enabled = value;
|
|
|
|
base.Enabled = value;
|
|
|
|
if (Loaded)
|
|
|
|
if (Loaded)
|
|
|
|
Invalidate();
|
|
|
|
Invalidate();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -88,7 +87,11 @@ public class CustomButton : Drawable
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>Default constructor. Sets <see cref="Enabled"/> to true.</summary>
|
|
|
|
/// <summary>Default constructor. Sets <see cref="Enabled"/> to true.</summary>
|
|
|
|
public CustomButton() { Enabled = true; }
|
|
|
|
public CustomButton()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Enabled = true;
|
|
|
|
|
|
|
|
CanFocus = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>Event raised when this control is resized.</summary>
|
|
|
|
/// <summary>Event raised when this control is resized.</summary>
|
|
|
|
/// <param name="e"></param>
|
|
|
|
/// <param name="e"></param>
|
|
|
|
@ -106,11 +109,10 @@ public class CustomButton : Drawable
|
|
|
|
protected override void OnMouseDown(MouseEventArgs e)
|
|
|
|
protected override void OnMouseDown(MouseEventArgs e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
base.OnMouseDown(e);
|
|
|
|
base.OnMouseDown(e);
|
|
|
|
if (Enabled)
|
|
|
|
if (!Enabled)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
mouseDown = true;
|
|
|
|
mouseDown = true;
|
|
|
|
Invalidate();
|
|
|
|
Invalidate();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
@ -137,6 +139,20 @@ public class CustomButton : Drawable
|
|
|
|
Invalidate();
|
|
|
|
Invalidate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected override void OnGotFocus(EventArgs e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
hover = true;
|
|
|
|
|
|
|
|
base.OnGotFocus(e);
|
|
|
|
|
|
|
|
Invalidate();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected override void OnLostFocus(EventArgs e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
hover = false;
|
|
|
|
|
|
|
|
base.OnLostFocus(e);
|
|
|
|
|
|
|
|
Invalidate();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Event raised when the mouse is released over this control's bounding box.
|
|
|
|
/// Event raised when the mouse is released over this control's bounding box.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
|