-
-
Notifications
You must be signed in to change notification settings - Fork 325
/
ToolItemHandler.cs
51 lines (41 loc) · 952 Bytes
/
ToolItemHandler.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using Eto.Forms;
using Eto.Drawing;
namespace Eto.Platform.GtkSharp
{
public interface IToolBarItemHandler
{
void CreateControl(ToolBarHandler handler, int index);
}
public abstract class ToolItemHandler<TControl, TWidget> : WidgetHandler<TControl, TWidget>, IToolItem, IToolBarItemHandler
where TControl: Gtk.Widget
where TWidget: ToolItem
{
bool enabled = true;
Image image;
protected Gtk.Image GtkImage { get; set; }
public abstract void CreateControl(ToolBarHandler handler, int index);
public string Text { get; set; }
public string ToolTip { get; set; }
public Image Image
{
get { return image; }
set
{
image = value;
GtkImage = image.ToGtk (Gtk.IconSize.Button);
}
}
public bool Enabled
{
get { return enabled; }
set {
enabled = value;
if (Control != null)
Control.Sensitive = value;
}
}
public void CreateFromCommand(Command command)
{
}
}
}