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
82 lines (71 loc) · 2.3 KB
/
Copy pathDockablePanel.cs
File metadata and controls
82 lines (71 loc) · 2.3 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
75
76
77
78
79
80
81
82
using PluginCore.Helpers;
using PluginCore.Utilities;
using System;
using System.Drawing;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;
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;
// Restrict docking on Wine/CrossOver as you can't dock panels back if undocked...
this.DockPanel.AllowEndUserFloatChange = !PlatformHelper.isRunningOnWine();
this.DockPanel.AllowEndUserDocking = !PlatformHelper.isRunningOnWine();
this.Font = Globals.Settings.DefaultFont;
this.pluginGuid = pluginGuid;
this.HideOnClose = true;
this.Controls.Add(ctrl);
Globals.MainForm.ThemeControls(this);
}
/// <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;
}
/// <summary>
///
/// </summary>
internal class Template : DockContent
{
private string persistString;
internal Template(string persistString)
{
this.persistString = persistString;
}
public override string GetPersistString()
{
return persistString;
}
}
}
}