2019-07-28 23:53:15 +03:00
|
|
|
// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt)
|
2015-06-02 22:52:35 +03:00
|
|
|
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
2015-05-14 22:35:07 +03:00
|
|
|
using System;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
|
|
|
|
|
namespace VisualPascalABCPlugins
|
|
|
|
|
{
|
|
|
|
|
public delegate void PluginGUIItemExecuteDelegate();
|
|
|
|
|
|
|
|
|
|
public class PluginGUIItem : IPluginGUIItem
|
|
|
|
|
{
|
|
|
|
|
string text;
|
|
|
|
|
string hint;
|
|
|
|
|
Image image;
|
|
|
|
|
Color imageTransparentColor;
|
|
|
|
|
PluginGUIItemExecuteDelegate executeDelegate;
|
|
|
|
|
System.Windows.Forms.Keys shortcutKeys = System.Windows.Forms.Keys.None;
|
|
|
|
|
string shortcutKeyDisplayString = null;
|
|
|
|
|
|
2022-08-07 13:38:40 +03:00
|
|
|
public object menuItem { get; set; }
|
|
|
|
|
public object toolStripButton { get; set; }
|
|
|
|
|
|
2015-05-14 22:35:07 +03:00
|
|
|
public PluginGUIItem(string text, string hint, Image image, Color imageTransparentColor, PluginGUIItemExecuteDelegate executeDelegate)
|
|
|
|
|
{
|
|
|
|
|
this.text = text;
|
|
|
|
|
this.hint = hint;
|
|
|
|
|
this.image = image;
|
|
|
|
|
this.imageTransparentColor = imageTransparentColor;
|
|
|
|
|
this.executeDelegate = executeDelegate;
|
|
|
|
|
}
|
|
|
|
|
public PluginGUIItem(string text, string hint, Image image, Color imageTransparentColor, PluginGUIItemExecuteDelegate executeDelegate, System.Windows.Forms.Keys shortcutKeys, string shortcutKeyDisplayString)
|
|
|
|
|
{
|
|
|
|
|
this.text = text;
|
|
|
|
|
this.hint = hint;
|
|
|
|
|
this.image = image;
|
|
|
|
|
this.imageTransparentColor = imageTransparentColor;
|
|
|
|
|
this.executeDelegate = executeDelegate;
|
|
|
|
|
this.shortcutKeys = shortcutKeys;
|
|
|
|
|
this.shortcutKeyDisplayString = shortcutKeyDisplayString;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string Text
|
|
|
|
|
{
|
|
|
|
|
get { return text; }
|
|
|
|
|
}
|
|
|
|
|
public string Hint
|
|
|
|
|
{
|
|
|
|
|
get { return hint; }
|
2022-05-23 08:21:56 +03:00
|
|
|
set { hint = value; }
|
2015-05-14 22:35:07 +03:00
|
|
|
}
|
|
|
|
|
public Image Image
|
|
|
|
|
{
|
|
|
|
|
get { return image; }
|
|
|
|
|
}
|
|
|
|
|
public Color ImageTransparentColor
|
|
|
|
|
{
|
|
|
|
|
get { return imageTransparentColor; }
|
|
|
|
|
}
|
|
|
|
|
public void Execute()
|
|
|
|
|
{
|
|
|
|
|
executeDelegate();
|
|
|
|
|
}
|
|
|
|
|
public System.Windows.Forms.Keys ShortcutKeys
|
|
|
|
|
{
|
|
|
|
|
get { return shortcutKeys; }
|
|
|
|
|
}
|
|
|
|
|
public string ShortcutKeyDisplayString
|
|
|
|
|
{
|
|
|
|
|
get { return shortcutKeyDisplayString; }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|