private void bgPanel_MouseUp(object sender, MouseEventArgs e)
{
_snappedx = -1;
_snappedy = -1;
if ((_drawingSelectionBox) && (e.X == _selectionBoxX) && (e.Y == _selectionBoxY))
{
_drawingSelectionBox = false;
}
if (_addingControl)
{
_addingControl = false;
CreateNewControl();
}
else if (_resizingControl)
{
_resizingControl = false;
refreshProperties();
}
else if (_drawingSelectionBox)
{
_drawingSelectionBox = false;
foreach (GUIControl _gc in _gui.Controls)
{
if (_selectionRect.Contains(_gc.GetRectangle()) && !_selected.Contains(_gc)) _selected.Add(_gc);
}
if (_selected.Count > 0) _selectedControl = _selected[_selected.Count - 1];
bgPanel.Invalidate();
}
else
{
_movingControl = false;
refreshProperties();
if ((e.Button == MouseButtons.Right))
{
ShowContextMenu(e.X, e.Y, _selectedControl);
}
}
}