Browse Source

Merge Vendor/DockPanelSuite v2.1:v2.2 to SharpDevelop/Src/Libraries/DockPanel_Src.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@3146 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 18 years ago
parent
commit
2ba44dd381
  1. 10
      src/Libraries/DockPanel_Src/DockSample/DockSample.csproj
  2. 2
      src/Libraries/DockPanel_Src/DockSample/MainForm.cs
  3. 635
      src/Libraries/DockPanel_Src/DockSample/MainForm2.Designer.cs
  4. 443
      src/Libraries/DockPanel_Src/DockSample/MainForm2.cs
  5. 194
      src/Libraries/DockPanel_Src/DockSample/MainForm2.resx
  6. 22
      src/Libraries/DockPanel_Src/WinFormsUI.Docking.sln
  7. 42
      src/Libraries/DockPanel_Src/WinFormsUI.ndoc
  8. BIN
      src/Libraries/DockPanel_Src/WinFormsUI.suo
  9. 4
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockContentHandler.cs
  10. 12
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.AutoHideWindow.cs
  11. 29
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.DockDragHandler.cs
  12. 6
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.FocusManager.cs
  13. 2
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.Persistor.cs
  14. 0
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.bmp
  15. 50
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.cs
  16. 1
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanelExtender.cs
  17. 2
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/FloatWindow.cs
  18. 7
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources.Designer.cs
  19. 3
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources.resx
  20. BIN
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/Thumbs.db
  21. 9
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/Strings.Designer.cs
  22. 3
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/Strings.resx
  23. 2
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/VS2005DockPaneCaption.cs
  24. 6
      src/Libraries/DockPanel_Src/WinFormsUI/Properties/AssemblyInfo.cs
  25. 18
      src/Libraries/DockPanel_Src/WinFormsUI/WinFormsUI.csproj

10
src/Libraries/DockPanel_Src/DockSample/DockSample.csproj

@ -41,6 +41,12 @@
<Compile Include="AboutDialog.Designer.cs"> <Compile Include="AboutDialog.Designer.cs">
<DependentUpon>AboutDialog.cs</DependentUpon> <DependentUpon>AboutDialog.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="MainForm2.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm2.Designer.cs">
<DependentUpon>MainForm2.cs</DependentUpon>
</Compile>
<Compile Include="DummyDoc.cs"> <Compile Include="DummyDoc.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@ -198,6 +204,10 @@
<None Include="Images\XmlFile.ico" /> <None Include="Images\XmlFile.ico" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="MainForm2.resx">
<DependentUpon>MainForm2.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Customization\Resources.resx"> <EmbeddedResource Include="Customization\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>

2
src/Libraries/DockPanel_Src/DockSample/MainForm.cs

