private void palettePanel_MouseDown(object sender, MouseEventArgs e)
{
if ((e.X > 30) && (e.X < 30 + 16 * 20) && (e.Y > 0) && (e.Y < 16 * 20))
{
int selectedIndex = (e.X - 30) / 20 + (e.Y / 20) * 16;
if (e.Button == MouseButtons.Right)
{
ShowContextMenu(selectedIndex, e.Location);
}
else if (Utilities.IsControlPressed())
{
ToggleColourSelected(selectedIndex);
}
else if (Utilities.IsShiftPressed())
{
AddRangeToSelection(selectedIndex);
}
else
{
_selectedIndexes.Clear();
_selectedIndexes.Add(selectedIndex);
}
UpdatePropertyGrid();
palettePanel.Invalidate();
}
}