allow changing the color for a palette entry on double-click
This commit is contained in:
parent
2ae08bd3cd
commit
0563376da4
@ -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));
|
||||
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user