@ -403,7 +403,7 @@ namespace DockSample
} }
else else
{ {
foreach (IDockContent document in dockPanel.Documents) foreach (IDockContent document in dockPanel.DocumentsToArray())
{ {
if (!document.DockHandler.IsActivated) if (!document.DockHandler.IsActivated)
document.DockHandler.Close(); document.DockHandler.Close();

635
src/Libraries/DockPanel_Src/DockSample/MainForm2.Designer.cs generated

@ -0,0 +1,635 @@
namespace DockSample
{
partial class MainForm2
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm2));
this.mainMenu = new System.Windows.Forms.MenuStrip();
this.menuItemFile = new System.Windows.Forms.ToolStripMenuItem();
this.menuItemNew = new System.Windows.Forms.ToolStripMenuItem();
this.menuItemOpen = new System.Windows.Forms.ToolStripMenuItem();
this.menuItemClose = new System.Windows.Forms.ToolStripMenuItem();
this.menuItemCloseAll = new System.Windows.Forms.ToolStripMenuItem();
this.menuItemCloseAllButThisOne = new System.Windows.Forms.ToolStripMenuItem();
this.menuItem4 = new System.Windows.Forms.ToolStripSeparator();
this.menuItemExit = new System.Windows.Forms.ToolStripMenuItem();
this.exitWithoutSavingLayout = new System.Windows.Forms.ToolStripMenuItem();
this.menuItemView = new System.Windows.Forms.ToolStripMenuItem();
this.menuItemSolutionExplorer = new System.Windows.Forms.ToolStripMenuItem();
this.menuItemPropertyWindow = new System.Windows.Forms.ToolStripMenuItem();
this.menuItemToolbox = new System.Windows.Forms.ToolStripMenuItem();
this.menuItemOutputWindow = new System.Windows.Forms.ToolStripMenuItem();
this.menuItemTaskList = new System.Windows.Forms.ToolStripMenuItem();
this.menuItem1 = new System.Windows.Forms.ToolStripSeparator();
this.menuItemToolBar = new System.Windows.Forms.ToolStripMenuItem();
this.menuItemStatusBar = new System.Windows.Forms.ToolStripMenuItem();
this.menuItem2 = new System.Windows.Forms.ToolStripSeparator();
this.menuItemLayoutByCode = new System.Windows.Forms.ToolStripMenuItem();
this.menuItemLayoutByXml = new System.Windows.Forms.ToolStripMenuItem();
this.menuItemTools = new System.Windows.Forms.ToolStripMenuItem();
this.menuItemLockLayout = new System.Windows.Forms.ToolStripMenuItem();
this.menuItemShowDocumentIcon = new System.Windows.Forms.ToolStripMenuItem();
this.menuItem3 = new System.Windows.Forms.ToolStripSeparator();
this.menuItemSchemaVS2005 = new System.Windows.Forms.ToolStripMenuItem();
this.menuItemSchemaVS2003 = new System.Windows.Forms.ToolStripMenuItem();
this.menuItem6 = new System.Windows.Forms.ToolStripSeparator();
this.menuItemDockingMdi = new System.Windows.Forms.ToolStripMenuItem();
this.menuItemDockingSdi = new System.Windows.Forms.ToolStripMenuItem();
this.menuItemDockingWindow = new System.Windows.Forms.ToolStripMenuItem();
this.menuItemSystemMdi = new System.Windows.Forms.ToolStripMenuItem();
this.menuItem5 = new System.Windows.Forms.ToolStripSeparator();
this.showRightToLeft = new System.Windows.Forms.ToolStripMenuItem();
this.menuItemWindow = new System.Windows.Forms.ToolStripMenuItem();
this.menuItemNewWindow = new System.Windows.Forms.ToolStripMenuItem();
this.menuItemHelp = new System.Windows.Forms.ToolStripMenuItem();
this.menuItemAbout = new System.Windows.Forms.ToolStripMenuItem();
this.imageList = new System.Windows.Forms.ImageList(this.components);
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.toolBar = new System.Windows.Forms.ToolStrip();
this.toolBarButtonNew = new System.Windows.Forms.ToolStripButton();
this.toolBarButtonOpen = new System.Windows.Forms.ToolStripButton();
this.toolBarButtonSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.toolBarButtonSolutionExplorer = new System.Windows.Forms.ToolStripButton();
this.toolBarButtonPropertyWindow = new System.Windows.Forms.ToolStripButton();
this.toolBarButtonToolbox = new System.Windows.Forms.ToolStripButton();
this.toolBarButtonOutputWindow = new System.Windows.Forms.ToolStripButton();
this.toolBarButtonTaskList = new System.Windows.Forms.ToolStripButton();
this.toolBarButtonSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.toolBarButtonLayoutByCode = new System.Windows.Forms.ToolStripButton();
this.toolBarButtonLayoutByXml = new System.Windows.Forms.ToolStripButton();
this.dockPanel = new WeifenLuo.WinFormsUI.Docking.DockPanel();
this.statusBar = new System.Windows.Forms.StatusStrip();
this.mainMenu.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.toolBar.SuspendLayout();
this.SuspendLayout();
//
// mainMenu
//
this.mainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuItemFile,
this.menuItemView,
this.menuItemTools,
this.menuItemWindow,
this.menuItemHelp});
this.mainMenu.Location = new System.Drawing.Point(0, 0);
this.mainMenu.MdiWindowListItem = this.menuItemWindow;
this.mainMenu.Name = "mainMenu";
this.mainMenu.Size = new System.Drawing.Size(579, 24);
this.mainMenu.TabIndex = 7;
//
// menuItemFile
//
this.menuItemFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuItemNew,
this.menuItemOpen,
this.menuItemClose,
this.menuItemCloseAll,
this.menuItemCloseAllButThisOne,
this.menuItem4,
this.menuItemExit,
this.exitWithoutSavingLayout});
this.menuItemFile.Name = "menuItemFile";
this.menuItemFile.Size = new System.Drawing.Size(35, 20);
this.menuItemFile.Text = "&File";
this.menuItemFile.DropDownOpening += new System.EventHandler(this.menuItemFile_Popup);
//
// menuItemNew
//
this.menuItemNew.Name = "menuItemNew";
this.menuItemNew.Size = new System.Drawing.Size(204, 22);
this.menuItemNew.Text = "&New";
this.menuItemNew.Click += new System.EventHandler(this.menuItemNew_Click);
//
// menuItemOpen
//
this.menuItemOpen.Name = "menuItemOpen";
this.menuItemOpen.Size = new System.Drawing.Size(204, 22);
this.menuItemOpen.Text = "&Open...";
this.menuItemOpen.Click += new System.EventHandler(this.menuItemOpen_Click);
//
// menuItemClose
//
this.menuItemClose.Name = "menuItemClose";
this.menuItemClose.Size = new System.Drawing.Size(204, 22);
this.menuItemClose.Text = "&Close";
this.menuItemClose.Click += new System.EventHandler(this.menuItemClose_Click);
//
// menuItemCloseAll
//
this.menuItemCloseAll.Name = "menuItemCloseAll";
this.menuItemCloseAll.Size = new System.Drawing.Size(204, 22);
this.menuItemCloseAll.Text = "Close &All";
this.menuItemCloseAll.Click += new System.EventHandler(this.menuItemCloseAll_Click);
//
// menuItemCloseAllButThisOne
//
this.menuItemCloseAllButThisOne.Name = "menuItemCloseAllButThisOne";
this.menuItemCloseAllButThisOne.Size = new System.Drawing.Size(204, 22);
this.menuItemCloseAllButThisOne.Text = "Close All &But This One";
this.menuItemCloseAllButThisOne.Click += new System.EventHandler(this.menuItemCloseAllButThisOne_Click);
//
// menuItem4
//
this.menuItem4.Name = "menuItem4";
this.menuItem4.Size = new System.Drawing.Size(201, 6);
//
// menuItemExit
//
this.menuItemExit.Name = "menuItemExit";
this.menuItemExit.Size = new System.Drawing.Size(204, 22);
this.menuItemExit.Text = "&Exit";
this.menuItemExit.Click += new System.EventHandler(this.menuItemExit_Click);
//
// exitWithoutSavingLayout
//
this.exitWithoutSavingLayout.Name = "exitWithoutSavingLayout";
this.exitWithoutSavingLayout.Size = new System.Drawing.Size(204, 22);
this.exitWithoutSavingLayout.Text = "Exit &Without Saving Layout";
this.exitWithoutSavingLayout.Click += new System.EventHandler(this.exitWithoutSavingLayout_Click);
//
// menuItemView
//
this.menuItemView.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuItemSolutionExplorer,
this.menuItemPropertyWindow,
this.menuItemToolbox,
this.menuItemOutputWindow,
this.menuItemTaskList,
this.menuItem1,
this.menuItemToolBar,
this.menuItemStatusBar,
this.menuItem2,
this.menuItemLayoutByCode,
this.menuItemLayoutByXml});
this.menuItemView.MergeIndex = 1;
this.menuItemView.Name = "menuItemView";
this.menuItemView.Size = new System.Drawing.Size(41, 20);
this.menuItemView.Text = "&View";
//
// menuItemSolutionExplorer
//
this.menuItemSolutionExplorer.Name = "menuItemSolutionExplorer";
this.menuItemSolutionExplorer.Size = new System.Drawing.Size(176, 22);
this.menuItemSolutionExplorer.Text = "&Solution Explorer";
this.menuItemSolutionExplorer.Click += new System.EventHandler(this.menuItemSolutionExplorer_Click);
//
// menuItemPropertyWindow
//
this.menuItemPropertyWindow.Name = "menuItemPropertyWindow";
this.menuItemPropertyWindow.ShortcutKeys = System.Windows.Forms.Keys.F4;
this.menuItemPropertyWindow.Size = new System.Drawing.Size(176, 22);
this.menuItemPropertyWindow.Text = "&Property Window";
this.menuItemPropertyWindow.Click += new System.EventHandler(this.menuItemPropertyWindow_Click);
//
// menuItemToolbox
//
this.menuItemToolbox.Name = "menuItemToolbox";
this.menuItemToolbox.Size = new System.Drawing.Size(176, 22);
this.menuItemToolbox.Text = "&Toolbox";
this.menuItemToolbox.Click += new System.EventHandler(this.menuItemToolbox_Click);
//
// menuItemOutputWindow
//
this.menuItemOutputWindow.Name = "menuItemOutputWindow";
this.menuItemOutputWindow.Size = new System.Drawing.Size(176, 22);
this.menuItemOutputWindow.Text = "&Output Window";
this.menuItemOutputWindow.Click += new System.EventHandler(this.menuItemOutputWindow_Click);
//
// menuItemTaskList
//
this.menuItemTaskList.Name = "menuItemTaskList";
this.menuItemTaskList.Size = new System.Drawing.Size(176, 22);
this.menuItemTaskList.Text = "Task &List";
this.menuItemTaskList.Click += new System.EventHandler(this.menuItemTaskList_Click);
//
// menuItem1
//
this.menuItem1.Name = "menuItem1";
this.menuItem1.Size = new System.Drawing.Size(173, 6);
//
// menuItemToolBar
//
this.menuItemToolBar.Checked = true;
this.menuItemToolBar.CheckState = System.Windows.Forms.CheckState.Checked;
this.menuItemToolBar.Name = "menuItemToolBar";
this.menuItemToolBar.Size = new System.Drawing.Size(176, 22);
this.menuItemToolBar.Text = "Tool &Bar";
this.menuItemToolBar.Click += new System.EventHandler(this.menuItemToolBar_Click);
//
// menuItemStatusBar
//
this.menuItemStatusBar.Checked = true;
this.menuItemStatusBar.CheckState = System.Windows.Forms.CheckState.Checked;
this.menuItemStatusBar.Name = "menuItemStatusBar";
this.menuItemStatusBar.Size = new System.Drawing.Size(176, 22);
this.menuItemStatusBar.Text = "Status B&ar";
this.menuItemStatusBar.Click += new System.EventHandler(this.menuItemStatusBar_Click);
//
// menuItem2
//
this.menuItem2.Name = "menuItem2";
this.menuItem2.Size = new System.Drawing.Size(173, 6);
//
// menuItemLayoutByCode
//
this.menuItemLayoutByCode.Name = "menuItemLayoutByCode";
this.menuItemLayoutByCode.Size = new System.Drawing.Size(176, 22);
this.menuItemLayoutByCode.Text = "Layout By &Code";
this.menuItemLayoutByCode.Click += new System.EventHandler(this.menuItemLayoutByCode_Click);
//
// menuItemLayoutByXml
//
this.menuItemLayoutByXml.Name = "menuItemLayoutByXml";
this.menuItemLayoutByXml.Size = new System.Drawing.Size(176, 22);
this.menuItemLayoutByXml.Text = "Layout By &XML";
this.menuItemLayoutByXml.Click += new System.EventHandler(this.menuItemLayoutByXml_Click);
//
// menuItemTools
//
this.menuItemTools.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuItemLockLayout,
this.menuItemShowDocumentIcon,
this.menuItem3,
this.menuItemSchemaVS2005,
this.menuItemSchemaVS2003,
this.menuItem6,
this.menuItemDockingMdi,
this.menuItemDockingSdi,
this.menuItemDockingWindow,
this.menuItemSystemMdi,
this.menuItem5,
this.showRightToLeft});
this.menuItemTools.MergeIndex = 2;
this.menuItemTools.Name = "menuItemTools";
this.menuItemTools.Size = new System.Drawing.Size(44, 20);
this.menuItemTools.Text = "&Tools";
this.menuItemTools.DropDownOpening += new System.EventHandler(this.menuItemTools_Popup);
//
// menuItemLockLayout
//
this.menuItemLockLayout.Name = "menuItemLockLayout";
this.menuItemLockLayout.Size = new System.Drawing.Size(234, 22);
this.menuItemLockLayout.Text = "&Lock Layout";
this.menuItemLockLayout.Click += new System.EventHandler(this.menuItemLockLayout_Click);
//
// menuItemShowDocumentIcon
//
this.menuItemShowDocumentIcon.Name = "menuItemShowDocumentIcon";
this.menuItemShowDocumentIcon.Size = new System.Drawing.Size(234, 22);
this.menuItemShowDocumentIcon.Text = "&Show Document Icon";
this.menuItemShowDocumentIcon.Click += new System.EventHandler(this.menuItemShowDocumentIcon_Click);
//
// menuItem3
//
this.menuItem3.Name = "menuItem3";
this.menuItem3.Size = new System.Drawing.Size(231, 6);
//
// menuItemSchemaVS2005
//
this.menuItemSchemaVS2005.Checked = true;
this.menuItemSchemaVS2005.CheckState = System.Windows.Forms.CheckState.Checked;
this.menuItemSchemaVS2005.Name = "menuItemSchemaVS2005";
this.menuItemSchemaVS2005.Size = new System.Drawing.Size(234, 22);
this.menuItemSchemaVS2005.Text = "Schema: VS200&5";
this.menuItemSchemaVS2005.Click += new System.EventHandler(this.SetSchema);
//
// menuItemSchemaVS2003
//
this.menuItemSchemaVS2003.Name = "menuItemSchemaVS2003";
this.menuItemSchemaVS2003.Size = new System.Drawing.Size(234, 22);
this.menuItemSchemaVS2003.Text = "Schema: VS200&3";
this.menuItemSchemaVS2003.Click += new System.EventHandler(this.SetSchema);
//
// menuItem6
//
this.menuItem6.Name = "menuItem6";
this.menuItem6.Size = new System.Drawing.Size(231, 6);
//
// menuItemDockingMdi
//
this.menuItemDockingMdi.Checked = true;
this.menuItemDockingMdi.CheckState = System.Windows.Forms.CheckState.Checked;
this.menuItemDockingMdi.Name = "menuItemDockingMdi";
this.menuItemDockingMdi.Size = new System.Drawing.Size(234, 22);
this.menuItemDockingMdi.Text = "Document Style: Docking &MDI";
this.menuItemDockingMdi.Click += new System.EventHandler(this.SetDocumentStyle);
//
// menuItemDockingSdi
//
this.menuItemDockingSdi.Name = "menuItemDockingSdi";
this.menuItemDockingSdi.Size = new System.Drawing.Size(234, 22);
this.menuItemDockingSdi.Text = "Document Style: Docking &SDI";
this.menuItemDockingSdi.Click += new System.EventHandler(this.SetDocumentStyle);
//
// menuItemDockingWindow
//
this.menuItemDockingWindow.Name = "menuItemDockingWindow";
this.menuItemDockingWindow.Size = new System.Drawing.Size(234, 22);
this.menuItemDockingWindow.Text = "Document Style: Docking &Window";
this.menuItemDockingWindow.Click += new System.EventHandler(this.SetDocumentStyle);
//
// menuItemSystemMdi
//
this.menuItemSystemMdi.Name = "menuItemSystemMdi";
this.menuItemSystemMdi.Size = new System.Drawing.Size(234, 22);
this.menuItemSystemMdi.Text = "Document Style: S&ystem MDI";
this.menuItemSystemMdi.Click += new System.EventHandler(this.SetDocumentStyle);
//
// menuItem5
//
this.menuItem5.Name = "menuItem5";
this.menuItem5.Size = new System.Drawing.Size(231, 6);
//
// showRightToLeft
//
this.showRightToLeft.Name = "showRightToLeft";
this.showRightToLeft.Size = new System.Drawing.Size(234, 22);
this.showRightToLeft.Text = "Show &Right-To-Left";
this.showRightToLeft.Click += new System.EventHandler(this.showRightToLeft_Click);
//
// menuItemWindow
//
this.menuItemWindow.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuItemNewWindow});
this.menuItemWindow.MergeIndex = 2;
this.menuItemWindow.Name = "menuItemWindow";
this.menuItemWindow.Size = new System.Drawing.Size(57, 20);
this.menuItemWindow.Text = "&Window";
//
// menuItemNewWindow
//
this.menuItemNewWindow.Name = "menuItemNewWindow";
this.menuItemNewWindow.Size = new System.Drawing.Size(136, 22);
this.menuItemNewWindow.Text = "&New Window";
this.menuItemNewWindow.Click += new System.EventHandler(this.menuItemNewWindow_Click);
//
// menuItemHelp
//
this.menuItemHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuItemAbout});
this.menuItemHelp.MergeIndex = 3;
this.menuItemHelp.Name = "menuItemHelp";
this.menuItemHelp.Size = new System.Drawing.Size(40, 20);
this.menuItemHelp.Text = "&Help";
//
// menuItemAbout
//
this.menuItemAbout.Name = "menuItemAbout";
this.menuItemAbout.Size = new System.Drawing.Size(175, 22);
this.menuItemAbout.Text = "&About DockSample...";
this.menuItemAbout.Click += new System.EventHandler(this.menuItemAbout_Click);
//
// imageList
//
this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream")));
this.imageList.TransparentColor = System.Drawing.Color.Transparent;
this.imageList.Images.SetKeyName(0, "");
this.imageList.Images.SetKeyName(1, "");
this.imageList.Images.SetKeyName(2, "");
this.imageList.Images.SetKeyName(3, "");
this.imageList.Images.SetKeyName(4, "");
this.imageList.Images.SetKeyName(5, "");
this.imageList.Images.SetKeyName(6, "");
this.imageList.Images.SetKeyName(7, "");
this.imageList.Images.SetKeyName(8, "");
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 1;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Controls.Add(this.toolBar, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.dockPanel, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.statusBar, 0, 2);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 24);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.Size = new System.Drawing.Size(579, 385);
this.tableLayoutPanel1.TabIndex = 9;
//
// toolBar
//
this.toolBar.ImageList = this.imageList;
this.toolBar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolBarButtonNew,
this.toolBarButtonOpen,
this.toolBarButtonSeparator1,
this.toolBarButtonSolutionExplorer,
this.toolBarButtonPropertyWindow,
this.toolBarButtonToolbox,
this.toolBarButtonOutputWindow,
this.toolBarButtonTaskList,
this.toolBarButtonSeparator2,
this.toolBarButtonLayoutByCode,
this.toolBarButtonLayoutByXml});
this.toolBar.Location = new System.Drawing.Point(0, 0);
this.toolBar.Name = "toolBar";
this.toolBar.Size = new System.Drawing.Size(579, 25);
this.toolBar.TabIndex = 7;
//
// toolBarButtonNew
//
this.toolBarButtonNew.ImageIndex = 0;
this.toolBarButtonNew.Name = "toolBarButtonNew";
this.toolBarButtonNew.Size = new System.Drawing.Size(23, 22);
this.toolBarButtonNew.ToolTipText = "Show Layout From XML";
//
// toolBarButtonOpen
//
this.toolBarButtonOpen.ImageIndex = 1;
this.toolBarButtonOpen.Name = "toolBarButtonOpen";
this.toolBarButtonOpen.Size = new System.Drawing.Size(23, 22);
this.toolBarButtonOpen.ToolTipText = "Open";
//
// toolBarButtonSeparator1
//
this.toolBarButtonSeparator1.Name = "toolBarButtonSeparator1";
this.toolBarButtonSeparator1.Size = new System.Drawing.Size(6, 25);
//
// toolBarButtonSolutionExplorer
//
this.toolBarButtonSolutionExplorer.ImageIndex = 2;
this.toolBarButtonSolutionExplorer.Name = "toolBarButtonSolutionExplorer";
this.toolBarButtonSolutionExplorer.Size = new System.Drawing.Size(23, 22);
this.toolBarButtonSolutionExplorer.ToolTipText = "Solution Explorer";
//
// toolBarButtonPropertyWindow
//
this.toolBarButtonPropertyWindow.ImageIndex = 3;
this.toolBarButtonPropertyWindow.Name = "toolBarButtonPropertyWindow";
this.toolBarButtonPropertyWindow.Size = new System.Drawing.Size(23, 22);
this.toolBarButtonPropertyWindow.ToolTipText = "Property Window";
//
// toolBarButtonToolbox
//
this.toolBarButtonToolbox.ImageIndex = 4;
this.toolBarButtonToolbox.Name = "toolBarButtonToolbox";
this.toolBarButtonToolbox.Size = new System.Drawing.Size(23, 22);
this.toolBarButtonToolbox.ToolTipText = "Tool Box";
//
// toolBarButtonOutputWindow
//
this.toolBarButtonOutputWindow.ImageIndex = 5;
this.toolBarButtonOutputWindow.Name = "toolBarButtonOutputWindow";
this.toolBarButtonOutputWindow.Size = new System.Drawing.Size(23, 22);
this.toolBarButtonOutputWindow.ToolTipText = "Output Window";
//
// toolBarButtonTaskList
//
this.toolBarButtonTaskList.ImageIndex = 6;
this.toolBarButtonTaskList.Name = "toolBarButtonTaskList";
this.toolBarButtonTaskList.Size = new System.Drawing.Size(23, 22);
this.toolBarButtonTaskList.ToolTipText = "Task List";
//
// toolBarButtonSeparator2
//
this.toolBarButtonSeparator2.Name = "toolBarButtonSeparator2";
this.toolBarButtonSeparator2.Size = new System.Drawing.Size(6, 25);
//
// toolBarButtonLayoutByCode
//
this.toolBarButtonLayoutByCode.ImageIndex = 7;
this.toolBarButtonLayoutByCode.Name = "toolBarButtonLayoutByCode";
this.toolBarButtonLayoutByCode.Size = new System.Drawing.Size(23, 22);
this.toolBarButtonLayoutByCode.ToolTipText = "Show Layout By Code";
//
// toolBarButtonLayoutByXml
//
this.toolBarButtonLayoutByXml.ImageIndex = 8;
this.toolBarButtonLayoutByXml.Name = "toolBarButtonLayoutByXml";
this.toolBarButtonLayoutByXml.Size = new System.Drawing.Size(23, 22);
this.toolBarButtonLayoutByXml.ToolTipText = "Show layout by predefined XML file";
//
// dockPanel
//
this.dockPanel.ActiveAutoHideContent = null;
this.dockPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.dockPanel.DockBottomPortion = 150;
this.dockPanel.DockLeftPortion = 200;
this.dockPanel.DockRightPortion = 200;
this.dockPanel.DockTopPortion = 150;
this.dockPanel.DocumentStyle = WeifenLuo.WinFormsUI.Docking.DocumentStyle.DockingWindow;
this.dockPanel.Font = new System.Drawing.Font("Tahoma", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World, ((byte)(0)));
this.dockPanel.Location = new System.Drawing.Point(3, 28);
this.dockPanel.Name = "dockPanel";
this.dockPanel.RightToLeftLayout = true;
this.dockPanel.Size = new System.Drawing.Size(573, 332);
this.dockPanel.TabIndex = 10;
//
// statusBar
//
this.statusBar.Location = new System.Drawing.Point(0, 363);
this.statusBar.Name = "statusBar";
this.statusBar.Size = new System.Drawing.Size(579, 22);
this.statusBar.TabIndex = 8;
//
// MainForm2
//
this.ClientSize = new System.Drawing.Size(579, 409);
this.Controls.Add(this.tableLayoutPanel1);
this.Controls.Add(this.mainMenu);
this.IsMdiContainer = true;
this.MainMenuStrip = this.mainMenu;
this.Name = "MainForm2";
this.Text = "DockSample";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Closing += new System.ComponentModel.CancelEventHandler(this.MainForm_Closing);
this.Load += new System.EventHandler(this.MainForm_Load);
this.mainMenu.ResumeLayout(false);
this.mainMenu.PerformLayout();
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.toolBar.ResumeLayout(false);
this.toolBar.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ImageList imageList;
private System.Windows.Forms.MenuStrip mainMenu;
private System.Windows.Forms.ToolStripMenuItem menuItemFile;
private System.Windows.Forms.ToolStripMenuItem menuItemNew;
private System.Windows.Forms.ToolStripMenuItem menuItemOpen;
private System.Windows.Forms.ToolStripMenuItem menuItemClose;
private System.Windows.Forms.ToolStripMenuItem menuItemCloseAll;
private System.Windows.Forms.ToolStripMenuItem menuItemCloseAllButThisOne;
private System.Windows.Forms.ToolStripSeparator menuItem4;
private System.Windows.Forms.ToolStripMenuItem menuItemExit;
private System.Windows.Forms.ToolStripMenuItem menuItemView;
private System.Windows.Forms.ToolStripMenuItem menuItemSolutionExplorer;
private System.Windows.Forms.ToolStripMenuItem menuItemPropertyWindow;
private System.Windows.Forms.ToolStripMenuItem menuItemToolbox;
private System.Windows.Forms.ToolStripMenuItem menuItemOutputWindow;
private System.Windows.Forms.ToolStripMenuItem menuItemTaskList;
private System.Windows.Forms.ToolStripSeparator menuItem1;
private System.Windows.Forms.ToolStripMenuItem menuItemToolBar;
private System.Windows.Forms.ToolStripMenuItem menuItemStatusBar;
private System.Windows.Forms.ToolStripSeparator menuItem2;
private System.Windows.Forms.ToolStripMenuItem menuItemLayoutByCode;
private System.Windows.Forms.ToolStripMenuItem menuItemLayoutByXml;
private System.Windows.Forms.ToolStripMenuItem menuItemTools;
private System.Windows.Forms.ToolStripMenuItem menuItemLockLayout;
private System.Windows.Forms.ToolStripSeparator menuItem3;
private System.Windows.Forms.ToolStripMenuItem menuItemSchemaVS2005;
private System.Windows.Forms.ToolStripMenuItem menuItemSchemaVS2003;
private System.Windows.Forms.ToolStripSeparator menuItem6;
private System.Windows.Forms.ToolStripMenuItem menuItemDockingMdi;
private System.Windows.Forms.ToolStripMenuItem menuItemDockingSdi;
private System.Windows.Forms.ToolStripMenuItem menuItemDockingWindow;
private System.Windows.Forms.ToolStripMenuItem menuItemSystemMdi;
private System.Windows.Forms.ToolStripSeparator menuItem5;
private System.Windows.Forms.ToolStripMenuItem menuItemShowDocumentIcon;
private System.Windows.Forms.ToolStripMenuItem menuItemWindow;
private System.Windows.Forms.ToolStripMenuItem menuItemNewWindow;
private System.Windows.Forms.ToolStripMenuItem menuItemHelp;
private System.Windows.Forms.ToolStripMenuItem menuItemAbout;
private System.Windows.Forms.ToolStripMenuItem showRightToLeft;
private System.Windows.Forms.ToolStripMenuItem exitWithoutSavingLayout;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private WeifenLuo.WinFormsUI.Docking.DockPanel dockPanel;
private System.Windows.Forms.StatusStrip statusBar;
private System.Windows.Forms.ToolStrip toolBar;
private System.Windows.Forms.ToolStripButton toolBarButtonNew;
private System.Windows.Forms.ToolStripButton toolBarButtonOpen;
private System.Windows.Forms.ToolStripSeparator toolBarButtonSeparator1;
private System.Windows.Forms.ToolStripButton toolBarButtonSolutionExplorer;
private System.Windows.Forms.ToolStripButton toolBarButtonPropertyWindow;
private System.Windows.Forms.ToolStripButton toolBarButtonToolbox;
private System.Windows.Forms.ToolStripButton toolBarButtonOutputWindow;
private System.Windows.Forms.ToolStripButton toolBarButtonTaskList;
private System.Windows.Forms.ToolStripSeparator toolBarButtonSeparator2;
private System.Windows.Forms.ToolStripButton toolBarButtonLayoutByCode;
private System.Windows.Forms.ToolStripButton toolBarButtonLayoutByXml;
}
}

