private void HSLPicker_MouseMove( object sender, System.Windows.Forms.MouseEventArgs e )
{
Cursor cursor = Cursors.Default;
if ( trackMode != 0 )
{
cursor = Cursors.Hand;
int dy = e.Y - ptCenter.Y;
int dx = e.X - ptCenter.X;
if ( trackMode == 1 )
{
// MIN pointer tracking
min = (int) ( Math.Atan2( -dy, dx ) * 180 / Math.PI );
if ( min < 0 )
{
min = 360 + min;
}
}
else
{
// MAX pointer tracking
max = (int) ( Math.Atan2( -dy, dx ) * 180 / Math.PI );
if ( max < 0 )
{
max = 360 + max;
}
}
// repaint control
Invalidate( );
}
else
{
// check coordinates of MIN pointer
if ( ( e.X >= ptMin.X - 4 ) && ( e.Y >= ptMin.Y - 4 ) &&
( e.X < ptMin.X + 4 ) && ( e.Y < ptMin.Y + 4 ) )
{
cursor = Cursors.Hand;
}
if ( type == HuePickerType.Range )
{
// check coordinates of MAX pointer
if ( ( e.X >= ptMax.X - 4 ) && ( e.Y >= ptMax.Y - 4 ) &&
( e.X < ptMax.X + 4 ) && ( e.Y < ptMax.Y + 4 ) )
{
cursor = Cursors.Hand;
}
}
}
this.Cursor = cursor;
}
}