2012-10-19 20:04:05 +00:00
#region Using Statements
using System ;
2012-08-26 19:03:12 +00:00
using System.ComponentModel ;
using System.Windows.Forms ;
2012-09-10 19:10:39 +00:00
using ANX.Framework.NonXNA.Development ;
2014-03-08 15:05:44 +00:00
using System.Drawing ;
2012-10-19 20:04:05 +00:00
#endregion
// This file is part of the EES Content Compiler 4,
// © 2008 - 2012 by Eagle Eye Studios.
// The EES Content Compiler 4 is released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
2012-08-26 19:03:12 +00:00
namespace ANX.ContentCompiler.GUI.Controls
{
2014-03-08 15:05:44 +00:00
//Reclaimer: on systems other than windows, mono 3.x is needed to make this class not crash on creation.
//For ubuntu, see this: http://stackoverflow.com/questions/13365158/installing-mono-3-x-3-0-x-and-or-3-2-x
2012-09-10 19:10:39 +00:00
[Developer("SilentWarrior/Eagle Eye Studios")]
[PercentageComplete(100)]
2014-03-08 15:05:44 +00:00
[TestState(TestStateAttribute.TestState.Tested)]
2012-08-26 19:03:12 +00:00
public partial class ArrowButton : UserControl
{
public ArrowButton ( )
{
InitializeComponent ( ) ;
}
2012-10-19 20:04:05 +00:00
#region Properties
2012-08-26 19:03:12 +00:00
[EditorBrowsable(EditorBrowsableState.Always)]
public String Content
{
get { return labelText . Text ; }
set { labelText . Text = value ; }
}
2012-10-19 20:04:05 +00:00
#endregion
2012-08-26 19:03:12 +00:00
2012-10-19 20:04:05 +00:00
#region Private
2012-08-27 19:09:10 +00:00
private void ArrowButtonMouseEnter ( object sender , EventArgs e )
2012-08-26 19:03:12 +00:00
{
BorderStyle = BorderStyle . FixedSingle ;
}
2012-08-27 19:09:10 +00:00
private void ArrowButtonMouseLeave ( object sender , EventArgs e )
2012-08-26 19:03:12 +00:00
{
2014-03-08 15:05:44 +00:00
//Because we trigger this on multiple contained controls and we want to act as they would be one, we have to make sure that we left our main control and
//not just the child controls. Otherwise, moving from label to pictureBox would cause the border to disappear.
//With this solution, we also don't get any flicker on ubuntu systems, it may cause some ghosting, but otherwise it works fine.
if ( ! this . ClientRectangle . Contains ( this . PointToClient ( Control . MousePosition ) ) )
{
BorderStyle = BorderStyle . None ;
}
2012-08-26 19:03:12 +00:00
}
2012-08-27 19:09:10 +00:00
private void ArrowButtonMouseDown ( object sender , MouseEventArgs e )
2012-08-26 19:03:12 +00:00
{
2012-08-27 19:09:10 +00:00
BackColor = Settings . AccentColor3 ;
2012-08-26 19:03:12 +00:00
}
2012-08-27 19:09:10 +00:00
private void ArrowButtonMouseUp ( object sender , MouseEventArgs e )
2012-08-26 19:03:12 +00:00
{
2012-08-27 19:09:10 +00:00
BackColor = Settings . MainColor ;
2012-08-26 19:03:12 +00:00
}
2012-08-27 19:09:10 +00:00
private void PictureBox1Click ( object sender , EventArgs e )
2012-08-26 19:03:12 +00:00
{
OnClick ( e ) ;
}
2012-08-27 19:09:10 +00:00
private void LabelTextClick ( object sender , EventArgs e )
2012-08-26 19:03:12 +00:00
{
OnClick ( e ) ;
}
2012-08-27 19:09:10 +00:00
private void ArrowButtonFontChanged ( object sender , EventArgs e )
{
labelText . Font = Font ;
}
private void ArrowButtonLoad ( object sender , EventArgs e )
{
BackColor = Settings . MainColor ;
ForeColor = Settings . ForeColor ;
}
2012-10-19 20:04:05 +00:00
#endregion
2012-08-26 19:03:12 +00:00
}
}