443
src/Libraries/DockPanel_Src/DockSample/MainForm2.cs

@ -0,0 +1,443 @@
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Reflection;
using System.Windows.Forms;
using System.IO;
using WeifenLuo.WinFormsUI.Docking;
using DockSample.Customization;
namespace DockSample
{
public partial class MainForm2 : Form
{
private bool m_bSaveLayout = true;
private DeserializeDockContent m_deserializeDockContent;
private DummySolutionExplorer m_solutionExplorer = new DummySolutionExplorer();
private DummyPropertyWindow m_propertyWindow = new DummyPropertyWindow();
private DummyToolbox m_toolbox = new DummyToolbox();
private DummyOutputWindow m_outputWindow = new DummyOutputWindow();
private DummyTaskList m_taskList = new DummyTaskList();
public MainForm2()
{
InitializeComponent();
showRightToLeft.Checked = (RightToLeft == RightToLeft.Yes);
RightToLeftLayout = showRightToLeft.Checked;
m_solutionExplorer = new DummySolutionExplorer();
m_solutionExplorer.RightToLeftLayout = RightToLeftLayout;
m_deserializeDockContent = new DeserializeDockContent(GetContentFromPersistString);
}
private void menuItemExit_Click(object sender, System.EventArgs e)
{
Close();
}
private void menuItemSolutionExplorer_Click(object sender, System.EventArgs e)
{
m_solutionExplorer.Show(dockPanel);
}
private void menuItemPropertyWindow_Click(object sender, System.EventArgs e)
{
m_propertyWindow.Show(dockPanel);
}
private void menuItemToolbox_Click(object sender, System.EventArgs e)
{
m_toolbox.Show(dockPanel);
}
private void menuItemOutputWindow_Click(object sender, System.EventArgs e)
{
m_outputWindow.Show(dockPanel);
}
private void menuItemTaskList_Click(object sender, System.EventArgs e)
{
m_taskList.Show(dockPanel);
}
private void menuItemAbout_Click(object sender, System.EventArgs e)
{
AboutDialog aboutDialog = new AboutDialog();
aboutDialog.ShowDialog(this);
}
private IDockContent FindDocument(string text)
{
if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi)
{
foreach (Form form in MdiChildren)
if (form.Text == text)
return form as IDockContent;
return null;
}
else
{
foreach (IDockContent content in dockPanel.Documents)
if (content.DockHandler.TabText == text)
return content;
return null;
}
}
private void menuItemNew_Click(object sender, System.EventArgs e)
{
DummyDoc dummyDoc = CreateNewDocument();
if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi)
{
dummyDoc.MdiParent = this;
dummyDoc.Show();
}
else
dummyDoc.Show(dockPanel);
}
private DummyDoc CreateNewDocument()
{
DummyDoc dummyDoc = new DummyDoc();
int count = 1;
//string text = "C:\\MADFDKAJ\\ADAKFJASD\\ADFKDSAKFJASD\\ASDFKASDFJASDF\\ASDFIJADSFJ\\ASDFKDFDA" + count.ToString();
string text = "Document" + count.ToString();
while (FindDocument(text) != null)
{
count ++;
//text = "C:\\MADFDKAJ\\ADAKFJASD\\ADFKDSAKFJASD\\ASDFKASDFJASDF\\ASDFIJADSFJ\\ASDFKDFDA" + count.ToString();
text = "Document" + count.ToString();
}
dummyDoc.Text = text;
return dummyDoc;
}
private DummyDoc CreateNewDocument(string text)
{
DummyDoc dummyDoc = new DummyDoc();
dummyDoc.Text = text;
return dummyDoc;
}
private void menuItemOpen_Click(object sender, System.EventArgs e)
{
OpenFileDialog openFile = new OpenFileDialog();
openFile.InitialDirectory = Application.ExecutablePath;
openFile.Filter = "rtf files (*.rtf)|*.rtf|txt files (*.txt)|*.txt|All files (*.*)|*.*" ;
openFile.FilterIndex = 1;
openFile.RestoreDirectory = true ;
if(openFile.ShowDialog() == DialogResult.OK)
{
string fullName = openFile.FileName;
string fileName = Path.GetFileName(fullName);
if (FindDocument(fileName) != null)
{
MessageBox.Show("The document: " + fileName + " has already opened!");
return;
}
DummyDoc dummyDoc = new DummyDoc();
dummyDoc.Text = fileName;
dummyDoc.Show(dockPanel);
try
{
dummyDoc.FileName = fullName;
}
catch (Exception exception)
{
dummyDoc.Close();
MessageBox.Show(exception.Message);
}
}
}
private void menuItemFile_Popup(object sender, System.EventArgs e)
{
if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi)
{
menuItemClose.Enabled = menuItemCloseAll.Enabled = (ActiveMdiChild != null);
}
else
{
menuItemClose.Enabled = (dockPanel.ActiveDocument != null);
menuItemCloseAll.Enabled = (dockPanel.DocumentsCount > 0);
}
}
private void menuItemClose_Click(object sender, System.EventArgs e)
{
if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi)
ActiveMdiChild.Close();
else if (dockPanel.ActiveDocument != null)
dockPanel.ActiveDocument.DockHandler.Close();
}
private void menuItemCloseAll_Click(object sender, System.EventArgs e)
{
CloseAllDocuments();
}
private void CloseAllDocuments()
{
if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi)
{
foreach (Form form in MdiChildren)
form.Close();
}
else
{
IDockContent[] documents = dockPanel.DocumentsToArray();
foreach (IDockContent content in documents)
content.DockHandler.Close();
}
}
private IDockContent GetContentFromPersistString(string persistString)
{
if (persistString == typeof(DummySolutionExplorer).ToString())
return m_solutionExplorer;
else if (persistString == typeof(DummyPropertyWindow).ToString())
return m_propertyWindow;
else if (persistString == typeof(DummyToolbox).ToString())
return m_toolbox;
else if (persistString == typeof(DummyOutputWindow).ToString())
return m_outputWindow;
else if (persistString == typeof(DummyTaskList).ToString())
return m_taskList;
else
{
string[] parsedStrings = persistString.Split(new char[] { ',' });
if (parsedStrings.Length != 3)
return null;
if (parsedStrings[0] != typeof(DummyDoc).ToString())
return null;
DummyDoc dummyDoc = new DummyDoc();
if (parsedStrings[1] != string.Empty)
dummyDoc.FileName = parsedStrings[1];
if (parsedStrings[2] != string.Empty)
dummyDoc.Text = parsedStrings[2];
return dummyDoc;
}
}
private void MainForm_Load(object sender, System.EventArgs e)
{
string configFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "DockPanel.config");
if (File.Exists(configFile))
dockPanel.LoadFromXml(configFile, m_deserializeDockContent);
}
private void MainForm_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
string configFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "DockPanel.config");
if (m_bSaveLayout)
dockPanel.SaveAsXml(configFile);
else if (File.Exists(configFile))
File.Delete(configFile);
}
private void menuItemToolBar_Click(object sender, System.EventArgs e)
{
toolBar.Visible = menuItemToolBar.Checked = !menuItemToolBar.Checked;
}
private void menuItemStatusBar_Click(object sender, System.EventArgs e)
{
statusBar.Visible = menuItemStatusBar.Checked = !menuItemStatusBar.Checked;
}
private void toolBar_ButtonClick(object sender, System.Windows.Forms.ToolStripItemClickedEventArgs e)
{
if (e.ClickedItem == toolBarButtonNew)
menuItemNew_Click(null, null);
else if (e.ClickedItem == toolBarButtonOpen)
menuItemOpen_Click(null, null);
else if (e.ClickedItem == toolBarButtonSolutionExplorer)
menuItemSolutionExplorer_Click(null, null);
else if (e.ClickedItem == toolBarButtonPropertyWindow)
menuItemPropertyWindow_Click(null, null);
else if (e.ClickedItem == toolBarButtonToolbox)
menuItemToolbox_Click(null, null);
else if (e.ClickedItem == toolBarButtonOutputWindow)
menuItemOutputWindow_Click(null, null);
else if (e.ClickedItem == toolBarButtonTaskList)
menuItemTaskList_Click(null, null);
else if (e.ClickedItem == toolBarButtonLayoutByCode)
menuItemLayoutByCode_Click(null, null);
else if (e.ClickedItem == toolBarButtonLayoutByXml)
menuItemLayoutByXml_Click(null, null);
}
private void menuItemNewWindow_Click(object sender, System.EventArgs e)
{
MainForm newWindow = new MainForm();
newWindow.Text = newWindow.Text + " - New";
newWindow.Show();
}
private void menuItemTools_Popup(object sender, System.EventArgs e)
{
menuItemLockLayout.Checked = !this.dockPanel.AllowEndUserDocking;
}
private void menuItemLockLayout_Click(object sender, System.EventArgs e)
{
dockPanel.AllowEndUserDocking = !dockPanel.AllowEndUserDocking;
}
private void menuItemLayoutByCode_Click(object sender, System.EventArgs e)
{
dockPanel.SuspendLayout(true);
m_solutionExplorer.Show(dockPanel, DockState.DockRight);
m_propertyWindow.Show(m_solutionExplorer.Pane, m_solutionExplorer);
m_toolbox.Show(dockPanel, new Rectangle(98, 133, 200, 383));
m_outputWindow.Show(m_solutionExplorer.Pane, DockAlignment.Bottom, 0.35);
m_taskList.Show(m_toolbox.Pane, DockAlignment.Left, 0.4);
CloseAllDocuments();
DummyDoc doc1 = CreateNewDocument("Document1");
DummyDoc doc2 = CreateNewDocument("Document2");
DummyDoc doc3 = CreateNewDocument("Document3");
DummyDoc doc4 = CreateNewDocument("Document4");
doc1.Show(dockPanel, DockState.Document);
doc2.Show(doc1.Pane, null);
doc3.Show(doc1.Pane, DockAlignment.Bottom, 0.5);
doc4.Show(doc3.Pane, DockAlignment.Right, 0.5);
dockPanel.ResumeLayout(true, true);
}
private void menuItemLayoutByXml_Click(object sender, System.EventArgs e)
{
dockPanel.SuspendLayout(true);
// In order to load layout from XML, we need to close all the DockContents
CloseAllContents();
Assembly assembly = Assembly.GetAssembly(typeof(MainForm));
Stream xmlStream = assembly.GetManifestResourceStream("DockSample.Resources.DockPanel.xml");
dockPanel.LoadFromXml(xmlStream, m_deserializeDockContent);
xmlStream.Close();
dockPanel.ResumeLayout(true, true);
}
private void CloseAllContents()
{
// we don't want to create another instance of tool window, set DockPanel to null
m_solutionExplorer.DockPanel = null;
m_propertyWindow.DockPanel = null;
m_toolbox.DockPanel = null;
m_outputWindow.DockPanel = null;
m_taskList.DockPanel = null;
// Close all other document windows
CloseAllDocuments();
}
private void SetSchema(object sender, System.EventArgs e)
{
CloseAllContents();
if (sender == menuItemSchemaVS2005)
Extender.SetSchema(dockPanel, Extender.Schema.VS2005);
else if (sender == menuItemSchemaVS2003)
Extender.SetSchema(dockPanel, Extender.Schema.VS2003);
menuItemSchemaVS2005.Checked = (sender == menuItemSchemaVS2005);
menuItemSchemaVS2003.Checked = (sender == menuItemSchemaVS2003);
}
private void SetDocumentStyle(object sender, System.EventArgs e)
{
DocumentStyle oldStyle = dockPanel.DocumentStyle;
DocumentStyle newStyle;
if (sender == menuItemDockingMdi)
newStyle = DocumentStyle.DockingMdi;
else if (sender == menuItemDockingWindow)
newStyle = DocumentStyle.DockingWindow;
else if (sender == menuItemDockingSdi)
newStyle = DocumentStyle.DockingSdi;
else
newStyle = DocumentStyle.SystemMdi;
if (oldStyle == newStyle)
return;
if (oldStyle == DocumentStyle.SystemMdi || newStyle == DocumentStyle.SystemMdi)
CloseAllDocuments();
dockPanel.DocumentStyle = newStyle;
menuItemDockingMdi.Checked = (newStyle == DocumentStyle.DockingMdi);
menuItemDockingWindow.Checked = (newStyle == DocumentStyle.DockingWindow);
menuItemDockingSdi.Checked = (newStyle == DocumentStyle.DockingSdi);
menuItemSystemMdi.Checked = (newStyle == DocumentStyle.SystemMdi);
menuItemLayoutByCode.Enabled = (newStyle != DocumentStyle.SystemMdi);
menuItemLayoutByXml.Enabled = (newStyle != DocumentStyle.SystemMdi);
toolBarButtonLayoutByCode.Enabled = (newStyle != DocumentStyle.SystemMdi);
toolBarButtonLayoutByXml.Enabled = (newStyle != DocumentStyle.SystemMdi);
}
private void menuItemCloseAllButThisOne_Click(object sender, System.EventArgs e)
{
if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi)
{
Form activeMdi = ActiveMdiChild;
foreach (Form form in MdiChildren)
{
if (form != activeMdi)
form.Close();
}
}
else
{
foreach (IDockContent document in dockPanel.DocumentsToArray())
{
if (!document.DockHandler.IsActivated)
document.DockHandler.Close();
}
}
}
private void menuItemShowDocumentIcon_Click(object sender, System.EventArgs e)
{
dockPanel.ShowDocumentIcon = menuItemShowDocumentIcon.Checked= !menuItemShowDocumentIcon.Checked;
}
private void showRightToLeft_Click(object sender, EventArgs e)
{
CloseAllContents();
if (showRightToLeft.Checked)
{
this.RightToLeft = RightToLeft.No;
this.RightToLeftLayout = false;
}
else
{
this.RightToLeft = RightToLeft.Yes;
this.RightToLeftLayout = true;
}
m_solutionExplorer.RightToLeftLayout = this.RightToLeftLayout;
showRightToLeft.Checked = !showRightToLeft.Checked;
}
private void exitWithoutSavingLayout_Click(object sender, EventArgs e)
{
m_bSaveLayout = false;
Close();
m_bSaveLayout = true;
}
}
}

