allow changing the color for a palette entry on double-click

This commit is contained in:
Michael Becker 2019-11-09 17:48:49 -05:00
parent 2ae08bd3cd
commit 0563376da4
No known key found for this signature in database
GPG Key ID: 389DFF5D73781A12
2 changed files with 14 additions and 0 deletions

View File

@ -37,6 +37,7 @@ namespace UniversalEditor.Plugins.Multimedia.UserInterface.Editors.Multimedia.Pa
cc = new CustomControl();
cc.MouseDown += cc_MouseDown;
cc.MouseDoubleClick += cc_MouseDoubleClick;
cc.Paint += cc_Paint;
this.Controls.Add(cc, new BoxLayout.Constraints(true, true));

View File

@ -22,6 +22,7 @@ using System;
using MBS.Framework.Drawing;
using MBS.Framework.UserInterface;
using MBS.Framework.UserInterface.Dialogs;
using MBS.Framework.UserInterface.Drawing;
using UniversalEditor.ObjectModels.Multimedia.Palette;
@ -101,6 +102,18 @@ namespace UniversalEditor.Plugins.Multimedia.UserInterface.Editors.Multimedia.Pa
Refresh();
}
private void cc_MouseDoubleClick(object sender, MBS.Framework.UserInterface.Input.Mouse.MouseEventArgs e)
{
SelectedEntry = HitTest(e.Location);
ColorDialog dlg = new ColorDialog();
dlg.SelectedColor = SelectedEntry.Color;
if (dlg.ShowDialog() == DialogResult.OK)
{
SelectedEntry.Color = dlg.SelectedColor;
}
}
public event System.ComponentModel.CancelEventHandler SelectionChanging;
protected virtual void OnSelectionChanging(System.ComponentModel.CancelEventArgs e)
{