-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileCloseableIconTitle.cs
More file actions
74 lines (50 loc) · 1.5 KB
/
Copy pathFileCloseableIconTitle.cs
File metadata and controls
74 lines (50 loc) · 1.5 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
using System;
namespace GtkEdit
{
#region class FileCloseableIconTitle
public class FileCloseableIconTitle: Gtk.HBox
{
#region Events
public event EventHandler CloseClicked;
#endregion Events
#region Fields
private readonly FileBuffer fileBuffer;
private readonly FileIconTitle fileIconTitle;
private readonly Gtk.Image imageClose;
private readonly Gtk.Button buttonClose;
#endregion Fields
#region Constructors
public FileCloseableIconTitle(FileBuffer fileBuffer)
: base(false, 0)
{
this.fileBuffer = fileBuffer;
fileIconTitle = new FileIconTitle(fileBuffer) { Visible = true };
imageClose = new Gtk.Image(Gtk.Stock.Close, Gtk.IconSize.Menu) { Visible = true };
buttonClose = new Gtk.Button(imageClose) { Visible = true, Relief = Gtk.ReliefStyle.None };
buttonClose.Clicked += ButtonClose_Clicked;
PackStart(fileIconTitle, false, true, 0);
PackStart(buttonClose, false, true, 0);
}
#endregion Constructors
#region Methods
protected virtual void OnCloseClicked(EventArgs e)
{
if (CloseClicked != null)
CloseClicked(this, e);
}
#region Event Handlers
private void ButtonClose_Clicked(object sender, EventArgs e)
{
OnCloseClicked(EventArgs.Empty);
}
#endregion Event Handlers
#endregion Methods
#region Properties
public FileBuffer FileBuffer
{
get { return fileBuffer; }
}
#endregion Properties
}
#endregion class FileCloseableIconTitle
}