194
src/Libraries/DockPanel_Src/DockSample/MainForm2.resx

@ -0,0 +1,194 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="mainMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>120, 12</value>
</metadata>
<metadata name="imageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>24, 9</value>
</metadata>
<data name="imageList.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADY
DAAAAk1TRnQBSQFMAgEBCQEAAQ4BAAEEAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAATADAAEBAQABCAYAAQwYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm
AZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHM
AWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEA
ATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8BMwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8BAAEz
AWYCAAEzAWYBMwEAATMCZgEAATMBZgGZAQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQABMwGZ
AWYBAAEzApkBAAEzAZkBzAEAATMBmQH/AQABMwHMAgABMwHMATMBAAEzAcwBZgEAATMBzAGZAQABMwLM
AQABMwHMAf8BAAEzAf8BMwEAATMB/wFmAQABMwH/AZkBAAEzAf8BzAEAATMC/wEAAWYDAAFmAQABMwEA
AWYBAAFmAQABZgEAAZkBAAFmAQABzAEAAWYBAAH/AQABZgEzAgABZgIzAQABZgEzAWYBAAFmATMBmQEA
AWYBMwHMAQABZgEzAf8BAAJmAgACZgEzAQADZgEAAmYBmQEAAmYBzAEAAWYBmQIAAWYBmQEzAQABZgGZ
AWYBAAFmApkBAAFmAZkBzAEAAWYBmQH/AQABZgHMAgABZgHMATMBAAFmAcwBmQEAAWYCzAEAAWYBzAH/
AQABZgH/AgABZgH/ATMBAAFmAf8BmQEAAWYB/wHMAQABzAEAAf8BAAH/AQABzAEAApkCAAGZATMBmQEA
AZkBAAGZAQABmQEAAcwBAAGZAwABmQIzAQABmQEAAWYBAAGZATMBzAEAAZkBAAH/AQABmQFmAgABmQFm
ATMBAAGZATMBZgEAAZkBZgGZAQABmQFmAcwBAAGZATMB/wEAApkBMwEAApkBZgEAA5kBAAKZAcwBAAKZ
Af8BAAGZAcwCAAGZAcwBMwEAAWYBzAFmAQABmQHMAZkBAAGZAswBAAGZAcwB/wEAAZkB/wIAAZkB/wEz
AQABmQHMAWYBAAGZAf8BmQEAAZkB/wHMAQABmQL/AQABzAMAAZkBAAEzAQABzAEAAWYBAAHMAQABmQEA
AcwBAAHMAQABmQEzAgABzAIzAQABzAEzAWYBAAHMATMBmQEAAcwBMwHMAQABzAEzAf8BAAHMAWYCAAHM
AWYBMwEAAZkCZgEAAcwBZgGZAQABzAFmAcwBAAGZAWYB/wEAAcwBmQIAAcwBmQEzAQABzAGZAWYBAAHM
ApkBAAHMAZkBzAEAAcwBmQH/AQACzAIAAswBMwEAAswBZgEAAswBmQEAA8wBAALMAf8BAAHMAf8CAAHM
Af8BMwEAAZkB/wFmAQABzAH/AZkBAAHMAf8BzAEAAcwC/wEAAcwBAAEzAQAB/wEAAWYBAAH/AQABmQEA
AcwBMwIAAf8CMwEAAf8BMwFmAQAB/wEzAZkBAAH/ATMBzAEAAf8BMwH/AQAB/wFmAgAB/wFmATMBAAHM
AmYBAAH/AWYBmQEAAf8BZgHMAQABzAFmAf8BAAH/AZkCAAH/AZkBMwEAAf8BmQFmAQAB/wKZAQAB/wGZ
AcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEz
AQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFm
AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw
AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/0IAAewMBzMAAewL/wEH
MwAB7AP/BgIC/wEHMwAB7Av/AQczAAHsA/8GAgL/AQczAAHsC/8BBzMAAewB/wEHAQAC/wIAAv8BAAIH
MwAB7AEHAQAC/wEEAQIBBAEAAv8BAAHsMwAB7AH/AQcBAAH/AQIB/gECAQAB/wEAAgczAAHsAv8BBwL/
AQIBBAT/AQczAAHsCf82AAHsCf8B7AEAAewzAAHsCf8C7DQAC+zmAAHsCwcEAAEBBwABBxcAAewK/wUA
AewK/wEHBQABAQUAAQcJAAr/BQAB7AP/AgcF/wUAAewE/wUHAf8BBwYAAQEDAAEHCgAB/wfsAv8FAAHs
A/8BAQIHBP8FAAHsCv8BBwcAAQEBAAEHCwAK/wUAAewC/wMBAgcD/wUAAewE/wUHAf8BBwgAAQcMAAH/
COwB/wUAAewB/wIBAf8CAQEHA/8FAAHsAv8BAgf/AQcHAAEHAQABAQsACv8FAAHsBf8BAQHsAQcC/wUA
AewB/wICAf8BAgQHAf8BBwYAAQcDAAEBBAABAwUAAf8HAAL/BQAB7Ab/AQECBwH/BQAB7AL/AwIF/wEH
CwABAQMAAgMEAAr/BQAB7Af/AQEBBwH/BQAB7AH/AgIB/wICBP8BBw0AAgMGAAH/COwB/wUAAewI/wEB
Af8FAAHsAv8DAgT/AgcMAAMDBgAK/wUAAewK/wUAAewC/wECAf8CAgL/DwADAwUADAQEAAHsAv8GAAL/
BQAB7AT/AQID/wHsAQAB7AoAAgMIAAwEBQAC7AEAAf8DBwEAAuwFAAHsCP8C7CkABOwIAArsqgABBAQA
AQM5AAEEAfwC+QEAAQMC+wQACv8IAAn/BgAJAwkAAewB/AEAA/kBAAL7AQAB+gIAAf8CAAH/BQAB/wgA
Cf8FAAH7AQAJAwUABP8BAAL/A/kCAAH/AfoCAAr/CAAJ/wUAAf8B+wEACQMEAAT/AfoBAAH/AQcD+QEA
Av8CAAH/AgAB/wUAAf8IAAn/BQAB+wH/AfsBAAkDAwAE/wL6Af8B+wEHA/kBAAH8AgAK/wgACf8FAAH/
AfsB/wH7DAAF/wH6Af8B+wEHAf8C+QEAAfwCAAL/AgAD/wEAAv8IAAn/BQAB+wH/AfsB/wH7Af8B+wH/
AfsHAAb/AgMD/wEBBAAC/wMAAf8DAAH/BAABBAMACf8FAAH/AfsB/wH7Af8B+wH/AfsB/wcADP8BBwMA
A/8KAAIEAwAJ/wUAAfsB/wH7DQAM/wEHEAACBAMABv8YAAz/AQcQAAIEAwAG/wEAAf8WAAz/AQcQAAIE
AwAG/xgADQQQAAIEIQANBBAAAgRAAAFCAU0BPgcAAT4DAAEoAwABQAMAATADAAEBAQABAQUAAYABARYA
A/8BAAGAAQEGAAGAAQEGAAGAAQEGAAGAAQEGAAGAAQEGAAGAAQEGAAGAAQEGAAGAAQEGAAGAAQEGAAGA
AQEGAAGAAQEGAAGAAQEGAAGAAQsGAAGAAQcGAAGAAQ8GAAL/BgAG/wHAAQEBnwHPAv8B4AEHAcABAQKP
AcABAwHAAQMBwAEBAccBHwHAAQMBwAEDAcABAQHiAT8BwAEDAcABAwHAAQEB8AF/AcABAwHAAQMBwAEB
AfgB/wHAAQMBwAEDAcABAQHwAXsBwAEDAcABAwHAAQEBAgExAcABAwHAAQMBwAEBAQcBAAHAAQMBwAED
AcABAQFnAYEBwAEDAcABAwHAAQEB5wGDAcABAwHAAQMBwAEBAccBAwHAAQMBwAEDAcABCwH8AQcBwAED
AeABBwHAAQcB/gEfAv8B/AE/AcABDxT/AfwBYwEAAQ8BwAEHAQABHwH4AQEBAAEPAcABBwEAAQ8BgAIA
AQ8BwAEHAQABBwGAAgABDwHAAQcBAAEDAYACAAEPAcABBwEAAQEBgAIAAQ8BwAEHAgABgAEBAQABDwHA
AQcBAAEfAYABAwEIAY4BwAEHAQABHwGAAQMBBQFEAcABBwEAAR8BgAEDAQIBuAHAAQcBjwHxAYABAwH9
AXwBwAEPAf8B+QGAAQMB/gH8AcABHwH/AXUBgAEDAf8BAAHAAT8B/wGPAYABAwH/AfwI/ws=
</value>
</data>
<metadata name="toolBar.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>226, 12</value>
</metadata>
<metadata name="statusBar.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>310, 13</value>
</metadata>
</root>

