public virtual bool MouseDown(Control c, Point pt, MouseButtons button)
{
// Only interested in left mouse pressing down
if (button == MouseButtons.Left)
{
// Can only click if enabled
if (ClickOnDown(pt) && _target.Enabled)
{
_captured = true;
// If already in fixed mode, then ignore mouse down
if (!_fixedPressed)
{
// Mouse is being pressed
UpdateTargetState(pt);
// Show the button as pressed, until told otherwise
_fixedPressed = true;
// Raise the appropriate event
switch (ButtonType)
{
case GroupButtonType.Split:
// Track if the mouse is inside the split area
if (ButtonType == GroupButtonType.Split)
_mouseInSplit = _splitRectangle.Contains(pt);
if (_splitRectangle.Contains(pt))
OnDropDown(new MouseEventArgs(MouseButtons.Left, 1, pt.X, pt.Y, 0));
else
OnClick(new MouseEventArgs(MouseButtons.Left, 1, pt.X, pt.Y, 0));
break;
case GroupButtonType.DropDown:
OnDropDown(new MouseEventArgs(MouseButtons.Left, 1, pt.X, pt.Y, 0));
break;
case GroupButtonType.Push:
case GroupButtonType.Check:
default:
OnClick(new MouseEventArgs(MouseButtons.Left, 1, pt.X, pt.Y, 0));
break;
}
}
}
else
{
// Capturing mouse input
_captured = true;
// Update the visual state
UpdateTargetState(pt);
}
}
// Remember the user has pressed the right mouse button down
if (button == MouseButtons.Right)
_rightButtonDown = true;
return _captured;
}