forked from fdorg/flashdevelop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockablePanel.cs
More file actions
61 lines (54 loc) · 1.64 KB
/
Copy pathDockablePanel.cs
File metadata and controls
61 lines (54 loc) · 1.64 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
using System;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;
using PluginCore.Utilities;
namespace FlashDevelop.Docking
{
public class DockablePanel : DockContent
{
private Image image;
private String pluginGuid;
public DockablePanel(Control ctrl, String pluginGuid)
{
this.Text = ctrl.Text;
ctrl.Dock = DockStyle.Fill;
this.DockPanel = Globals.MainForm.DockPanel;
if (ctrl.Tag != null) this.TabText = ctrl.Tag.ToString();
this.DockAreas = DockAreas.DockBottom | DockAreas.DockLeft | DockAreas.DockRight | DockAreas.DockTop | DockAreas.Float;
this.Font = Globals.Settings.DefaultFont;
this.pluginGuid = pluginGuid;
this.HideOnClose = true;
this.Controls.Add(ctrl);
Globals.MainForm.ThemeControls(this);
this.Show();
}
/// <summary>
/// Gets or sets the icon for the <see cref="DockablePanel"/>
/// </summary>
public Image Image
{
get { return image; }
set
{
image = value;
RefreshIcon();
}
}
/// <summary>
/// Refreshes the icon.
/// </summary>
public void RefreshIcon()
{
if (image != null) Icon = ImageKonverter.ImageToIcon(image);
}
/// <summary>
/// Retrieves the guid of the document
/// </summary>
public override String GetPersistString()
{
return this.pluginGuid;
}
}
}