22
src/Libraries/DockPanel_Src/WinFormsUI.sln → src/Libraries/DockPanel_Src/WinFormsUI.Docking.sln

@ -1,8 +1,8 @@
Microsoft Visual Studio Solution File, Format Version 9.00 Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005 # Visual C# Express 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFormsUI", "WinFormsUI\WinFormsUI.csproj", "{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFormsUI", "WinFormsUI\WinFormsUI.csproj", "{C75532C4-765B-418E-B09B-46D36B2ABDB1}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DockSample", "DockSample\DockSample.csproj", "{0A386EC6-40E1-4C5A-BA6B-B483FE89E8E7}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DockSample", "DockSample\DockSample.csproj", "{40793A27-478B-4357-B4C3-FC8943131F3D}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -10,14 +10,14 @@ Global
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Debug|Any CPU.Build.0 = Debug|Any CPU {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Release|Any CPU.ActiveCfg = Release|Any CPU {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Release|Any CPU.Build.0 = Release|Any CPU {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Release|Any CPU.Build.0 = Release|Any CPU
{0A386EC6-40E1-4C5A-BA6B-B483FE89E8E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {40793A27-478B-4357-B4C3-FC8943131F3D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0A386EC6-40E1-4C5A-BA6B-B483FE89E8E7}.Debug|Any CPU.Build.0 = Debug|Any CPU {40793A27-478B-4357-B4C3-FC8943131F3D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0A386EC6-40E1-4C5A-BA6B-B483FE89E8E7}.Release|Any CPU.ActiveCfg = Release|Any CPU {40793A27-478B-4357-B4C3-FC8943131F3D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0A386EC6-40E1-4C5A-BA6B-B483FE89E8E7}.Release|Any CPU.Build.0 = Release|Any CPU {40793A27-478B-4357-B4C3-FC8943131F3D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

42
src/Libraries/DockPanel_Src/WinFormsUI.ndoc

@ -1,42 +0,0 @@
<project SchemaVersion="1.3">
<assemblies>
<assembly location=".\WinFormsUI\bin\NDoc\WeifenLuo.WinFormsUI.Docking.dll" documentation=".\WinFormsUI\bin\NDoc\CodeDoc.xml" />
</assemblies>
<documenters>
<documenter name="JavaDoc">
<property name="OutputDirectory" value=".\doc\" />
</documenter>
<documenter name="LaTeX">
<property name="OutputDirectory" value=".\doc\" />
<property name="TextFileFullName" value="Documentation.tex" />
<property name="TexFileBaseName" value="Documentation" />
<property name="LatexCompiler" value="latex" />
<property name="TexFileFullPath" value=".\doc\Documentation.tex" />
</documenter>
<documenter name="LinearHtml">
<property name="OutputDirectory" value=".\doc\" />
<property name="Title" value="An NDoc Documented Class Library" />
</documenter>
<documenter name="MSDN">
<property name="OutputDirectory" value="..\doc\" />
<property name="HtmlHelpName" value="DockPanel" />
<property name="Title" value="DockPanel Class Library (Ver 1.0)" />
<property name="OutputTarget" value="HtmlHelp" />
<property name="CopyrightText" value="Copyright Weifen Luo, All Rights Reserved." />
<property name="FeedbackEmailAddress" value="weifenluo@yahoo.com" />
<property name="CleanIntermediates" value="True" />
</documenter>
<documenter name="MSDN 2003">
<property name="OutputDirectory" value=".\doc\" />
<property name="Title" value="An NDoc Documented Class Library" />
</documenter>
<documenter name="VS.NET 2003">
<property name="OutputDirectory" value=".\doc\" />
<property name="HtmlHelpName" value="Documentation" />
<property name="Title" value="An NDoc documented library" />
</documenter>
<documenter name="XML">
<property name="OutputFile" value=".\doc\doc.xml" />
</documenter>
</documenters>
</project>

BIN
src/Libraries/DockPanel_Src/WinFormsUI.suo

Binary file not shown.

4
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockContentHandler.cs

@ -357,7 +357,11 @@ namespace WeifenLuo.WinFormsUI.Docking
dockState = DockState.Float; dockState = DockState.Float;
} }
else else
{
dockState = (PanelPane != null) ? PanelPane.DockState : DefaultDockState; dockState = (PanelPane != null) ? PanelPane.DockState : DefaultDockState;
if (dockState != DockState.Unknown && !IsDockStateValid(dockState))
dockState = DockState.Unknown;
}
return dockState; return dockState;
} }

12
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.AutoHideWindow.cs

@ -410,6 +410,9 @@ namespace WeifenLuo.WinFormsUI.Docking
private void TimerMouseTrack_Tick(object sender, EventArgs e) private void TimerMouseTrack_Tick(object sender, EventArgs e)
{ {
if (IsDisposed)
return;
if (ActivePane == null || ActivePane.IsActivated) if (ActivePane == null || ActivePane.IsActivated)
{ {
m_timerMouseTrack.Enabled = false; m_timerMouseTrack.Enabled = false;
@ -593,10 +596,11 @@ namespace WeifenLuo.WinFormsUI.Docking
internal Rectangle GetAutoHideWindowBounds(Rectangle rectAutoHideWindow) internal Rectangle GetAutoHideWindowBounds(Rectangle rectAutoHideWindow)
{ {
if (Parent == null) if (DocumentStyle == DocumentStyle.SystemMdi ||
return Rectangle.Empty; DocumentStyle == DocumentStyle.DockingMdi)
return (Parent == null) ? Rectangle.Empty : Parent.RectangleToClient(RectangleToScreen(rectAutoHideWindow));
return Parent.RectangleToClient(RectangleToScreen(rectAutoHideWindow)); else
return rectAutoHideWindow;
} }
internal void RefreshAutoHideStrip() internal void RefreshAutoHideStrip()

29
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.DockDragHandler.cs

@ -117,7 +117,7 @@ namespace WeifenLuo.WinFormsUI.Docking
public DockStyle HitTest(Point pt) public DockStyle HitTest(Point pt)
{ {
return ClientRectangle.Contains(PointToClient(pt)) ? DockStyle : DockStyle.None; return this.Visible && ClientRectangle.Contains(PointToClient(pt)) ? DockStyle : DockStyle.None;
} }
} }
#endregion PanelIndicator #endregion PanelIndicator
@ -480,8 +480,8 @@ namespace WeifenLuo.WinFormsUI.Docking
public override void Show(bool bActivate) public override void Show(bool bActivate)
{ {
Bounds = GetAllScreenBounds();
base.Show(bActivate); base.Show(bActivate);
Bounds = SystemInformation.VirtualScreen;
RefreshChanges(); RefreshChanges();
} }
@ -518,31 +518,6 @@ namespace WeifenLuo.WinFormsUI.Docking
{ {
return hitTest.Status = hitTest.HitTest(pt); return hitTest.Status = hitTest.HitTest(pt);
} }
private static Rectangle GetAllScreenBounds()
{
Rectangle rect = new Rectangle(0, 0, 0, 0);
foreach (Screen screen in Screen.AllScreens)
{
Rectangle rectScreen = screen.Bounds;
if (rectScreen.Left < rect.Left)
{
rect.Width += (rect.Left - rectScreen.Left);
rect.X = rectScreen.X;
}
if (rectScreen.Right > rect.Right)
rect.Width += (rectScreen.Right - rect.Right);
if (rectScreen.Top < rect.Top)
{
rect.Height += (rect.Top - rectScreen.Top);
rect.Y = rectScreen.Y;
}
if (rectScreen.Bottom > rect.Bottom)
rect.Height += (rectScreen.Bottom - rect.Bottom);
}
return rect;
}
} }
private class DockOutline : DockOutlineBase private class DockOutline : DockOutlineBase

6
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.FocusManager.cs

@ -169,7 +169,11 @@ namespace WeifenLuo.WinFormsUI.Docking
if (content.IsDisposed) if (content.IsDisposed)
return; return;
if (content == null)
return;
DockContentHandler handler = content.DockHandler; DockContentHandler handler = content.DockHandler;
if (handler.Form.IsDisposed)
return; // Should not reach here, but better than throwing an exception
if (ContentContains(content, handler.ActiveWindowHandle)) if (ContentContains(content, handler.ActiveWindowHandle))
NativeMethods.SetFocus(handler.ActiveWindowHandle); NativeMethods.SetFocus(handler.ActiveWindowHandle);
if (!handler.Form.ContainsFocus) if (!handler.Form.ContainsFocus)
@ -441,7 +445,7 @@ namespace WeifenLuo.WinFormsUI.Docking
if (ActivePane != null && ActivePane.DockState == DockState.Document) if (ActivePane != null && ActivePane.DockState == DockState.Document)
value = ActivePane; value = ActivePane;
if (value == null) if (value == null && DockPanel.DockWindows != null)
{ {
if (ActiveDocumentPane == null) if (ActiveDocumentPane == null)
value = DockPanel.DockWindows[DockState.Document].DefaultPane; value = DockPanel.DockWindows[DockState.Document].DefaultPane;

2
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.Persistor.cs

@ -362,7 +362,7 @@ namespace WeifenLuo.WinFormsUI.Docking
public static void LoadFromXml(DockPanel dockPanel, string fileName, DeserializeDockContent deserializeContent) public static void LoadFromXml(DockPanel dockPanel, string fileName, DeserializeDockContent deserializeContent)
{ {
FileStream fs = new FileStream(fileName, FileMode.Open); FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);
try try
{ {
LoadFromXml(dockPanel, fs, deserializeContent); LoadFromXml(dockPanel, fs, deserializeContent);

0
src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockPanel.bmp → src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.bmp

Before

Width:  |  Height:  |  Size: 822 B

After

Width:  |  Height:  |  Size: 822 B

50
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.cs

@ -9,13 +9,25 @@ using System.Text;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Collections.Generic; using System.Collections.Generic;
// To simplify the process of finding the toolbox bitmap resource:
// #1 Create an internal class called "resfinder" outside of the root namespace.
// #2 Use "resfinder" in the toolbox bitmap attribute instead of the control name.
// #3 use the "<default namespace>.<resourcename>" string to locate the resource.
// See: http://www.bobpowell.net/toolboxbitmap.htm
internal class resfinder
{
}
namespace WeifenLuo.WinFormsUI.Docking namespace WeifenLuo.WinFormsUI.Docking
{ {
[SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters", MessageId = "0#")] [SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters", MessageId = "0#")]
public delegate IDockContent DeserializeDockContent(string persistString); public delegate IDockContent DeserializeDockContent(string persistString);
[Designer(typeof(System.Windows.Forms.Design.ControlDesigner))] [LocalizedDescription("DockPanel_Description")]
[ToolboxBitmap(typeof(DockPanel), "Resources.DockPanel.bmp")] [Designer(typeof(System.Windows.Forms.Design.ControlDesigner))]
[ToolboxBitmap(typeof(resfinder), "WeifenLuo.WinFormsUI.Docking.DockPanel.bmp")]
[DefaultProperty("DocumentStyle")]
[DefaultEvent("ActiveContentChanged")]
public partial class DockPanel : Panel public partial class DockPanel : Panel
{ {
private FocusManagerImpl m_focusManager; private FocusManagerImpl m_focusManager;
@ -35,10 +47,10 @@ namespace WeifenLuo.WinFormsUI.Docking
m_floatWindows = new FloatWindowCollection(); m_floatWindows = new FloatWindowCollection();
SuspendLayout(); SuspendLayout();
Font = SystemInformation.MenuFont;
m_autoHideWindow = new AutoHideWindowControl(this); m_autoHideWindow = new AutoHideWindowControl(this);
m_autoHideWindow.Visible = false; m_autoHideWindow.Visible = false;
SetAutoHideWindowParent();
m_dummyControl = new DummyControl(); m_dummyControl = new DummyControl();
m_dummyControl.Bounds = new Rectangle(0, 0, 1, 1); m_dummyControl.Bounds = new Rectangle(0, 0, 1, 1);
@ -70,6 +82,13 @@ namespace WeifenLuo.WinFormsUI.Docking
return m_autoHideStripControl; return m_autoHideStripControl;
} }
} }
internal void ResetAutoHideStripControl()
{
if (m_autoHideStripControl != null)
m_autoHideStripControl.Dispose();
m_autoHideStripControl = null;
}
private void MdiClientHandleAssigned(object sender, EventArgs e) private void MdiClientHandleAssigned(object sender, EventArgs e)
{ {
@ -497,6 +516,7 @@ namespace WeifenLuo.WinFormsUI.Docking
SuspendLayout(true); SuspendLayout(true);
SetAutoHideWindowParent();
SetMdiClient(); SetMdiClient();
InvalidateWindowRegion(); InvalidateWindowRegion();
@ -738,12 +758,26 @@ namespace WeifenLuo.WinFormsUI.Docking
protected override void OnParentChanged(EventArgs e) protected override void OnParentChanged(EventArgs e)
{ {
AutoHideWindow.Parent = this.Parent; SetAutoHideWindowParent();
GetMdiClientController().ParentForm = (this.Parent as Form); GetMdiClientController().ParentForm = (this.Parent as Form);
AutoHideWindow.BringToFront();
base.OnParentChanged (e); base.OnParentChanged (e);
} }
private void SetAutoHideWindowParent()
{
Control parent;
if (DocumentStyle == DocumentStyle.DockingMdi ||
DocumentStyle == DocumentStyle.SystemMdi)
parent = this.Parent;
else
parent = this;
if (AutoHideWindow.Parent != parent)
{
AutoHideWindow.Parent = parent;
AutoHideWindow.BringToFront();
}
}
protected override void OnVisibleChanged(EventArgs e) protected override void OnVisibleChanged(EventArgs e)
{ {
base.OnVisibleChanged (e); base.OnVisibleChanged (e);
@ -835,7 +869,7 @@ namespace WeifenLuo.WinFormsUI.Docking
int count = 0; int count = 0;
foreach (DockPane pane in this.Panes) foreach (DockPane pane in this.Panes)
{ {
if (pane.DockState != DockState.Document) if (!pane.Visible || pane.DockState != DockState.Document)
continue; continue;
count ++; count ++;
@ -851,7 +885,7 @@ namespace WeifenLuo.WinFormsUI.Docking
int i = 0; int i = 0;
foreach (DockPane pane in this.Panes) foreach (DockPane pane in this.Panes)
{ {
if (pane.DockState != DockState.Document) if (!pane.Visible || pane.DockState != DockState.Document)
continue; continue;
rects[i] = RectangleToClient(pane.RectangleToScreen(pane.ContentRectangle)); rects[i] = RectangleToClient(pane.RectangleToScreen(pane.ContentRectangle));

1
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanelExtender.cs

@ -218,6 +218,7 @@ namespace WeifenLuo.WinFormsUI.Docking
return; return;
m_autoHideStripFactory = value; m_autoHideStripFactory = value;
DockPanel.ResetAutoHideStripControl();
} }
} }
} }

2
src/Libraries/DockPanel_Src/WinFormsUI/Docking/FloatWindow.cs

@ -144,7 +144,7 @@ namespace WeifenLuo.WinFormsUI.Docking
protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified) protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
{ {
Rectangle rectWorkArea = SystemInformation.WorkingArea; Rectangle rectWorkArea = SystemInformation.VirtualScreen;
if (y + height > rectWorkArea.Bottom) if (y + height > rectWorkArea.Bottom)
y -= (y + height) - rectWorkArea.Bottom; y -= (y + height) - rectWorkArea.Bottom;

7
src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources.Designer.cs generated

@ -220,12 +220,5 @@ namespace WeifenLuo.WinFormsUI.Docking {
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
internal static System.Drawing.Bitmap DockPanel {
get {
object obj = ResourceManager.GetObject("DockPanel", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
} }
} }

3
src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources.resx

@ -187,7 +187,4 @@
<data name="DockPane_OptionOverflow" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="DockPane_OptionOverflow" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\DockPane_OptionOverflow.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>Resources\DockPane_OptionOverflow.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="DockPanel" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\DockPanel.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>

BIN
src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/Thumbs.db

Binary file not shown.

9
src/Libraries/DockPanel_Src/WinFormsUI/Docking/Strings.Designer.cs generated

@ -546,6 +546,15 @@ namespace WeifenLuo.WinFormsUI.Docking {
} }
} }
/// <summary>
/// Looks up a localized string similar to Provides Visual Studio .Net style docking..
/// </summary>
internal static string DockPanel_Description {
get {
return ResourceManager.GetString("DockPanel_Description", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Size of the bottom docking window. Value &lt; 1 to specify the size in portion; value &gt; 1 to specify the size in pixels.. /// Looks up a localized string similar to Size of the bottom docking window. Value &lt; 1 to specify the size in portion; value &gt; 1 to specify the size in pixels..
/// </summary> /// </summary>

3
src/Libraries/DockPanel_Src/WinFormsUI/Docking/Strings.resx

@ -279,6 +279,9 @@
<data name="DockPanel_DefaultFloatWindowSize_Description" xml:space="preserve"> <data name="DockPanel_DefaultFloatWindowSize_Description" xml:space="preserve">
<value>The default size of float window.</value> <value>The default size of float window.</value>
</data> </data>
<data name="DockPanel_Description" xml:space="preserve">
<value>Provides Visual Studio .Net style docking.</value>
</data>
<data name="DockPanel_DockBottomPortion_Description" xml:space="preserve"> <data name="DockPanel_DockBottomPortion_Description" xml:space="preserve">
<value>Size of the bottom docking window. Value &lt; 1 to specify the size in portion; value &gt; 1 to specify the size in pixels.</value> <value>Size of the bottom docking window. Value &lt; 1 to specify the size in portion; value &gt; 1 to specify the size in pixels.</value>
</data> </data>

2
src/Libraries/DockPanel_Src/WinFormsUI/Docking/VS2005DockPaneCaption.cs

@ -351,7 +351,7 @@ namespace WeifenLuo.WinFormsUI.Docking
private void DrawCaption(Graphics g) private void DrawCaption(Graphics g)
{ {
if (ClientRectangle.IsEmpty) if (ClientRectangle.Width == 0 || ClientRectangle.Height == 0)
return; return;
if (DockPane.IsActivated) if (DockPane.IsActivated)

6
src/Libraries/DockPanel_Src/WinFormsUI/Properties/AssemblyInfo.cs

@ -18,11 +18,11 @@ using System.Diagnostics.CodeAnalysis;
[assembly: Guid("9d690ef9-ce19-4c69-874c-e24d8eb36aff")] [assembly: Guid("9d690ef9-ce19-4c69-874c-e24d8eb36aff")]
[assembly: AssemblyVersion("2.1.0.1")] [assembly: AssemblyVersion("2.2.*")]
[assembly: AssemblyFileVersion("2.1.0.1")] [assembly: AssemblyFileVersion("2.2.0.0")]
[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "namespace", Target = "WeifenLuo.WinFormsUI.Docking", MessageId = "Weifen")] [module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "namespace", Target = "WeifenLuo.WinFormsUI.Docking", MessageId = "Weifen")]
[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "namespace", Target = "WeifenLuo.WinFormsUI.Docking", MessageId = "Luo")] [module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "namespace", Target = "WeifenLuo.WinFormsUI.Docking", MessageId = "Luo")]
[module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "WeifenLuo.WinFormsUI.Docking.Strings.resources", MessageId = "Weifen")] [module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "WeifenLuo.WinFormsUI.Docking.Strings.resources", MessageId = "Weifen")]
[module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "WeifenLuo.WinFormsUI.Docking.Strings.resources", MessageId = "Luo")] [module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "WeifenLuo.WinFormsUI.Docking.Strings.resources", MessageId = "Luo")]
[module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "WeifenLuo.WinFormsUI.Docking.Strings.resources", MessageId = "Dockable")] [module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "WeifenLuo.WinFormsUI.Docking.Strings.resources", MessageId = "Dockable")]

18
src/Libraries/DockPanel_Src/WinFormsUI/WinFormsUI.csproj

@ -20,7 +20,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>Full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<DefineConstants>TRACE;DEBUG</DefineConstants> <DefineConstants>TRACE;DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
@ -33,16 +33,6 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
<BaseAddress>4194304</BaseAddress>
<PlatformTarget>AnyCPU</PlatformTarget>
<FileAlignment>4096</FileAlignment>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
@ -192,7 +182,6 @@
<None Include="Docking\Resources\DockIndicator_PanelRight_Active.bmp" /> <None Include="Docking\Resources\DockIndicator_PanelRight_Active.bmp" />
<None Include="Docking\Resources\DockIndicator_PanelTop.bmp" /> <None Include="Docking\Resources\DockIndicator_PanelTop.bmp" />
<None Include="Docking\Resources\DockIndicator_PanelTop_Active.bmp" /> <None Include="Docking\Resources\DockIndicator_PanelTop_Active.bmp" />
<None Include="Docking\Resources\DockPanel.bmp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="license.txt"> <None Include="license.txt">
@ -206,6 +195,9 @@
<None Include="Docking\Resources\DockPane_Option.bmp" /> <None Include="Docking\Resources\DockPane_Option.bmp" />
<None Include="Docking\Resources\DockPane_OptionOverflow.bmp" /> <None Include="Docking\Resources\DockPane_OptionOverflow.bmp" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Docking\DockPanel.bmp" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
@ -214,4 +206,4 @@
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>

Loading…
Cancel
Save