Browse Source

Upgrade to DockPanel Suite 1.0.0.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1145 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
6e1d43f2d7
  1. 219
      data/resources/layouts/Debug.xml
  2. 229
      data/resources/layouts/Default.xml
  3. 227
      data/resources/layouts/Plain.xml
  4. 5
      src/Libraries/DockPanel_Src/DockSample/AboutDialog.cs
  5. 2
      src/Libraries/DockPanel_Src/DockSample/AssemblyInfo.cs
  6. 60
      src/Libraries/DockPanel_Src/DockSample/DockSample.csproj
  7. 23
      src/Libraries/DockPanel_Src/DockSample/DockSample.csproj.user
  8. 139
      src/Libraries/DockPanel_Src/DockSample/DummyDoc.cs
  9. 27
      src/Libraries/DockPanel_Src/DockSample/DummyDoc.resx
  10. 1
      src/Libraries/DockPanel_Src/DockSample/DummyOutputWindow.cs
  11. 1
      src/Libraries/DockPanel_Src/DockSample/DummyPropertyWindow.cs
  12. 4
      src/Libraries/DockPanel_Src/DockSample/DummySolutionExplorer.cs
  13. 1
      src/Libraries/DockPanel_Src/DockSample/DummyTaskList.cs
  14. 3
      src/Libraries/DockPanel_Src/DockSample/DummyToolbox.cs
  15. 20
      src/Libraries/DockPanel_Src/DockSample/DummyToolbox.resx
  16. 109
      src/Libraries/DockPanel_Src/DockSample/Extender/Extender.cs
  17. 465
      src/Libraries/DockPanel_Src/DockSample/Extender/FromBase/AutoHideStripFromBase.cs
  18. 37
      src/Libraries/DockPanel_Src/DockSample/Extender/FromBase/AutoHideTabFromBase.cs
  19. 338
      src/Libraries/DockPanel_Src/DockSample/Extender/FromBase/DockPaneCaptionFromBase.cs
  20. 977
      src/Libraries/DockPanel_Src/DockSample/Extender/FromBase/DockPaneStripFromBase.cs
  21. 50
      src/Libraries/DockPanel_Src/DockSample/Extender/FromBase/DockPaneTabFromBase.cs
  22. 121
      src/Libraries/DockPanel_Src/DockSample/Extender/FromBase/Helpers/DockHelper.cs
  23. 41
      src/Libraries/DockPanel_Src/DockSample/Extender/FromBase/Helpers/ResourceHelper.cs
  24. 701
      src/Libraries/DockPanel_Src/DockSample/Extender/FromBase/Win32/Enums.cs
  25. 52
      src/Libraries/DockPanel_Src/DockSample/Extender/FromBase/Win32/Gdi32.cs
  26. 135
      src/Libraries/DockPanel_Src/DockSample/Extender/FromBase/Win32/Structs.cs
  27. 134
      src/Libraries/DockPanel_Src/DockSample/Extender/FromBase/Win32/User32.cs
  28. 15
      src/Libraries/DockPanel_Src/DockSample/Extender/Override/AutoHideStripOverride.cs
  29. 15
      src/Libraries/DockPanel_Src/DockSample/Extender/Override/DockPaneStripOverride.cs
  30. BIN
      src/Libraries/DockPanel_Src/DockSample/Images/File.ico
  31. 734
      src/Libraries/DockPanel_Src/DockSample/MainForm.cs
  32. 46
      src/Libraries/DockPanel_Src/DockSample/MainForm.resx
  33. 35
      src/Libraries/DockPanel_Src/DockSample/Options.cs
  34. 161
      src/Libraries/DockPanel_Src/DockSample/OptionsDialog.cs
  35. 193
      src/Libraries/DockPanel_Src/DockSample/OptionsDialog.resx
  36. BIN
      src/Libraries/DockPanel_Src/DockSample/Resources/DockPanel.xml
  37. 9
      src/Libraries/DockPanel_Src/WinFormsUI.ndoc
  38. 2
      src/Libraries/DockPanel_Src/WinFormsUI/AssemblyInfo.cs
  39. 2466
      src/Libraries/DockPanel_Src/WinFormsUI/CodeDoc/CodeDoc.xml
  40. 73
      src/Libraries/DockPanel_Src/WinFormsUI/Components/DragForm.cs
  41. 556
      src/Libraries/DockPanel_Src/WinFormsUI/Components/MdiClientController.cs
  42. 16
      src/Libraries/DockPanel_Src/WinFormsUI/Controls/CodeDoc/InertButton.xml
  43. 171
      src/Libraries/DockPanel_Src/WinFormsUI/Controls/InertButton.cs
  44. 16
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/AutoHidePane.cs
  45. 29
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/AutoHideStripBase.cs
  46. 21
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/AutoHideStripVS2003.cs
  47. 24
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/AutoHideTab.cs
  48. 12
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/AutoHideTabCollection.cs
  49. 2
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/AutoHideTabVS2003.cs
  50. 72
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/AutoHideWindow.cs
  51. 2
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/AutoHideWindowSplitter.cs
  52. 2
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/AutoHideStripVS2003.xml
  53. 12
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/AutoHideTab.xml
  54. 12
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/AutoHideTabCollection.xml
  55. 164
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/DockContent.xml
  56. 16
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/DockContentCollection.xml
  57. 247
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/DockContentHandler.xml
  58. 94
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/DockPane.xml
  59. 4
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/DockPaneStripBase.xml
  60. 15
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/DockPaneStripVS2003.xml
  61. 12
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/DockPaneTab.xml
  62. 12
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/DockPaneTabCollection.xml
  63. 94
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/DockPanel.xml
  64. 24
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/DockPanelExtender.xml
  65. 18
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/Enums.xml
  66. 8
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/EventArgs.xml
  67. 11
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/Interfaces.xml
  68. 16
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DisplayingDockList.cs
  69. 2
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockAreasEditor.cs
  70. 739
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockContent.cs
  71. 48
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockContentCollection.cs
  72. 919
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockContentHandler.cs
  73. 30
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockHelper.cs
  74. 595
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockIndicator.cs
  75. 157
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockOutline.cs
  76. 166
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockOutlineBase.cs
  77. 428
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPane.cs
  78. 29
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneCaptionBase.cs
  79. 24
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneCaptionVS2003.cs
  80. 64
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneStripBase.cs
  81. 196
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneStripVS2003.cs
  82. 8
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneTab.cs
  83. 12
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneTabCollection.cs
  84. 2
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneTabVS2003.cs
  85. 583
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.cs
  86. 42
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.resx
  87. 36
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanelExtender.cs
  88. 154
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanelPersist.cs
  89. 40
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockWindow.cs
  90. 42
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockWindow.resx
  91. 2
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockWindowSplitter.cs
  92. 742
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DragHandler.cs
  93. 31
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DragHandlerBase.cs
  94. 13
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/Enums.cs
  95. 8
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/EventArgs.cs
  96. 65
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/FloatWindow.cs
  97. 87
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/HiddenMdiChild.cs
  98. 7
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/Interfaces.cs
  99. 13
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/Measures.cs
  100. 54
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/SplitterOutline.cs
  101. Some files were not shown because too many files have changed in this diff Show More

219
data/resources/layouts/Debug.xml

@ -1,169 +1,140 @@ @@ -1,169 +1,140 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- DockPanel configuration file. Author: Weifen Luo, all rights reserved. -->
<!-- !!! AUTOMATICALLY GENERATED FILE. DO NOT MODIFY !!! -->
<DockPanel FormatVersion="0.9.3" DockLeftPortion="0.162210282258557" DockRightPortion="0.159760856281619" DockTopPortion="0.25" DockBottomPortion="0.271028728576449" ActiveDocumentPane="-1" ActivePane="5">
<Contents Count="27">
<DockPanel FormatVersion="1.0" DockLeftPortion="0.196180555555556" DockRightPortion="0.172743055555556" DockTopPortion="0.25" DockBottomPortion="0.25" ActiveDocumentPane="-1" ActivePane="0">
<Contents Count="28">
<Content ID="0" PersistString="ICSharpCode.SharpDevelop.Project.ProjectBrowserPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="1" PersistString="ICSharpCode.SharpDevelop.Gui.SideBarView" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="2" PersistString="ICSharpCode.SharpDevelop.Gui.TaskListPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="3" PersistString="ICSharpCode.SharpDevelop.Gui.CompilerMessageView" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="4" PersistString="ICSharpCode.SharpDevelop.Gui.PropertyPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="5" PersistString="ICSharpCode.SharpDevelop.Gui.FileScout" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="6" PersistString="ICSharpCode.SharpDevelop.Gui.ErrorListPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="7" PersistString="SearchAndReplace.SearchResultPanel" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="8" PersistString="ICSharpCode.SharpDevelop.Gui.ClassBrowser" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="9" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.BreakPointsPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="10" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.CallStackPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="11" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.LoadedModulesPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="12" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.RunningThreadsPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="13" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.LocalVarPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="14" PersistString="ICSharpCode.SharpDevelop.Bookmarks.BookmarkPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="15" PersistString="ICSharpCode.SharpDevelop.Gui.DefinitionViewPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="16" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.ExceptionHistoryPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="17" PersistString="HtmlHelp2.HtmlHelp2TocPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="18" PersistString="HtmlHelp2.HtmlHelp2IndexPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="19" PersistString="HtmlHelp2.HtmlHelp2SearchPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="20" PersistString="HtmlHelp2.HtmlHelp2IndexResultsPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="21" PersistString="ICSharpCode.NAntAddIn.Gui.NAntPadContent" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="22" PersistString="HtmlHelp2.HtmlHelp2DynamicHelpPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="23" PersistString="SharpQuery.Pads.SharpQueryPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="24" PersistString="SharpReportAddin.FieldsExplorer" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="25" PersistString="ICSharpCode.CodeCoverage.CodeCoveragePad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="26" PersistString="ICSharpCode.UnitTesting.PadContent" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="1" PersistString="ICSharpCode.SharpDevelop.Gui.ClassBrowser" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="2" PersistString="ICSharpCode.SharpDevelop.Gui.SideBarView" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="3" PersistString="ICSharpCode.SharpDevelop.Gui.ErrorListPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="4" PersistString="ICSharpCode.SharpDevelop.Gui.TaskListPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="5" PersistString="ICSharpCode.SharpDevelop.Gui.CompilerMessageView" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="6" PersistString="ICSharpCode.SharpDevelop.Gui.PropertyPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="7" PersistString="ICSharpCode.SharpDevelop.Gui.FileScout" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="8" PersistString="SearchAndReplace.SearchResultPanel" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="9" PersistString="ICSharpCode.SharpDevelop.Bookmarks.BookmarkPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="10" PersistString="ICSharpCode.CodeCoverage.CodeCoveragePad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="11" PersistString="ICSharpCode.SharpDevelop.Gui.DefinitionViewPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="12" PersistString="Boo.InterpreterAddIn.InterpreterPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="13" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.BreakPointsPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="14" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.CallStackPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="15" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.LoadedModulesPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="16" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.RunningThreadsPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="17" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.LocalVarPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="18" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.ExceptionHistoryPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="19" PersistString="HtmlHelp2.HtmlHelp2TocPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="20" PersistString="HtmlHelp2.HtmlHelp2IndexPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="21" PersistString="HtmlHelp2.HtmlHelp2SearchPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="22" PersistString="HtmlHelp2.HtmlHelp2IndexResultsPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="23" PersistString="HtmlHelp2.HtmlHelp2DynamicHelpPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="24" PersistString="ICSharpCode.NAntAddIn.Gui.NAntPadContent" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="25" PersistString="SharpQuery.Pads.SharpQueryPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="26" PersistString="SharpReportAddin.FieldsExplorer" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="27" PersistString="ICSharpCode.UnitTesting.PadContent" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
</Contents>
<Panes Count="11">
<Pane ID="0" DockState="DockRight" ActiveContent="12">
<Contents Count="14">
<Content ID="0" RefID="8" />
<Content ID="1" RefID="12" />
<Content ID="2" RefID="9" />
<Content ID="3" RefID="14" />
<Content ID="4" RefID="15" />
<Content ID="5" RefID="17" />
<Content ID="6" RefID="18" />
<Content ID="7" RefID="19" />
<Content ID="8" RefID="20" />
<Content ID="9" RefID="21" />
<Content ID="10" RefID="22" />
<Content ID="11" RefID="23" />
<Content ID="12" RefID="24" />
<Content ID="13" RefID="26" />
<Panes Count="7">
<Pane ID="0" DockState="DockLeft" ActiveContent="0">
<Contents Count="4">
<Content ID="0" RefID="0" />
<Content ID="1" RefID="7" />
<Content ID="2" RefID="2" />
<Content ID="3" RefID="1" />
</Contents>
</Pane>
<Pane ID="1" DockState="Float" ActiveContent="-1">
<Contents Count="1">
<Content ID="0" RefID="4" />
<Contents Count="2">
<Content ID="0" RefID="8" />
<Content ID="1" RefID="9" />
</Contents>
</Pane>
<Pane ID="2" DockState="DockRight" ActiveContent="16">
<Contents Count="3">
<Content ID="0" RefID="16" />
<Content ID="1" RefID="4" />
<Content ID="2" RefID="11" />
</Contents>
</Pane>
<Pane ID="3" DockState="DockBottom" ActiveContent="3">
<Contents Count="7">
<Content ID="0" RefID="6" />
<Content ID="1" RefID="3" />
<Content ID="2" RefID="2" />
<Content ID="3" RefID="7" />
<Content ID="4" RefID="10" />
<Content ID="5" RefID="13" />
<Content ID="6" RefID="25" />
</Contents>
</Pane>
<Pane ID="4" DockState="Float" ActiveContent="-1">
<Contents Count="1">
<Content ID="0" RefID="6" />
<Contents Count="9">
<Content ID="0" RefID="23" />
<Content ID="1" RefID="19" />
<Content ID="2" RefID="20" />
<Content ID="3" RefID="21" />
<Content ID="4" RefID="27" />
<Content ID="5" RefID="16" />
<Content ID="6" RefID="22" />
<Content ID="7" RefID="13" />
<Content ID="8" RefID="24" />
</Contents>
</Pane>
<Pane ID="5" DockState="DockLeft" ActiveContent="0">
<Contents Count="3">
<Content ID="0" RefID="0" />
<Pane ID="3" DockState="Float" ActiveContent="-1">
<Contents Count="4">
<Content ID="0" RefID="3" />
<Content ID="1" RefID="5" />
<Content ID="2" RefID="1" />
</Contents>
</Pane>
<Pane ID="6" DockState="Float" ActiveContent="-1">
<Contents Count="1">
<Content ID="0" RefID="2" />
</Contents>
</Pane>
<Pane ID="7" DockState="Float" ActiveContent="-1">
<Contents Count="2">
<Content ID="0" RefID="0" />
<Content ID="1" RefID="1" />
<Content ID="2" RefID="4" />
<Content ID="3" RefID="11" />
</Contents>
</Pane>
<Pane ID="8" DockState="Float" ActiveContent="-1">
<Contents Count="1">
<Content ID="0" RefID="5" />
<Pane ID="4" DockState="DockBottom" ActiveContent="5">
<Contents Count="10">
<Content ID="0" RefID="3" />
<Content ID="1" RefID="5" />
<Content ID="2" RefID="14" />
<Content ID="3" RefID="4" />
<Content ID="4" RefID="17" />
<Content ID="5" RefID="11" />
<Content ID="6" RefID="10" />
<Content ID="7" RefID="12" />
<Content ID="8" RefID="9" />
<Content ID="9" RefID="8" />
</Contents>
</Pane>
<Pane ID="9" DockState="Float" ActiveContent="-1">
<Pane ID="5" DockState="Float" ActiveContent="-1">
<Contents Count="1">
<Content ID="0" RefID="7" />
<Content ID="0" RefID="6" />
</Contents>
</Pane>
<Pane ID="10" DockState="Float" ActiveContent="-1">
<Contents Count="1">
<Content ID="0" RefID="3" />
<Pane ID="6" DockState="DockRight" ActiveContent="18">
<Contents Count="5">
<Content ID="0" RefID="6" />
<Content ID="1" RefID="26" />
<Content ID="2" RefID="18" />
<Content ID="3" RefID="15" />
<Content ID="4" RefID="25" />
</Contents>
</Pane>
</Panes>
<DockWindows Count="3">
<DockWindow ID="0" DockState="DockLeft" ZOrderIndex="5">
<DockWindows>
<DockWindow ID="0" DockState="Document" ZOrderIndex="0">
<DockList Count="0" />
</DockWindow>
<DockWindow ID="1" DockState="DockLeft" ZOrderIndex="2">
<DockList Count="1">
<Pane ID="0" RefID="5" PrevPane="-1" Alignment="Bottom" Proportion="0.5" />
<Pane ID="0" RefID="0" PrevPane="-1" Alignment="Bottom" Proportion="0.5" />
</DockList>
</DockWindow>
<DockWindow ID="1" DockState="DockRight" ZOrderIndex="7">
<DockWindow ID="2" DockState="DockRight" ZOrderIndex="5">
<DockList Count="2">
<Pane ID="0" RefID="0" PrevPane="-1" Alignment="Bottom" Proportion="0.5" />
<Pane ID="1" RefID="2" PrevPane="0" Alignment="Bottom" Proportion="0.574444444444444" />
<Pane ID="0" RefID="6" PrevPane="-1" Alignment="Bottom" Proportion="0.5" />
<Pane ID="1" RefID="2" PrevPane="6" Alignment="Top" Proportion="0.353459972862958" />
</DockList>
</DockWindow>
<DockWindow ID="2" DockState="DockBottom" ZOrderIndex="6">
<DockWindow ID="3" DockState="DockTop" ZOrderIndex="1">
<DockList Count="0" />
</DockWindow>
<DockWindow ID="4" DockState="DockBottom" ZOrderIndex="4">
<DockList Count="1">
<Pane ID="0" RefID="3" PrevPane="-1" Alignment="Left" Proportion="0.5" />
<Pane ID="0" RefID="4" PrevPane="-1" Alignment="Right" Proportion="0.5" />
</DockList>
</DockWindow>
</DockWindows>
<FloatWindows Count="7">
<FloatWindow ID="0" Bounds="557, 363, 300, 300" AllowRedocking="True" ZOrderIndex="0">
<FloatWindows Count="3">
<FloatWindow ID="0" Bounds="367, 404, 300, 300" AllowRedocking="True" ZOrderIndex="0">
<DockList Count="1">
<Pane ID="0" RefID="1" PrevPane="-1" Alignment="Right" Proportion="0.5" />
</DockList>
</FloatWindow>
<FloatWindow ID="1" Bounds="262, 331, 300, 300" AllowRedocking="True" ZOrderIndex="1">
<DockList Count="1">
<Pane ID="0" RefID="4" PrevPane="-1" Alignment="Right" Proportion="0.5" />
</DockList>
</FloatWindow>
<FloatWindow ID="2" Bounds="386, 613, 300, 300" AllowRedocking="True" ZOrderIndex="2">
<DockList Count="1">
<Pane ID="0" RefID="6" PrevPane="-1" Alignment="Right" Proportion="0.5" />
</DockList>
</FloatWindow>
<FloatWindow ID="3" Bounds="-56, 262, 300, 300" AllowRedocking="True" ZOrderIndex="3">
<DockList Count="1">
<Pane ID="0" RefID="7" PrevPane="-1" Alignment="Right" Proportion="0.5" />
</DockList>
</FloatWindow>
<FloatWindow ID="4" Bounds="62, 370, 300, 300" AllowRedocking="True" ZOrderIndex="4">
<DockList Count="1">
<Pane ID="0" RefID="8" PrevPane="-1" Alignment="Right" Proportion="0.5" />
</DockList>
</FloatWindow>
<FloatWindow ID="5" Bounds="370, 477, 300, 300" AllowRedocking="True" ZOrderIndex="5">
<FloatWindow ID="1" Bounds="1650, 609, 300, 300" AllowRedocking="True" ZOrderIndex="1">
<DockList Count="1">
<Pane ID="0" RefID="9" PrevPane="-1" Alignment="Right" Proportion="0.5" />
<Pane ID="0" RefID="3" PrevPane="-1" Alignment="Right" Proportion="0.5" />
</DockList>
</FloatWindow>
<FloatWindow ID="6" Bounds="346, 477, 300, 300" AllowRedocking="True" ZOrderIndex="6">
<FloatWindow ID="2" Bounds="2013, 283, 300, 300" AllowRedocking="True" ZOrderIndex="2">
<DockList Count="1">
<Pane ID="0" RefID="10" PrevPane="-1" Alignment="Right" Proportion="0.5" />
<Pane ID="0" RefID="5" PrevPane="-1" Alignment="Right" Proportion="0.5" />
</DockList>
</FloatWindow>
</FloatWindows>

229
data/resources/layouts/Default.xml

@ -1,179 +1,120 @@ @@ -1,179 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- DockPanel configuration file. Author: Weifen Luo, all rights reserved. -->
<!-- !!! AUTOMATICALLY GENERATED FILE. DO NOT MODIFY !!! -->
<DockPanel FormatVersion="0.9.3" DockLeftPortion="0.176451264222485" DockRightPortion="0.178922617303663" DockTopPortion="0.25" DockBottomPortion="0.259014607431894" ActiveDocumentPane="-1" ActivePane="5">
<Contents Count="27">
<DockPanel FormatVersion="1.0" DockLeftPortion="0.196180555555556" DockRightPortion="0.172743055555556" DockTopPortion="0.25" DockBottomPortion="0.25" ActiveDocumentPane="-1" ActivePane="-1">
<Contents Count="28">
<Content ID="0" PersistString="ICSharpCode.SharpDevelop.Project.ProjectBrowserPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="1" PersistString="ICSharpCode.SharpDevelop.Gui.SideBarView" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="2" PersistString="ICSharpCode.SharpDevelop.Gui.TaskListPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="3" PersistString="ICSharpCode.SharpDevelop.Gui.CompilerMessageView" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="4" PersistString="ICSharpCode.SharpDevelop.Gui.PropertyPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="5" PersistString="ICSharpCode.SharpDevelop.Gui.FileScout" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="6" PersistString="ICSharpCode.SharpDevelop.Gui.ErrorListPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="7" PersistString="SearchAndReplace.SearchResultPanel" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="8" PersistString="ICSharpCode.SharpDevelop.Gui.ClassBrowser" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="9" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.BreakPointsPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="10" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.CallStackPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="11" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.LoadedModulesPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="12" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.RunningThreadsPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="13" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.LocalVarPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="14" PersistString="ICSharpCode.SharpDevelop.Bookmarks.BookmarkPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="15" PersistString="ICSharpCode.SharpDevelop.Gui.DefinitionViewPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="16" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.ExceptionHistoryPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="17" PersistString="HtmlHelp2.HtmlHelp2TocPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="18" PersistString="HtmlHelp2.HtmlHelp2IndexPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="19" PersistString="HtmlHelp2.HtmlHelp2SearchPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="20" PersistString="HtmlHelp2.HtmlHelp2IndexResultsPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="21" PersistString="ICSharpCode.NAntAddIn.Gui.NAntPadContent" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="22" PersistString="HtmlHelp2.HtmlHelp2DynamicHelpPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="23" PersistString="SharpQuery.Pads.SharpQueryPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="24" PersistString="SharpReportAddin.FieldsExplorer" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="25" PersistString="ICSharpCode.CodeCoverage.CodeCoveragePad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="26" PersistString="ICSharpCode.UnitTesting.PadContent" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="1" PersistString="ICSharpCode.SharpDevelop.Gui.ClassBrowser" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="2" PersistString="ICSharpCode.SharpDevelop.Gui.SideBarView" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="3" PersistString="ICSharpCode.SharpDevelop.Gui.ErrorListPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="4" PersistString="ICSharpCode.SharpDevelop.Gui.TaskListPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="5" PersistString="ICSharpCode.SharpDevelop.Gui.CompilerMessageView" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="6" PersistString="ICSharpCode.SharpDevelop.Gui.PropertyPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="7" PersistString="ICSharpCode.SharpDevelop.Gui.FileScout" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="8" PersistString="SearchAndReplace.SearchResultPanel" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="9" PersistString="ICSharpCode.SharpDevelop.Bookmarks.BookmarkPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="10" PersistString="ICSharpCode.CodeCoverage.CodeCoveragePad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="11" PersistString="ICSharpCode.SharpDevelop.Gui.DefinitionViewPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="12" PersistString="Boo.InterpreterAddIn.InterpreterPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="13" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.BreakPointsPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="14" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.CallStackPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="15" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.LoadedModulesPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="16" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.RunningThreadsPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="17" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.LocalVarPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="18" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.ExceptionHistoryPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="19" PersistString="HtmlHelp2.HtmlHelp2TocPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="20" PersistString="HtmlHelp2.HtmlHelp2IndexPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="21" PersistString="HtmlHelp2.HtmlHelp2SearchPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="22" PersistString="HtmlHelp2.HtmlHelp2IndexResultsPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="23" PersistString="HtmlHelp2.HtmlHelp2DynamicHelpPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="24" PersistString="ICSharpCode.NAntAddIn.Gui.NAntPadContent" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="25" PersistString="SharpQuery.Pads.SharpQueryPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="26" PersistString="SharpReportAddin.FieldsExplorer" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="27" PersistString="ICSharpCode.UnitTesting.PadContent" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
</Contents>
<Panes Count="12">
<Pane ID="0" DockState="DockRight" ActiveContent="-1">
<Contents Count="14">
<Content ID="0" RefID="21" />
<Content ID="1" RefID="22" />
<Content ID="2" RefID="17" />
<Content ID="3" RefID="9" />
<Content ID="4" RefID="10" />
<Content ID="5" RefID="11" />
<Content ID="6" RefID="12" />
<Content ID="7" RefID="13" />
<Content ID="8" RefID="16" />
<Content ID="9" RefID="18" />
<Content ID="10" RefID="19" />
<Content ID="11" RefID="23" />
<Content ID="12" RefID="24" />
<Content ID="13" RefID="26" />
</Contents>
</Pane>
<Pane ID="1" DockState="Float" ActiveContent="-1">
<Contents Count="1">
<Content ID="0" RefID="4" />
</Contents>
</Pane>
<Pane ID="2" DockState="DockRight" ActiveContent="4">
<Contents Count="2">
<Content ID="0" RefID="4" />
<Content ID="1" RefID="8" />
</Contents>
</Pane>
<Pane ID="3" DockState="DockBottom" ActiveContent="3">
<Contents Count="8">
<Content ID="0" RefID="6" />
<Content ID="1" RefID="3" />
<Content ID="2" RefID="2" />
<Content ID="3" RefID="15" />
<Content ID="4" RefID="7" />
<Content ID="5" RefID="20" />
<Content ID="6" RefID="14" />
<Content ID="7" RefID="25" />
</Contents>
</Pane>
<Pane ID="4" DockState="Float" ActiveContent="-1">
<Contents Count="1">
<Panes Count="5">
<Pane ID="0" DockState="DockRight" ActiveContent="6">
<Contents Count="7">
<Content ID="0" RefID="6" />
<Content ID="1" RefID="1" />
<Content ID="2" RefID="25" />
<Content ID="3" RefID="14" />
<Content ID="4" RefID="15" />
<Content ID="5" RefID="18" />
<Content ID="6" RefID="26" />
</Contents>
</Pane>
<Pane ID="5" DockState="DockLeft" ActiveContent="0">
<Pane ID="1" DockState="DockLeft" ActiveContent="0">
<Contents Count="3">
<Content ID="0" RefID="0" />
<Content ID="1" RefID="5" />
<Content ID="2" RefID="1" />
</Contents>
</Pane>
<Pane ID="6" DockState="Float" ActiveContent="-1">
<Contents Count="1">
<Content ID="0" RefID="2" />
</Contents>
</Pane>
<Pane ID="7" DockState="Float" ActiveContent="-1">
<Contents Count="2">
<Content ID="0" RefID="0" />
<Content ID="1" RefID="1" />
</Contents>
</Pane>
<Pane ID="8" DockState="Float" ActiveContent="-1">
<Contents Count="1">
<Content ID="0" RefID="5" />
<Content ID="1" RefID="7" />
<Content ID="2" RefID="2" />
</Contents>
</Pane>
<Pane ID="9" DockState="Float" ActiveContent="-1">
<Contents Count="1">
<Content ID="0" RefID="7" />
<Pane ID="2" DockState="Float" ActiveContent="-1">
<Contents Count="5">
<Content ID="0" RefID="3" />
<Content ID="1" RefID="4" />
<Content ID="2" RefID="8" />
<Content ID="3" RefID="9" />
<Content ID="4" RefID="11" />
</Contents>
</Pane>
<Pane ID="10" DockState="Float" ActiveContent="-1">
<Contents Count="1">
<Pane ID="3" DockState="DockBottom" ActiveContent="5">
<Contents Count="9">
<Content ID="0" RefID="3" />
<Content ID="1" RefID="5" />
<Content ID="2" RefID="4" />
<Content ID="3" RefID="11" />
<Content ID="4" RefID="8" />
<Content ID="5" RefID="9" />
<Content ID="6" RefID="12" />
<Content ID="7" RefID="17" />
<Content ID="8" RefID="10" />
</Contents>
</Pane>
<Pane ID="11" DockState="Float" ActiveContent="-1">
<Contents Count="1">
<Content ID="0" RefID="22" />
<Pane ID="4" DockState="DockRight" ActiveContent="-1">
<Contents Count="9">
<Content ID="0" RefID="23" />
<Content ID="1" RefID="19" />
<Content ID="2" RefID="20" />
<Content ID="3" RefID="21" />
<Content ID="4" RefID="27" />
<Content ID="5" RefID="16" />
<Content ID="6" RefID="22" />
<Content ID="7" RefID="13" />
<Content ID="8" RefID="24" />
</Contents>
</Pane>
</Panes>
<DockWindows Count="3">
<DockWindow ID="0" DockState="DockLeft" ZOrderIndex="7">
<DockWindows>
<DockWindow ID="0" DockState="Document" ZOrderIndex="0">
<DockList Count="0" />
</DockWindow>
<DockWindow ID="1" DockState="DockLeft" ZOrderIndex="3">
<DockList Count="1">
<Pane ID="0" RefID="5" PrevPane="-1" Alignment="Bottom" Proportion="0.5" />
<Pane ID="0" RefID="1" PrevPane="-1" Alignment="Bottom" Proportion="0.5" />
</DockList>
</DockWindow>
<DockWindow ID="1" DockState="DockRight" ZOrderIndex="6">
<DockWindow ID="2" DockState="DockRight" ZOrderIndex="4">
<DockList Count="2">
<Pane ID="0" RefID="0" PrevPane="-1" Alignment="Bottom" Proportion="0.5" />
<Pane ID="1" RefID="2" PrevPane="0" Alignment="Bottom" Proportion="0.654712002972872" />
<Pane ID="1" RefID="4" PrevPane="0" Alignment="Top" Proportion="0.353459972862958" />
</DockList>
</DockWindow>
<DockWindow ID="2" DockState="DockBottom" ZOrderIndex="5">
<DockWindow ID="3" DockState="DockTop" ZOrderIndex="2">
<DockList Count="0" />
</DockWindow>
<DockWindow ID="4" DockState="DockBottom" ZOrderIndex="1">
<DockList Count="1">
<Pane ID="0" RefID="3" PrevPane="-1" Alignment="Left" Proportion="0.5" />
<Pane ID="0" RefID="3" PrevPane="-1" Alignment="Right" Proportion="0.5" />
</DockList>
</DockWindow>
</DockWindows>
<FloatWindows Count="8">
<FloatWindow ID="0" Bounds="557, 363, 300, 300" AllowRedocking="True" ZOrderIndex="0">
<DockList Count="1">
<Pane ID="0" RefID="1" PrevPane="-1" Alignment="Right" Proportion="0.5" />
</DockList>
</FloatWindow>
<FloatWindow ID="1" Bounds="262, 331, 300, 300" AllowRedocking="True" ZOrderIndex="1">
<DockList Count="1">
<Pane ID="0" RefID="4" PrevPane="-1" Alignment="Right" Proportion="0.5" />
</DockList>
</FloatWindow>
<FloatWindow ID="2" Bounds="386, 613, 300, 300" AllowRedocking="True" ZOrderIndex="2">
<DockList Count="1">
<Pane ID="0" RefID="6" PrevPane="-1" Alignment="Right" Proportion="0.5" />
</DockList>
</FloatWindow>
<FloatWindow ID="3" Bounds="-56, 262, 300, 300" AllowRedocking="True" ZOrderIndex="3">
<DockList Count="1">
<Pane ID="0" RefID="7" PrevPane="-1" Alignment="Right" Proportion="0.5" />
</DockList>
</FloatWindow>
<FloatWindow ID="4" Bounds="62, 370, 300, 300" AllowRedocking="True" ZOrderIndex="4">
<DockList Count="1">
<Pane ID="0" RefID="8" PrevPane="-1" Alignment="Right" Proportion="0.5" />
</DockList>
</FloatWindow>
<FloatWindow ID="5" Bounds="370, 477, 300, 300" AllowRedocking="True" ZOrderIndex="5">
<DockList Count="1">
<Pane ID="0" RefID="9" PrevPane="-1" Alignment="Right" Proportion="0.5" />
</DockList>
</FloatWindow>
<FloatWindow ID="6" Bounds="346, 477, 300, 300" AllowRedocking="True" ZOrderIndex="6">
<DockList Count="1">
<Pane ID="0" RefID="10" PrevPane="-1" Alignment="Right" Proportion="0.5" />
</DockList>
</FloatWindow>
<FloatWindow ID="7" Bounds="654, 252, 300, 300" AllowRedocking="True" ZOrderIndex="7">
<FloatWindows Count="1">
<FloatWindow ID="0" Bounds="367, 404, 300, 300" AllowRedocking="True" ZOrderIndex="0">
<DockList Count="1">
<Pane ID="0" RefID="11" PrevPane="-1" Alignment="Right" Proportion="0.5" />
<Pane ID="0" RefID="2" PrevPane="-1" Alignment="Right" Proportion="0.5" />
</DockList>
</FloatWindow>
</FloatWindows>

227
data/resources/layouts/Plain.xml

@ -1,179 +1,120 @@ @@ -1,179 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- DockPanel configuration file. Author: Weifen Luo, all rights reserved. -->
<!-- !!! AUTOMATICALLY GENERATED FILE. DO NOT MODIFY !!! -->
<DockPanel FormatVersion="0.9.3" DockLeftPortion="0.176451264222485" DockRightPortion="0.178922617303663" DockTopPortion="0.25" DockBottomPortion="0.259014607431894" ActiveDocumentPane="-1" ActivePane="-1">
<Contents Count="27">
<DockPanel FormatVersion="1.0" DockLeftPortion="0.196180555555556" DockRightPortion="0.172743055555556" DockTopPortion="0.25" DockBottomPortion="0.25" ActiveDocumentPane="-1" ActivePane="-1">
<Contents Count="28">
<Content ID="0" PersistString="ICSharpCode.SharpDevelop.Project.ProjectBrowserPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="1" PersistString="ICSharpCode.SharpDevelop.Gui.SideBarView" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="2" PersistString="ICSharpCode.SharpDevelop.Gui.TaskListPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="3" PersistString="ICSharpCode.SharpDevelop.Gui.CompilerMessageView" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="4" PersistString="ICSharpCode.SharpDevelop.Gui.PropertyPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="5" PersistString="ICSharpCode.SharpDevelop.Gui.FileScout" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="6" PersistString="ICSharpCode.SharpDevelop.Gui.ErrorListPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="7" PersistString="SearchAndReplace.SearchResultPanel" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="8" PersistString="ICSharpCode.SharpDevelop.Gui.ClassBrowser" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="9" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.BreakPointsPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="10" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.CallStackPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="11" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.LoadedModulesPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="12" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.RunningThreadsPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="13" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.LocalVarPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="14" PersistString="ICSharpCode.SharpDevelop.Bookmarks.BookmarkPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="15" PersistString="ICSharpCode.SharpDevelop.Gui.DefinitionViewPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="16" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.ExceptionHistoryPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="17" PersistString="HtmlHelp2.HtmlHelp2TocPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="18" PersistString="HtmlHelp2.HtmlHelp2IndexPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="19" PersistString="HtmlHelp2.HtmlHelp2SearchPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="20" PersistString="HtmlHelp2.HtmlHelp2IndexResultsPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="21" PersistString="ICSharpCode.NAntAddIn.Gui.NAntPadContent" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="22" PersistString="HtmlHelp2.HtmlHelp2DynamicHelpPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="23" PersistString="SharpQuery.Pads.SharpQueryPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="24" PersistString="SharpReportAddin.FieldsExplorer" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="25" PersistString="ICSharpCode.CodeCoverage.CodeCoveragePad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="26" PersistString="ICSharpCode.UnitTesting.PadContent" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="1" PersistString="ICSharpCode.SharpDevelop.Gui.ClassBrowser" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="2" PersistString="ICSharpCode.SharpDevelop.Gui.SideBarView" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="3" PersistString="ICSharpCode.SharpDevelop.Gui.ErrorListPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="4" PersistString="ICSharpCode.SharpDevelop.Gui.TaskListPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="5" PersistString="ICSharpCode.SharpDevelop.Gui.CompilerMessageView" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="6" PersistString="ICSharpCode.SharpDevelop.Gui.PropertyPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="7" PersistString="ICSharpCode.SharpDevelop.Gui.FileScout" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="8" PersistString="SearchAndReplace.SearchResultPanel" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="9" PersistString="ICSharpCode.SharpDevelop.Bookmarks.BookmarkPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="10" PersistString="ICSharpCode.CodeCoverage.CodeCoveragePad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="11" PersistString="ICSharpCode.SharpDevelop.Gui.DefinitionViewPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="12" PersistString="Boo.InterpreterAddIn.InterpreterPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="13" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.BreakPointsPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="14" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.CallStackPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="15" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.LoadedModulesPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="16" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.RunningThreadsPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="17" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.LocalVarPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="18" PersistString="ICSharpCode.SharpDevelop.Gui.Pads.ExceptionHistoryPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="19" PersistString="HtmlHelp2.HtmlHelp2TocPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="20" PersistString="HtmlHelp2.HtmlHelp2IndexPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="21" PersistString="HtmlHelp2.HtmlHelp2SearchPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="22" PersistString="HtmlHelp2.HtmlHelp2IndexResultsPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="23" PersistString="HtmlHelp2.HtmlHelp2DynamicHelpPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="24" PersistString="ICSharpCode.NAntAddIn.Gui.NAntPadContent" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="25" PersistString="SharpQuery.Pads.SharpQueryPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="26" PersistString="SharpReportAddin.FieldsExplorer" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="27" PersistString="ICSharpCode.UnitTesting.PadContent" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
</Contents>
<Panes Count="12">
<Panes Count="5">
<Pane ID="0" DockState="DockRight" ActiveContent="-1">
<Contents Count="14">
<Content ID="0" RefID="21" />
<Content ID="1" RefID="22" />
<Content ID="2" RefID="17" />
<Content ID="3" RefID="9" />
<Content ID="4" RefID="10" />
<Content ID="5" RefID="11" />
<Content ID="6" RefID="12" />
<Content ID="7" RefID="13" />
<Content ID="8" RefID="16" />
<Content ID="9" RefID="18" />
<Content ID="10" RefID="19" />
<Content ID="11" RefID="23" />
<Content ID="12" RefID="24" />
<Content ID="13" RefID="26" />
</Contents>
</Pane>
<Pane ID="1" DockState="Float" ActiveContent="-1">
<Contents Count="1">
<Content ID="0" RefID="4" />
</Contents>
</Pane>
<Pane ID="2" DockState="DockRight" ActiveContent="-1">
<Contents Count="2">
<Content ID="0" RefID="4" />
<Content ID="1" RefID="8" />
</Contents>
</Pane>
<Pane ID="3" DockState="DockBottom" ActiveContent="-1">
<Contents Count="8">
<Content ID="0" RefID="6" />
<Content ID="1" RefID="3" />
<Content ID="2" RefID="2" />
<Content ID="3" RefID="15" />
<Content ID="4" RefID="7" />
<Content ID="5" RefID="20" />
<Content ID="6" RefID="14" />
<Content ID="7" RefID="25" />
</Contents>
</Pane>
<Pane ID="4" DockState="Float" ActiveContent="-1">
<Contents Count="1">
<Contents Count="7">
<Content ID="0" RefID="6" />
<Content ID="1" RefID="1" />
<Content ID="2" RefID="25" />
<Content ID="3" RefID="14" />
<Content ID="4" RefID="15" />
<Content ID="5" RefID="18" />
<Content ID="6" RefID="26" />
</Contents>
</Pane>
<Pane ID="5" DockState="DockLeft" ActiveContent="-1">
<Pane ID="1" DockState="DockLeft" ActiveContent="-1">
<Contents Count="3">
<Content ID="0" RefID="0" />
<Content ID="1" RefID="5" />
<Content ID="2" RefID="1" />
</Contents>
</Pane>
<Pane ID="6" DockState="Float" ActiveContent="-1">
<Contents Count="1">
<Content ID="0" RefID="2" />
</Contents>
</Pane>
<Pane ID="7" DockState="Float" ActiveContent="-1">
<Contents Count="2">
<Content ID="0" RefID="0" />
<Content ID="1" RefID="1" />
</Contents>
</Pane>
<Pane ID="8" DockState="Float" ActiveContent="-1">
<Contents Count="1">
<Content ID="0" RefID="5" />
<Content ID="1" RefID="7" />
<Content ID="2" RefID="2" />
</Contents>
</Pane>
<Pane ID="9" DockState="Float" ActiveContent="-1">
<Contents Count="1">
<Content ID="0" RefID="7" />
<Pane ID="2" DockState="Float" ActiveContent="-1">
<Contents Count="5">
<Content ID="0" RefID="3" />
<Content ID="1" RefID="4" />
<Content ID="2" RefID="8" />
<Content ID="3" RefID="9" />
<Content ID="4" RefID="11" />
</Contents>
</Pane>
<Pane ID="10" DockState="Float" ActiveContent="-1">
<Contents Count="1">
<Pane ID="3" DockState="DockBottom" ActiveContent="-1">
<Contents Count="9">
<Content ID="0" RefID="3" />
<Content ID="1" RefID="5" />
<Content ID="2" RefID="4" />
<Content ID="3" RefID="11" />
<Content ID="4" RefID="8" />
<Content ID="5" RefID="9" />
<Content ID="6" RefID="12" />
<Content ID="7" RefID="17" />
<Content ID="8" RefID="10" />
</Contents>
</Pane>
<Pane ID="11" DockState="Float" ActiveContent="-1">
<Contents Count="1">
<Content ID="0" RefID="22" />
<Pane ID="4" DockState="DockRight" ActiveContent="-1">
<Contents Count="9">
<Content ID="0" RefID="23" />
<Content ID="1" RefID="19" />
<Content ID="2" RefID="20" />
<Content ID="3" RefID="21" />
<Content ID="4" RefID="27" />
<Content ID="5" RefID="16" />
<Content ID="6" RefID="22" />
<Content ID="7" RefID="13" />
<Content ID="8" RefID="24" />
</Contents>
</Pane>
</Panes>
<DockWindows Count="3">
<DockWindow ID="0" DockState="DockLeft" ZOrderIndex="6">
<DockWindows>
<DockWindow ID="0" DockState="Document" ZOrderIndex="0">
<DockList Count="0" />
</DockWindow>
<DockWindow ID="1" DockState="DockLeft" ZOrderIndex="3">
<DockList Count="1">
<Pane ID="0" RefID="5" PrevPane="-1" Alignment="Bottom" Proportion="0.5" />
<Pane ID="0" RefID="1" PrevPane="-1" Alignment="Bottom" Proportion="0.5" />
</DockList>
</DockWindow>
<DockWindow ID="1" DockState="DockRight" ZOrderIndex="7">
<DockWindow ID="2" DockState="DockRight" ZOrderIndex="4">
<DockList Count="2">
<Pane ID="0" RefID="0" PrevPane="-1" Alignment="Bottom" Proportion="0.5" />
<Pane ID="1" RefID="2" PrevPane="0" Alignment="Bottom" Proportion="0.654712002972872" />
<Pane ID="1" RefID="4" PrevPane="0" Alignment="Top" Proportion="0.353459972862958" />
</DockList>
</DockWindow>
<DockWindow ID="2" DockState="DockBottom" ZOrderIndex="5">
<DockWindow ID="3" DockState="DockTop" ZOrderIndex="2">
<DockList Count="0" />
</DockWindow>
<DockWindow ID="4" DockState="DockBottom" ZOrderIndex="1">
<DockList Count="1">
<Pane ID="0" RefID="3" PrevPane="-1" Alignment="Left" Proportion="0.5" />
<Pane ID="0" RefID="3" PrevPane="-1" Alignment="Right" Proportion="0.5" />
</DockList>
</DockWindow>
</DockWindows>
<FloatWindows Count="8">
<FloatWindow ID="0" Bounds="557, 363, 300, 300" AllowRedocking="True" ZOrderIndex="0">
<DockList Count="1">
<Pane ID="0" RefID="1" PrevPane="-1" Alignment="Right" Proportion="0.5" />
</DockList>
</FloatWindow>
<FloatWindow ID="1" Bounds="262, 331, 300, 300" AllowRedocking="True" ZOrderIndex="1">
<DockList Count="1">
<Pane ID="0" RefID="4" PrevPane="-1" Alignment="Right" Proportion="0.5" />
</DockList>
</FloatWindow>
<FloatWindow ID="2" Bounds="386, 613, 300, 300" AllowRedocking="True" ZOrderIndex="2">
<DockList Count="1">
<Pane ID="0" RefID="6" PrevPane="-1" Alignment="Right" Proportion="0.5" />
</DockList>
</FloatWindow>
<FloatWindow ID="3" Bounds="-56, 262, 300, 300" AllowRedocking="True" ZOrderIndex="3">
<DockList Count="1">
<Pane ID="0" RefID="7" PrevPane="-1" Alignment="Right" Proportion="0.5" />
</DockList>
</FloatWindow>
<FloatWindow ID="4" Bounds="62, 370, 300, 300" AllowRedocking="True" ZOrderIndex="4">
<DockList Count="1">
<Pane ID="0" RefID="8" PrevPane="-1" Alignment="Right" Proportion="0.5" />
</DockList>
</FloatWindow>
<FloatWindow ID="5" Bounds="370, 477, 300, 300" AllowRedocking="True" ZOrderIndex="5">
<DockList Count="1">
<Pane ID="0" RefID="9" PrevPane="-1" Alignment="Right" Proportion="0.5" />
</DockList>
</FloatWindow>
<FloatWindow ID="6" Bounds="346, 477, 300, 300" AllowRedocking="True" ZOrderIndex="6">
<DockList Count="1">
<Pane ID="0" RefID="10" PrevPane="-1" Alignment="Right" Proportion="0.5" />
</DockList>
</FloatWindow>
<FloatWindow ID="7" Bounds="654, 252, 300, 300" AllowRedocking="True" ZOrderIndex="7">
<FloatWindows Count="1">
<FloatWindow ID="0" Bounds="367, 404, 300, 300" AllowRedocking="True" ZOrderIndex="0">
<DockList Count="1">
<Pane ID="0" RefID="11" PrevPane="-1" Alignment="Right" Proportion="0.5" />
<Pane ID="0" RefID="2" PrevPane="-1" Alignment="Right" Proportion="0.5" />
</DockList>
</FloatWindow>
</FloatWindows>

5
src/Libraries/DockPanel_Src/DockSample/AboutDialog.cs

@ -74,7 +74,7 @@ namespace DockSample @@ -74,7 +74,7 @@ namespace DockSample
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(272, 16);
this.label1.TabIndex = 1;
this.label1.Text = "DockSample, Version 1.3";
this.label1.Text = "DockSample, Version 1.4";
//
// label2
//
@ -82,12 +82,11 @@ namespace DockSample @@ -82,12 +82,11 @@ namespace DockSample
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(272, 32);
this.label2.TabIndex = 2;
this.label2.Text = "Copyright 2003 - 2005, Weifen Luo";
this.label2.Text = "Copyright 2003 - 2006, Weifen Luo";
//
// AboutDialog
//
this.AcceptButton = this.buttonOK;
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.CancelButton = this.buttonOK;
this.ClientSize = new System.Drawing.Size(322, 215);
this.Controls.Add(this.label2);

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

@ -26,7 +26,7 @@ using System.Runtime.CompilerServices; @@ -26,7 +26,7 @@ using System.Runtime.CompilerServices;
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyVersion("1.4.0.0")]
//
// In order to sign your assembly you must specify a key to use. Refer to the

60
src/Libraries/DockPanel_Src/DockSample/DockSample.csproj

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.41115</ProductVersion>
<ProductVersion>8.0.50215</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{0A386EC6-40E1-4C5A-BA6B-B483FE89E8E7}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -24,6 +24,8 @@ @@ -24,6 +24,8 @@
</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
@ -32,7 +34,7 @@ @@ -32,7 +34,7 @@
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DefineConstants>TRACE;DEBUG;FRAMEWORK_VER_2x</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>true</DebugSymbols>
@ -53,7 +55,7 @@ @@ -53,7 +55,7 @@
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DefineConstants>TRACE;FRAMEWORK_VER_2x</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>false</DebugSymbols>
@ -101,7 +103,7 @@ @@ -101,7 +103,7 @@
<Reference Include="System.Xml">
<Name>System.XML</Name>
</Reference>
<ProjectReference Include="..\WinFormsUI\WinFormsUI.csproj">
<ProjectReference Include="..\WinFormsUI\WinFormsUI2005.csproj">
<Name>WinFormsUI</Name>
<Project>{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
@ -133,13 +135,49 @@ @@ -133,13 +135,49 @@
<Compile Include="DummyToolbox.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
<Compile Include="Extender\Extender.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Extender\FromBase\AutoHideStripFromBase.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Extender\FromBase\AutoHideTabFromBase.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Extender\FromBase\DockPaneCaptionFromBase.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Extender\FromBase\DockPaneStripFromBase.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Extender\FromBase\DockPaneTabFromBase.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Extender\FromBase\Helpers\DockHelper.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Options.cs">
<Compile Include="Extender\FromBase\Helpers\ResourceHelper.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="OptionsDialog.cs">
<Compile Include="Extender\FromBase\Win32\Enums.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Extender\FromBase\Win32\Gdi32.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Extender\FromBase\Win32\Structs.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Extender\FromBase\Win32\User32.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Extender\Override\AutoHideStripOverride.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Extender\Override\DockPaneStripOverride.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<EmbeddedResource Include="AboutDialog.resx">
@ -166,9 +204,6 @@ @@ -166,9 +204,6 @@
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="OptionsDialog.resx">
<DependentUpon>OptionsDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Resources\DockPanel.xml" />
<Content Include="App.ico" />
<Content Include="Images\ArrowDown.bmp" />
@ -178,6 +213,7 @@ @@ -178,6 +213,7 @@
<Content Include="Images\ClosedFolder.ICO" />
<Content Include="Images\CSFile.ico" />
<Content Include="Images\CSProject.ico" />
<Content Include="Images\File.ico" />
<Content Include="Images\Form.ico" />
<Content Include="Images\Mouse.bmp" />
<Content Include="Images\msenv22.ico" />
@ -194,7 +230,7 @@ @@ -194,7 +230,7 @@
<Content Include="Images\XmlFile.ico" />
<None Include="RtfFiles\DummyDoc.cs.rtf" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>

23
src/Libraries/DockPanel_Src/DockSample/DockSample.csproj.user

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<LastOpenVersion>7.10.3077</LastOpenVersion>
<LastOpenVersion>8.0.50215</LastOpenVersion>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReferencePath>
@ -13,27 +13,6 @@ @@ -13,27 +13,6 @@
<ProjectView>ShowAllFiles</ProjectView>
<ProjectTrust>0</ProjectTrust>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<EnableASPDebugging>false</EnableASPDebugging>
<EnableASPXDebugging>false</EnableASPXDebugging>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
<EnableSQLServerDebugging>false</EnableSQLServerDebugging>
<RemoteDebugEnabled>false</RemoteDebugEnabled>
<RemoteDebugMachine>
</RemoteDebugMachine>
<StartAction>Project</StartAction>
<StartArguments>
</StartArguments>
<StartPage>
</StartPage>
<StartProgram>
</StartProgram>
<StartURL>
</StartURL>
<StartWorkingDirectory>
</StartWorkingDirectory>
<StartWithIE>true</StartWithIE>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<EnableASPDebugging>false</EnableASPDebugging>
<EnableASPXDebugging>false</EnableASPXDebugging>

139
src/Libraries/DockPanel_Src/DockSample/DummyDoc.cs

@ -13,6 +13,19 @@ namespace DockSample @@ -13,6 +13,19 @@ namespace DockSample
/// </summary>
public class DummyDoc : DockContent
{
#if FRAMEWORK_VER_2x
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.MenuStrip mainMenu;
private System.Windows.Forms.ToolStripMenuItem menuItem1;
private System.Windows.Forms.ToolStripMenuItem menuItem2;
private System.Windows.Forms.ContextMenuStrip contextMenuTabPage;
private System.Windows.Forms.ToolStripMenuItem menuItem3;
private System.Windows.Forms.ToolStripMenuItem menuItem4;
private System.Windows.Forms.ToolStripMenuItem menuItem5;
private System.Windows.Forms.ToolStripMenuItem menuItemCheckTest;
private System.Windows.Forms.ToolTip toolTip;
private System.ComponentModel.IContainer components;
#else
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.MainMenu mainMenu;
private System.Windows.Forms.MenuItem menuItem1;
@ -22,12 +35,11 @@ namespace DockSample @@ -22,12 +35,11 @@ namespace DockSample
private System.Windows.Forms.MenuItem menuItem4;
private System.Windows.Forms.MenuItem menuItem5;
private System.Windows.Forms.MenuItem menuItemCheckTest;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
private System.Windows.Forms.ToolTip toolTip;
private System.ComponentModel.IContainer components;
#endif
public DummyDoc()
public DummyDoc()
{
//
// Required for Windows Form Designer support
@ -50,6 +62,7 @@ namespace DockSample @@ -50,6 +62,7 @@ namespace DockSample
base.Dispose( disposing );
}
#if FRAMEWORK_VER_2x
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
@ -57,6 +70,103 @@ namespace DockSample @@ -57,6 +70,103 @@ namespace DockSample
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(DummyDoc));
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.mainMenu = new System.Windows.Forms.MenuStrip();
this.menuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.menuItem2 = new System.Windows.Forms.ToolStripMenuItem();
this.menuItemCheckTest = new System.Windows.Forms.ToolStripMenuItem();
this.contextMenuTabPage = new System.Windows.Forms.ContextMenuStrip();
this.menuItem3 = new System.Windows.Forms.ToolStripMenuItem();
this.menuItem4 = new System.Windows.Forms.ToolStripMenuItem();
this.menuItem5 = new System.Windows.Forms.ToolStripMenuItem();
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.SuspendLayout();
//
// richTextBox1
//
this.richTextBox1.AcceptsTab = true;
this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.richTextBox1.Location = new System.Drawing.Point(0, 4);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(448, 389);
this.richTextBox1.TabIndex = 0;
this.richTextBox1.Text = "";
this.toolTip.SetToolTip(this.richTextBox1, "Test Tooltip");
//
// mainMenu
//
this.mainMenu.Visible = false;
this.mainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuItem1});
//
// menuItem1
//
this.menuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuItem2,
this.menuItemCheckTest});
this.menuItem1.MergeIndex = 1;
this.menuItem1.MergeAction = MergeAction.Insert;
this.menuItem1.Text = "&MDI Document";
//
// menuItem2
//
this.menuItem2.Text = "Test";
this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click);
//
// menuItemCheckTest
//
this.menuItemCheckTest.Text = "Check Test";
this.menuItemCheckTest.Click += new System.EventHandler(this.menuItemCheckTest_Click);
//
// contextMenuTabPage
//
this.contextMenuTabPage.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuItem3,
this.menuItem4,
this.menuItem5});
//
// menuItem3
//
this.menuItem3.Text = "Option &1";
//
// menuItem4
//
this.menuItem4.Text = "Option &2";
//
// menuItem5
//
this.menuItem5.Text = "Option &3";
//
// DummyDoc
//
this.ClientSize = new System.Drawing.Size(448, 393);
this.Controls.Add(this.richTextBox1);
this.Controls.Add(this.mainMenu);
this.DockableAreas = ((WeifenLuo.WinFormsUI.DockAreas)(((((WeifenLuo.WinFormsUI.DockAreas.DockLeft | WeifenLuo.WinFormsUI.DockAreas.DockRight)
| WeifenLuo.WinFormsUI.DockAreas.DockTop)
| WeifenLuo.WinFormsUI.DockAreas.DockBottom)
| WeifenLuo.WinFormsUI.DockAreas.Document)));
this.DockPadding.Top = 4;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MainMenuStrip = this.mainMenu;
this.Name = "DummyDoc";
this.TabPageContextMenuStrip = this.contextMenuTabPage;
this.ResumeLayout(false);
}
#endregion
#else
#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.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(DummyDoc));
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.mainMenu = new System.Windows.Forms.MainMenu();
this.menuItem1 = new System.Windows.Forms.MenuItem();
@ -66,6 +176,7 @@ namespace DockSample @@ -66,6 +176,7 @@ namespace DockSample
this.menuItem3 = new System.Windows.Forms.MenuItem();
this.menuItem4 = new System.Windows.Forms.MenuItem();
this.menuItem5 = new System.Windows.Forms.MenuItem();
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.SuspendLayout();
//
// richTextBox1
@ -74,9 +185,10 @@ namespace DockSample @@ -74,9 +185,10 @@ namespace DockSample
this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.richTextBox1.Location = new System.Drawing.Point(0, 4);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(264, 333);
this.richTextBox1.Size = new System.Drawing.Size(448, 389);
this.richTextBox1.TabIndex = 0;
this.richTextBox1.Text = "";
this.toolTip.SetToolTip(this.richTextBox1, "Test Tooltip");
//
// mainMenu
//
@ -129,9 +241,14 @@ namespace DockSample @@ -129,9 +241,14 @@ namespace DockSample
// DummyDoc
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(264, 337);
this.ClientSize = new System.Drawing.Size(448, 393);
this.Controls.Add(this.richTextBox1);
this.DockableAreas = ((WeifenLuo.WinFormsUI.DockAreas)(((((WeifenLuo.WinFormsUI.DockAreas.DockLeft | WeifenLuo.WinFormsUI.DockAreas.DockRight | WeifenLuo.WinFormsUI.DockAreas.Float)
| WeifenLuo.WinFormsUI.DockAreas.DockTop)
| WeifenLuo.WinFormsUI.DockAreas.DockBottom)
| WeifenLuo.WinFormsUI.DockAreas.Document)));
this.DockPadding.Top = 4;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Menu = this.mainMenu;
this.Name = "DummyDoc";
this.TabPageContextMenu = this.contextMenuTabPage;
@ -139,6 +256,7 @@ namespace DockSample @@ -139,6 +256,7 @@ namespace DockSample
}
#endregion
#endif
private string m_fileName = string.Empty;
public string FileName
@ -195,5 +313,12 @@ namespace DockSample @@ -195,5 +313,12 @@ namespace DockSample
{
menuItemCheckTest.Checked = !menuItemCheckTest.Checked;
}
protected override void OnTextChanged(EventArgs e)
{
base.OnTextChanged (e);
if (FileName == string.Empty)
this.richTextBox1.Text = Text;
}
}
}

27
src/Libraries/DockPanel_Src/DockSample/DummyDoc.resx

@ -160,11 +160,20 @@ @@ -160,11 +160,20 @@
<data name="menuItem5.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="toolTip.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="toolTip.Location" type="System.Drawing.Point, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>279, 17</value>
</data>
<data name="toolTip.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>80</value>
</data>
<data name="$this.Name">
<value>DummyDoc</value>
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
@ -184,10 +193,20 @@ @@ -184,10 +193,20 @@
<data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
<data name="$this.Name">
<value>DummyDoc</value>
</data>
<data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>(Default)</value>
</data>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAEBAQAAAAAAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAgAAAAAAAAAAAAAAAEAAAABAA
AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAgICAAMDAwAAAAP8AAP8AAAD//wD/AAAA/wD/AP//
AAD///8AAAAAAAAAAAAAeIiIiIiIAAB///////gAAH+IiIiI+AAAf//////4AAB/iIiIiPgAAH//////
+AAAf4iIiIj4AAB///////gAAH+IiIiI+AAAf/////+IAAB/iIiI8AAAAH/////3BwAAf/////dwAAB3
d3d3dwAAAAAAAAAAAADAAQAAwAEAAMABAADAAQAAwAEAAMABAADAAQAAwAEAAMABAADAAQAAwAEAAMAB
AADACwAAwAcAAMAPAAD//wAA
</value>
</data>
</root>

1
src/Libraries/DockPanel_Src/DockSample/DummyOutputWindow.cs

@ -120,7 +120,6 @@ Building satellite assemblies... @@ -120,7 +120,6 @@ Building satellite assemblies...
//
// DummyOutputWindow
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(255, 365);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.comboBox);

1
src/Libraries/DockPanel_Src/DockSample/DummyPropertyWindow.cs

@ -111,7 +111,6 @@ namespace DockSample @@ -111,7 +111,6 @@ namespace DockSample
//
// DummyPropertyWindow
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(208, 289);
this.Controls.Add(this.comboBox);
this.Controls.Add(this.propertyGrid);

4
src/Libraries/DockPanel_Src/DockSample/DummySolutionExplorer.cs

@ -150,11 +150,9 @@ namespace DockSample @@ -150,11 +150,9 @@ namespace DockSample
//
// DummySolutionExplorer
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(245, 322);
this.Controls.Add(this.treeView1);
this.DockableAreas = ((WeifenLuo.WinFormsUI.DockAreas)(((((WeifenLuo.WinFormsUI.DockAreas.Float | WeifenLuo.WinFormsUI.DockAreas.DockLeft)
| WeifenLuo.WinFormsUI.DockAreas.DockRight)
this.DockableAreas = ((WeifenLuo.WinFormsUI.DockAreas)((((WeifenLuo.WinFormsUI.DockAreas.DockLeft | WeifenLuo.WinFormsUI.DockAreas.DockRight)
| WeifenLuo.WinFormsUI.DockAreas.DockTop)
| WeifenLuo.WinFormsUI.DockAreas.DockBottom)));
this.DockPadding.Bottom = 1;

1
src/Libraries/DockPanel_Src/DockSample/DummyTaskList.cs

@ -126,7 +126,6 @@ namespace DockSample @@ -126,7 +126,6 @@ namespace DockSample
| WeifenLuo.WinFormsUI.DockAreas.DockRight)
| WeifenLuo.WinFormsUI.DockAreas.DockTop)
| WeifenLuo.WinFormsUI.DockAreas.DockBottom);
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(337, 376);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.listView1});

3
src/Libraries/DockPanel_Src/DockSample/DummyToolbox.cs

@ -97,6 +97,7 @@ namespace DockSample @@ -97,6 +97,7 @@ namespace DockSample
//
this.inertButtonGeneral.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.inertButtonGeneral.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.inertButtonGeneral.IsPopup = true;
this.inertButtonGeneral.Location = new System.Drawing.Point(2, 3);
this.inertButtonGeneral.Name = "inertButtonGeneral";
@ -142,7 +143,6 @@ namespace DockSample @@ -142,7 +143,6 @@ namespace DockSample
//
// DummyToolbox
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(221, 365);
this.Controls.Add(this.label2);
this.Controls.Add(this.inertButtonDown);
@ -158,6 +158,7 @@ namespace DockSample @@ -158,6 +158,7 @@ namespace DockSample
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "DummyToolbox";
this.ShowHint = WeifenLuo.WinFormsUI.DockState.DockLeftAutoHide;
this.TabText = "Toolbox";
this.Text = "Toolbox";
this.ResumeLayout(false);

20
src/Libraries/DockPanel_Src/DockSample/DummyToolbox.resx

@ -97,15 +97,15 @@ @@ -97,15 +97,15 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="inertButtonUp.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="inertButtonUp.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="inertButtonUp.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="inertButtonUp.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="inertButtonUp.ImageDisabled" type="System.Drawing.Bitmap, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
@ -138,16 +138,13 @@ @@ -138,16 +138,13 @@
wAYABf8BwAYABf8BwAYABf8BwAYABf8BwAYABf8BwBwACw==
</value>
</data>
<data name="inertButtonGeneral.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="inertButtonGeneral.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="inertButtonGeneral.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="inertButtonDown.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<data name="inertButtonGeneral.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="inertButtonDown.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@ -156,6 +153,9 @@ @@ -156,6 +153,9 @@
<data name="inertButtonDown.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="inertButtonDown.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="inertButtonDown.ImageDisabled" type="System.Drawing.Bitmap, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
@ -225,6 +225,9 @@ @@ -225,6 +225,9 @@
<data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>80</value>
</data>
<data name="$this.Name">
<value>DummyToolbox</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
@ -246,9 +249,6 @@ @@ -246,9 +249,6 @@
<data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="$this.Name">
<value>DummyToolbox</value>
</data>
<data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>(Default)</value>
</data>

109
src/Libraries/DockPanel_Src/DockSample/Extender/Extender.cs

@ -0,0 +1,109 @@ @@ -0,0 +1,109 @@
// *****************************************************************************
//
// Copyright 2004, Weifen Luo
// All rights reserved. The software and associated documentation
// supplied hereunder are the proprietary information of Weifen Luo
// and are supplied subject to licence terms.
//
// WinFormsUI Library Version 1.0
// *****************************************************************************
using System;
using System.Drawing;
using WeifenLuo.WinFormsUI;
namespace DockSample
{
public class Extender
{
public enum Schema
{
Default,
Override,
FromBase
}
private class DockPaneStripOverrideFactory : DockPanelExtender.IDockPaneStripFactory
{
public DockPaneStripBase CreateDockPaneStrip(DockPane pane)
{
return new DockPaneStripOverride(pane);
}
}
private class AutoHideStripOverrideFactory : DockPanelExtender.IAutoHideStripFactory
{
public AutoHideStripBase CreateAutoHideStrip(DockPanel panel)
{
return new AutoHideStripOverride(panel);
}
}
private class DockPaneCaptionFromBaseFactory : DockPanelExtender.IDockPaneCaptionFactory
{
public DockPaneCaptionBase CreateDockPaneCaption(DockPane pane)
{
return new DockPaneCaptionFromBase(pane);
}
}
private class DockPaneTabFromBaseFactory : DockPanelExtender.IDockPaneTabFactory
{
public DockPaneTab CreateDockPaneTab(IDockContent content)
{
return new DockPaneTabFromBase(content);
}
}
private class DockPaneStripFromBaseFactory : DockPanelExtender.IDockPaneStripFactory
{
public DockPaneStripBase CreateDockPaneStrip(DockPane pane)
{
return new DockPaneStripFromBase(pane);
}
}
private class AutoHideTabFromBaseFactory : DockPanelExtender.IAutoHideTabFactory
{
public AutoHideTab CreateAutoHideTab(IDockContent content)
{
return new AutoHideTabFromBase(content);
}
}
private class AutoHideStripFromBaseFactory : DockPanelExtender.IAutoHideStripFactory
{
public AutoHideStripBase CreateAutoHideStrip(DockPanel panel)
{
return new AutoHideStripFromBase(panel);
}
}
public static void SetSchema(DockPanel dockPanel, Extender.Schema schema)
{
if (schema == Extender.Schema.Default)
{
dockPanel.Extender.AutoHideTabFactory = null;
dockPanel.Extender.DockPaneTabFactory = null;
dockPanel.Extender.AutoHideStripFactory = null;
dockPanel.Extender.DockPaneCaptionFactory = null;
dockPanel.Extender.DockPaneStripFactory = null;
}
else if (schema == Extender.Schema.Override)
{
dockPanel.Extender.AutoHideTabFactory = null;
dockPanel.Extender.DockPaneTabFactory = null;
dockPanel.Extender.DockPaneCaptionFactory = null;
dockPanel.Extender.AutoHideStripFactory = new AutoHideStripOverrideFactory();
dockPanel.Extender.DockPaneStripFactory = new DockPaneStripOverrideFactory();
}
else if (schema == Extender.Schema.FromBase)
{
dockPanel.Extender.AutoHideTabFactory = new AutoHideTabFromBaseFactory();
dockPanel.Extender.DockPaneTabFactory = new DockPaneTabFromBaseFactory();
dockPanel.Extender.AutoHideStripFactory = new AutoHideStripFromBaseFactory();
dockPanel.Extender.DockPaneCaptionFactory = new DockPaneCaptionFromBaseFactory();
dockPanel.Extender.DockPaneStripFactory = new DockPaneStripFromBaseFactory();
}
}
}
}

465
src/Libraries/DockPanel_Src/DockSample/Extender/FromBase/AutoHideStripFromBase.cs

@ -0,0 +1,465 @@ @@ -0,0 +1,465 @@
// *****************************************************************************
//
// Copyright 2004, Weifen Luo
// All rights reserved. The software and associated documentation
// supplied hereunder are the proprietary information of Weifen Luo
// and are supplied subject to licence terms.
//
// WinFormsUI Library Version 1.0
// *****************************************************************************
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using WeifenLuo.WinFormsUI;
namespace DockSample
{
public class AutoHideStripFromBase : AutoHideStripBase
{
private const int _ImageHeight = 16;
private const int _ImageWidth = 16;
private const int _ImageGapTop = 2;
private const int _ImageGapLeft = 4;
private const int _ImageGapRight = 4;
private const int _ImageGapBottom = 2;
private const int _TextGapLeft = 4;
private const int _TextGapRight = 10;
private const int _TabGapTop = 3;
private const int _TabGapLeft = 2;
private const int _TabGapBetween = 10;
private static StringFormat _stringFormatTabHorizontal;
private static StringFormat _stringFormatTabVertical;
private static Matrix _matrixIdentity;
private static DockState[] _dockStates;
#region Customizable Properties
protected virtual StringFormat StringFormatTabHorizontal
{
get { return _stringFormatTabHorizontal; }
}
protected virtual StringFormat StringFormatTabVertical
{
get { return _stringFormatTabVertical; }
}
protected virtual int ImageHeight
{
get { return _ImageHeight; }
}
protected virtual int ImageWidth
{
get { return _ImageWidth; }
}
protected virtual int ImageGapTop
{
get { return _ImageGapTop; }
}
protected virtual int ImageGapLeft
{
get { return _ImageGapLeft; }
}
protected virtual int ImageGapRight
{
get { return _ImageGapRight; }
}
protected virtual int ImageGapBottom
{
get { return _ImageGapBottom; }
}
protected virtual int TextGapLeft
{
get { return _TextGapLeft; }
}
protected virtual int TextGapRight
{
get { return _TextGapRight; }
}
protected virtual int TabGapTop
{
get { return _TabGapTop; }
}
protected virtual int TabGapLeft
{
get { return _TabGapLeft; }
}
protected virtual int TabGapBetween
{
get { return _TabGapBetween; }
}
protected virtual void BeginDrawTab()
{
}
protected virtual void EndDrawTab()
{
}
protected virtual Brush BrushTabBackGround
{
get { return SystemBrushes.Control; }
}
protected virtual Pen PenTabBorder
{
get { return SystemPens.GrayText; }
}
protected virtual Brush BrushTabText
{
get { return SystemBrushes.FromSystemColor(SystemColors.ControlDarkDark); }
}
#endregion
private Matrix MatrixIdentity
{
get { return _matrixIdentity; }
}
private DockState[] DockStates
{
get { return _dockStates; }
}
static AutoHideStripFromBase()
{
_stringFormatTabHorizontal = new StringFormat();
_stringFormatTabHorizontal.Alignment = StringAlignment.Near;
_stringFormatTabHorizontal.LineAlignment = StringAlignment.Center;
_stringFormatTabHorizontal.FormatFlags = StringFormatFlags.NoWrap;
_stringFormatTabVertical = new StringFormat();
_stringFormatTabVertical.Alignment = StringAlignment.Near;
_stringFormatTabVertical.LineAlignment = StringAlignment.Center;
_stringFormatTabVertical.FormatFlags = StringFormatFlags.NoWrap | StringFormatFlags.DirectionVertical;
_matrixIdentity = new Matrix();
_dockStates = new DockState[4];
_dockStates[0] = DockState.DockLeftAutoHide;
_dockStates[1] = DockState.DockRightAutoHide;
_dockStates[2] = DockState.DockTopAutoHide;
_dockStates[3] = DockState.DockBottomAutoHide;
}
protected internal AutoHideStripFromBase(DockPanel panel) : base(panel)
{
SetStyle(ControlStyles.ResizeRedraw, true);
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
#if FRAMEWORK_VER_2x
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
#else
SetStyle(ControlStyles.DoubleBuffer, true);
#endif
BackColor = Color.WhiteSmoke;
}
protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics;
using (LinearGradientBrush brush = new LinearGradientBrush(ClientRectangle, SystemColors.ControlLight, Color.WhiteSmoke, LinearGradientMode.ForwardDiagonal))
{
g.FillRectangle(brush, ClientRectangle);
}
DrawTabStrip(g);
}
protected override void OnLayout(LayoutEventArgs levent)
{
CalculateTabs();
base.OnLayout (levent);
}
private void DrawTabStrip(Graphics g)
{
DrawTabStrip(g, DockState.DockTopAutoHide);
DrawTabStrip(g, DockState.DockBottomAutoHide);
DrawTabStrip(g, DockState.DockLeftAutoHide);
DrawTabStrip(g, DockState.DockRightAutoHide);
}
private void DrawTabStrip(Graphics g, DockState dockState)
{
Rectangle rectTabStrip = GetLogicalTabStripRectangle(dockState);
if (rectTabStrip.IsEmpty)
return;
Matrix matrixIdentity = g.Transform;
if (dockState == DockState.DockLeftAutoHide || dockState == DockState.DockRightAutoHide)
{
Matrix matrixRotated = new Matrix();
matrixRotated.RotateAt(90, new PointF((float)rectTabStrip.X + (float)rectTabStrip.Height / 2,
(float)rectTabStrip.Y + (float)rectTabStrip.Height / 2));
g.Transform = matrixRotated;
}
foreach (AutoHidePane pane in GetPanes(dockState))
{
foreach (AutoHideTabFromBase tab in pane.Tabs)
DrawTab(g, tab);
}
g.Transform = matrixIdentity;
}
private void CalculateTabs()
{
CalculateTabs(DockState.DockTopAutoHide);
CalculateTabs(DockState.DockBottomAutoHide);
CalculateTabs(DockState.DockLeftAutoHide);
CalculateTabs(DockState.DockRightAutoHide);
}
private void CalculateTabs(DockState dockState)
{
Rectangle rectTabStrip = GetLogicalTabStripRectangle(dockState);
int imageHeight = rectTabStrip.Height - ImageGapTop - ImageGapBottom;
int imageWidth = ImageWidth;
if (imageHeight > ImageHeight)
imageWidth = ImageWidth * (imageHeight/ImageHeight);
using (Graphics g = CreateGraphics())
{
int x = TabGapLeft + rectTabStrip.X;
foreach (AutoHidePane pane in GetPanes(dockState))
{
int maxWidth = 0;
foreach (AutoHideTabFromBase tab in pane.Tabs)
{
int width = imageWidth + ImageGapLeft + ImageGapRight +
(int)g.MeasureString(tab.Content.DockHandler.TabText, Font).Width + 1 +
TextGapLeft + TextGapRight;
if (width > maxWidth)
maxWidth = width;
}
foreach (AutoHideTabFromBase tab in pane.Tabs)
{
tab.TabX = x;
if (tab.Content == pane.DockPane.ActiveContent)
tab.TabWidth = maxWidth;
else
tab.TabWidth = imageWidth + ImageGapLeft + ImageGapRight;
x += tab.TabWidth;
}
x += TabGapBetween;
}
}
}
private void DrawTab(Graphics g, AutoHideTabFromBase tab)
{
Rectangle rectTab = GetTabRectangle(tab);
if (rectTab.IsEmpty)
return;
DockState dockState = tab.Content.DockHandler.DockState;
IDockContent content = tab.Content;
BeginDrawTab();
Brush brushTabBackGround = BrushTabBackGround;
Pen penTabBorder = PenTabBorder;
Brush brushTabText = BrushTabText;
g.FillRectangle(brushTabBackGround, rectTab);
g.DrawLine(penTabBorder, rectTab.Left, rectTab.Top, rectTab.Left, rectTab.Bottom);
g.DrawLine(penTabBorder, rectTab.Right, rectTab.Top, rectTab.Right, rectTab.Bottom);
if (dockState == DockState.DockTopAutoHide || dockState == DockState.DockRightAutoHide)
g.DrawLine(penTabBorder, rectTab.Left, rectTab.Bottom, rectTab.Right, rectTab.Bottom);
else
g.DrawLine(penTabBorder, rectTab.Left, rectTab.Top, rectTab.Right, rectTab.Top);
// Set no rotate for drawing icon and text
Matrix matrixRotate = g.Transform;
g.Transform = MatrixIdentity;
// Draw the icon
Rectangle rectImage = rectTab;
rectImage.X += ImageGapLeft;
rectImage.Y += ImageGapTop;
int imageHeight = rectTab.Height - ImageGapTop - ImageGapBottom;
int imageWidth = ImageWidth;
if (imageHeight > ImageHeight)
imageWidth = ImageWidth * (imageHeight/ImageHeight);
rectImage.Height = imageHeight;
rectImage.Width = imageWidth;
rectImage = GetTransformedRectangle(dockState, rectImage);
g.DrawIcon(content.DockHandler.Icon, rectImage);
// Draw the text
if (content == content.DockHandler.Pane.ActiveContent)
{
Rectangle rectText = rectTab;
rectText.X += ImageGapLeft + imageWidth + ImageGapRight + TextGapLeft;
rectText.Width -= ImageGapLeft + imageWidth + ImageGapRight + TextGapLeft;
rectText = GetTransformedRectangle(dockState, rectText);
if (dockState == DockState.DockLeftAutoHide || dockState == DockState.DockRightAutoHide)
g.DrawString(content.DockHandler.TabText, Font, brushTabText, rectText, StringFormatTabVertical);
else
g.DrawString(content.DockHandler.TabText, Font, brushTabText, rectText, StringFormatTabHorizontal);
}
// Set rotate back
g.Transform = matrixRotate;
EndDrawTab();
}
private Rectangle GetLogicalTabStripRectangle(DockState dockState)
{
return GetLogicalTabStripRectangle(dockState, false);
}
private Rectangle GetLogicalTabStripRectangle(DockState dockState, bool transformed)
{
if (!DockHelper.IsDockStateAutoHide(dockState))
return Rectangle.Empty;
int leftPanes = GetPanes(DockState.DockLeftAutoHide).Count;
int rightPanes = GetPanes(DockState.DockRightAutoHide).Count;
int topPanes = GetPanes(DockState.DockTopAutoHide).Count;
int bottomPanes = GetPanes(DockState.DockBottomAutoHide).Count;
int x, y, width, height;
height = MeasureHeight();
if (dockState == DockState.DockLeftAutoHide && leftPanes > 0)
{
x = 0;
y = (topPanes == 0) ? 0 : height;
width = Height - (topPanes == 0 ? 0 : height) - (bottomPanes == 0 ? 0 :height);
}
else if (dockState == DockState.DockRightAutoHide && rightPanes > 0)
{
x = Width - height;
if (leftPanes != 0 && x < height)
x = height;
y = (topPanes == 0) ? 0 : height;
width = Height - (topPanes == 0 ? 0 : height) - (bottomPanes == 0 ? 0 :height);
}
else if (dockState == DockState.DockTopAutoHide && topPanes > 0)
{
x = leftPanes == 0 ? 0 : height;
y = 0;
width = Width - (leftPanes == 0 ? 0 : height) - (rightPanes == 0 ? 0 : height);
}
else if (dockState == DockState.DockBottomAutoHide && bottomPanes > 0)
{
x = leftPanes == 0 ? 0 : height;
y = Height - height;
if (topPanes != 0 && y < height)
y = height;
width = Width - (leftPanes == 0 ? 0 : height) - (rightPanes == 0 ? 0 : height);
}
else
return Rectangle.Empty;
if (!transformed)
return new Rectangle(x, y, width, height);
else
return GetTransformedRectangle(dockState, new Rectangle(x, y, width, height));
}
private Rectangle GetTabRectangle(AutoHideTabFromBase tab)
{
return GetTabRectangle(tab, false);
}
private Rectangle GetTabRectangle(AutoHideTabFromBase tab, bool transformed)
{
DockState dockState = tab.Content.DockHandler.DockState;
Rectangle rectTabStrip = GetLogicalTabStripRectangle(dockState);
if (rectTabStrip.IsEmpty)
return Rectangle.Empty;
int x = tab.TabX;
int y = rectTabStrip.Y +
(dockState == DockState.DockTopAutoHide || dockState == DockState.DockRightAutoHide ?
0 : TabGapTop);
int width = ((AutoHideTabFromBase)tab).TabWidth;
int height = rectTabStrip.Height - TabGapTop;
if (!transformed)
return new Rectangle(x, y, width, height);
else
return GetTransformedRectangle(dockState, new Rectangle(x, y, width, height));
}
private Rectangle GetTransformedRectangle(DockState dockState, Rectangle rect)
{
if (dockState != DockState.DockLeftAutoHide && dockState != DockState.DockRightAutoHide)
return rect;
PointF[] pts = new PointF[1];
// the center of the rectangle
pts[0].X = (float)rect.X + (float)rect.Width / 2;
pts[0].Y = (float)rect.Y + (float)rect.Height / 2;
Rectangle rectTabStrip = GetLogicalTabStripRectangle(dockState);
Matrix matrix = new Matrix();
matrix.RotateAt(90, new PointF((float)rectTabStrip.X + (float)rectTabStrip.Height / 2,
(float)rectTabStrip.Y + (float)rectTabStrip.Height / 2));
matrix.TransformPoints(pts);
return new Rectangle((int)(pts[0].X - (float)rect.Height / 2 + .5F),
(int)(pts[0].Y - (float)rect.Width / 2 + .5F),
rect.Height, rect.Width);
}
protected override IDockContent GetHitTest(Point ptMouse)
{
foreach(DockState state in DockStates)
{
Rectangle rectTabStrip = GetLogicalTabStripRectangle(state, true);
if (!rectTabStrip.Contains(ptMouse))
continue;
foreach(AutoHidePane pane in GetPanes(state))
{
foreach(AutoHideTabFromBase tab in pane.Tabs)
{
Rectangle rectTab = GetTabRectangle(tab, true);
rectTab.Intersect(rectTabStrip);
if (rectTab.Contains(ptMouse))
return tab.Content;
}
}
}
return null;
}
protected override int MeasureHeight()
{
return Math.Max(ImageGapBottom +
ImageGapTop + ImageHeight,
Font.Height) + TabGapTop;
}
protected override void OnRefreshChanges()
{
CalculateTabs();
Invalidate();
}
}
}

37
src/Libraries/DockPanel_Src/DockSample/Extender/FromBase/AutoHideTabFromBase.cs

@ -0,0 +1,37 @@ @@ -0,0 +1,37 @@
// *****************************************************************************
//
// Copyright 2004, Weifen Luo
// All rights reserved. The software and associated documentation
// supplied hereunder are the proprietary information of Weifen Luo
// and are supplied subject to licence terms.
//
// WinFormsUI Library Version 1.0
// *****************************************************************************
using System;
using System.Drawing;
using WeifenLuo.WinFormsUI;
namespace DockSample
{
internal class AutoHideTabFromBase : AutoHideTab
{
internal AutoHideTabFromBase(IDockContent content) : base(content)
{
}
private int m_tabX = 0;
protected internal int TabX
{
get { return m_tabX; }
set { m_tabX = value; }
}
private int m_tabWidth = 0;
protected internal int TabWidth
{
get { return m_tabWidth; }
set { m_tabWidth = value; }
}
}
}

338
src/Libraries/DockPanel_Src/DockSample/Extender/FromBase/DockPaneCaptionFromBase.cs

@ -0,0 +1,338 @@ @@ -0,0 +1,338 @@
// *****************************************************************************
//
// Copyright 2004, Weifen Luo
// All rights reserved. The software and associated documentation
// supplied hereunder are the proprietary information of Weifen Luo
// and are supplied subject to licence terms.
//
// WinFormsUI Library Version 1.0
// *****************************************************************************
using System;
using System.Drawing;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI;
using System.Drawing.Drawing2D;
namespace DockSample
{
public class DockPaneCaptionFromBase : DockPaneCaptionBase
{
#region consts
private const int _TextGapTop = 2;
private const int _TextGapBottom = 0;
private const int _TextGapLeft = 3;
private const int _TextGapRight = 3;
private const int _ButtonGapTop = 2;
private const int _ButtonGapBottom = 1;
private const int _ButtonGapBetween = 1;
private const int _ButtonGapLeft = 1;
private const int _ButtonGapRight = 2;
private const string _ResourceImageCloseEnabled = "DockPaneCaption.CloseEnabled.bmp";
private const string _ResourceImageCloseDisabled = "DockPaneCaption.CloseDisabled.bmp";
private const string _ResourceImageAutoHideYes = "DockPaneCaption.AutoHideYes.bmp";
private const string _ResourceImageAutoHideNo = "DockPaneCaption.AutoHideNo.bmp";
private const string _ResourceToolTipClose = "DockPaneCaption.ToolTipClose";
private const string _ResourceToolTipAutoHide = "DockPaneCaption.ToolTipAutoHide";
#endregion
private InertButton m_buttonClose;
private InertButton m_buttonAutoHide;
protected internal DockPaneCaptionFromBase(DockPane pane) : base(pane)
{
SuspendLayout();
Font = SystemInformation.MenuFont;
m_buttonClose = new InertButton(ImageCloseEnabled, ImageCloseDisabled);
m_buttonAutoHide = new InertButton();
m_buttonClose.ToolTipText = ToolTipClose;
m_buttonClose.Anchor = AnchorStyles.Top | AnchorStyles.Right;
m_buttonClose.Click += new EventHandler(this.Close_Click);
m_buttonAutoHide.ToolTipText = ToolTipAutoHide;
m_buttonAutoHide.Anchor = AnchorStyles.Top | AnchorStyles.Right;
m_buttonAutoHide.Click += new EventHandler(AutoHide_Click);
Controls.AddRange(new Control[] { m_buttonClose, m_buttonAutoHide });
ResumeLayout();
}
#region Customizable Properties
protected virtual int TextGapTop
{
get { return _TextGapTop; }
}
protected virtual int TextGapBottom
{
get { return _TextGapBottom; }
}
protected virtual int TextGapLeft
{
get { return _TextGapLeft; }
}
protected virtual int TextGapRight
{
get { return _TextGapRight; }
}
protected virtual int ButtonGapTop
{
get { return _ButtonGapTop; }
}
protected virtual int ButtonGapBottom
{
get { return _ButtonGapBottom; }
}
protected virtual int ButtonGapLeft
{
get { return _ButtonGapLeft; }
}
protected virtual int ButtonGapRight
{
get { return _ButtonGapRight; }
}
protected virtual int ButtonGapBetween
{
get { return _ButtonGapBetween; }
}
private static Image _imageCloseEnabled = null;
protected virtual Image ImageCloseEnabled
{
get
{
if (_imageCloseEnabled == null)
_imageCloseEnabled = ResourceHelper.LoadBitmap(_ResourceImageCloseEnabled);
return _imageCloseEnabled;
}
}
private static Image _imageCloseDisabled = null;
protected virtual Image ImageCloseDisabled
{
get
{
if (_imageCloseDisabled == null)
_imageCloseDisabled = ResourceHelper.LoadBitmap(_ResourceImageCloseDisabled);
return _imageCloseDisabled;
}
}
private static Image _imageAutoHideYes = null;
protected virtual Image ImageAutoHideYes
{
get
{
if (_imageAutoHideYes == null)
_imageAutoHideYes = ResourceHelper.LoadBitmap(_ResourceImageAutoHideYes);
return _imageAutoHideYes;
}
}
private static Image _imageAutoHideNo = null;
protected virtual Image ImageAutoHideNo
{
get
{
if (_imageAutoHideNo == null)
_imageAutoHideNo = ResourceHelper.LoadBitmap(_ResourceImageAutoHideNo);
return _imageAutoHideNo;
}
}
private static string _toolTipClose = null;
protected virtual string ToolTipClose
{
get
{
if (_toolTipClose == null)
_toolTipClose = ResourceHelper.GetString(_ResourceToolTipClose);
return _toolTipClose;
}
}
private static string _toolTipAutoHide = null;
protected virtual string ToolTipAutoHide
{
get
{
if (_toolTipAutoHide == null)
_toolTipAutoHide = ResourceHelper.GetString(_ResourceToolTipAutoHide);
return _toolTipAutoHide;
}
}
protected virtual Color ActiveBackColor
{
get { return SystemColors.ActiveCaption; }
}
protected virtual Color InactiveBackColor
{
get { return SystemColors.Control; }
}
protected virtual Color ActiveTextColor
{
get { return SystemColors.ActiveCaptionText; }
}
protected virtual Color InactiveTextColor
{
get { return SystemColors.ControlText; }
}
protected virtual Color InactiveBorderColor
{
get { return SystemColors.GrayText; }
}
protected virtual Color ActiveButtonBorderColor
{
get { return ActiveTextColor; }
}
protected virtual Color InactiveButtonBorderColor
{
get { return Color.Empty; }
}
private static StringFormat _textStringFormat = null;
protected virtual StringFormat TextStringFormat
{
get
{
if (_textStringFormat == null)
{
_textStringFormat = new StringFormat();
_textStringFormat.Trimming = StringTrimming.EllipsisCharacter;
_textStringFormat.LineAlignment = StringAlignment.Center;
_textStringFormat.FormatFlags = StringFormatFlags.NoWrap;
}
return _textStringFormat;
}
}
#endregion
protected override int MeasureHeight()
{
int height = Font.Height + TextGapTop + TextGapBottom;
if (height < ImageCloseEnabled.Height + ButtonGapTop + ButtonGapBottom)
height = ImageCloseEnabled.Height + ButtonGapTop + ButtonGapBottom;
return height;
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint (e);
if (DockPane.IsActivated)
{
using (LinearGradientBrush brush = new LinearGradientBrush(ClientRectangle, Color.Blue, SystemColors.ActiveCaption, LinearGradientMode.Horizontal))
{
e.Graphics.FillRectangle(brush, ClientRectangle);
}
}
DrawCaption(e.Graphics);
}
private void DrawCaption(Graphics g)
{
BackColor = DockPane.IsActivated ? ActiveBackColor : InactiveBackColor;
Rectangle rectCaption = ClientRectangle;
if (!DockPane.IsActivated)
{
using (Pen pen = new Pen(InactiveBorderColor))
{
g.DrawLine(pen, rectCaption.X + 1, rectCaption.Y, rectCaption.X + rectCaption.Width - 2, rectCaption.Y);
g.DrawLine(pen, rectCaption.X + 1, rectCaption.Y + rectCaption.Height - 1, rectCaption.X + rectCaption.Width - 2, rectCaption.Y + rectCaption.Height - 1);
g.DrawLine(pen, rectCaption.X, rectCaption.Y + 1, rectCaption.X, rectCaption.Y + rectCaption.Height - 2);
g.DrawLine(pen, rectCaption.X + rectCaption.Width - 1, rectCaption.Y + 1, rectCaption.X + rectCaption.Width - 1, rectCaption.Y + rectCaption.Height - 2);
}
}
m_buttonClose.ForeColor = m_buttonAutoHide.ForeColor = (DockPane.IsActivated ? ActiveTextColor : InactiveTextColor);
m_buttonClose.BorderColor = m_buttonAutoHide.BorderColor = (DockPane.IsActivated ? ActiveButtonBorderColor : InactiveButtonBorderColor);
Rectangle rectCaptionText = rectCaption;
rectCaptionText.X += TextGapLeft;
rectCaptionText.Width = rectCaption.Width - ButtonGapRight
- ButtonGapLeft
- ButtonGapBetween - 2 * m_buttonClose.Width
- TextGapLeft - TextGapRight;
rectCaptionText.Y += TextGapTop;
rectCaptionText.Height -= TextGapTop + TextGapBottom;
using (Brush brush = new SolidBrush(DockPane.IsActivated ? ActiveTextColor : InactiveTextColor))
{
g.DrawString(DockPane.CaptionText, Font, brush, rectCaptionText, TextStringFormat);
}
}
protected override void OnLayout(LayoutEventArgs levent)
{
// set the size and location for close and auto-hide buttons
Rectangle rectCaption = ClientRectangle;
int buttonWidth = ImageCloseEnabled.Width;
int buttonHeight = ImageCloseEnabled.Height;
int height = rectCaption.Height - ButtonGapTop - ButtonGapBottom;
if (buttonHeight < height)
{
buttonWidth = buttonWidth * (height / buttonHeight);
buttonHeight = height;
}
m_buttonClose.SuspendLayout();
m_buttonAutoHide.SuspendLayout();
Size buttonSize = new Size(buttonWidth, buttonHeight);
m_buttonClose.Size = m_buttonAutoHide.Size = buttonSize;
int x = rectCaption.X + rectCaption.Width - 1 - ButtonGapRight - m_buttonClose.Width;
int y = rectCaption.Y + ButtonGapTop;
Point point = m_buttonClose.Location = new Point(x, y);
point.Offset(-(m_buttonAutoHide.Width + ButtonGapBetween), 0);
m_buttonAutoHide.Location = point;
m_buttonClose.ResumeLayout();
m_buttonAutoHide.ResumeLayout();
base.OnLayout (levent);
}
protected override void OnRefreshChanges()
{
SetButtons();
Invalidate();
}
private void SetButtons()
{
m_buttonClose.Enabled = (DockPane.ActiveContent != null)? DockPane.ActiveContent.DockHandler.CloseButton : false;
m_buttonAutoHide.Visible = !DockPane.IsFloat;
m_buttonAutoHide.ImageEnabled = DockPane.IsAutoHide ? ImageAutoHideYes : ImageAutoHideNo;
}
private void Close_Click(object sender, EventArgs e)
{
DockPane.CloseActiveContent();
}
private void AutoHide_Click(object sender, EventArgs e)
{
DockPane.DockState = DockHelper.ToggleAutoHideState(DockPane.DockState);
if (!DockPane.IsAutoHide)
DockPane.Activate();
}
}
}

977
src/Libraries/DockPanel_Src/DockSample/Extender/FromBase/DockPaneStripFromBase.cs

@ -0,0 +1,977 @@ @@ -0,0 +1,977 @@
// *****************************************************************************
//
// Copyright 2004, Weifen Luo
// All rights reserved. The software and associated documentation
// supplied hereunder are the proprietary information of Weifen Luo
// and are supplied subject to licence terms.
//
// WinFormsUI Library Version 1.0
// *****************************************************************************
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
using System.ComponentModel;
using WeifenLuo.WinFormsUI;
namespace DockSample
{
public class DockPaneStripFromBase : DockPaneStripBase
{
#region consts
private const int _ToolWindowStripGapLeft = 4;
private const int _ToolWindowStripGapRight = 3;
private const int _ToolWindowImageHeight = 16;
private const int _ToolWindowImageWidth = 16;
private const int _ToolWindowImageGapTop = 3;
private const int _ToolWindowImageGapBottom = 1;
private const int _ToolWindowImageGapLeft = 3;
private const int _ToolWindowImageGapRight = 2;
private const int _ToolWindowTextGapRight = 1;
private const int _ToolWindowTabSeperatorGapTop = 3;
private const int _ToolWindowTabSeperatorGapBottom = 3;
private const int _DocumentTabMaxWidth = 200;
private const int _DocumentButtonGapTop = 5;
private const int _DocumentButtonGapBottom = 5;
private const int _DocumentButtonGapBetween = 0;
private const int _DocumentButtonGapRight = 3;
private const int _DocumentTabGapTop = 3;
private const int _DocumentTabGapLeft = 3;
private const int _DocumentTabGapRight = 10;
private const int _DocumentTextExtraHeight = 6;
private const int _DocumentTextExtraWidth = 10;
private const string _ResourceImageCloseEnabled = "DockPaneStrip.CloseEnabled.bmp";
private const string _ResourceImageCloseDisabled = "DockPaneStrip.CloseDisabled.bmp";
private const string _ResourceImageScrollLeftEnabled = "DockPaneStrip.ScrollLeftEnabled.bmp";
private const string _ResourceImageScrollLeftDisabled = "DockPaneStrip.ScrollLeftDisabled.bmp";
private const string _ResourceImageScrollRightEnabled = "DockPaneStrip.ScrollRightEnabled.bmp";
private const string _ResourceImageScrollRightDisabled = "DockPaneStrip.ScrollRightDisabled.bmp";
private const string _ResourceToolTipClose = "DockPaneStrip.ToolTipClose";
private const string _ResourceToolTipScrollLeft = "DockPaneStrip.ToolTipScrollLeft";
private const string _ResourceToolTipScrollRight = "DockPaneStrip.ToolTipScrollRight";
#endregion
private InertButton m_buttonClose, m_buttonScrollLeft, m_buttonScrollRight;
private IContainer m_components;
private ToolTip m_toolTip;
/// <exclude/>
protected IContainer Components
{
get { return m_components; }
}
private int m_offsetX = 0;
private int OffsetX
{
get { return m_offsetX; }
set { m_offsetX = value; }
}
#region Customizable Properties
protected virtual int ToolWindowStripGapLeft
{
get { return _ToolWindowStripGapLeft; }
}
protected virtual int ToolWindowStripGapRight
{
get { return _ToolWindowStripGapRight; }
}
protected virtual int ToolWindowImageHeight
{
get { return _ToolWindowImageHeight; }
}
protected virtual int ToolWindowImageWidth
{
get { return _ToolWindowImageWidth; }
}
protected virtual int ToolWindowImageGapTop
{
get { return _ToolWindowImageGapTop; }
}
protected virtual int ToolWindowImageGapBottom
{
get { return _ToolWindowImageGapBottom; }
}
protected virtual int ToolWindowImageGapLeft
{
get { return _ToolWindowImageGapLeft; }
}
protected virtual int ToolWindowImageGapRight
{
get { return _ToolWindowImageGapRight; }
}
protected virtual int ToolWindowTextGapRight
{
get { return _ToolWindowTextGapRight; }
}
protected virtual int ToolWindowTabSeperatorGapTop
{
get { return _ToolWindowTabSeperatorGapTop; }
}
protected virtual int ToolWindowTabSeperatorGapBottom
{
get { return _ToolWindowTabSeperatorGapBottom; }
}
private static Image _imageCloseEnabled = null;
protected virtual Image ImageCloseEnabled
{
get
{
if (_imageCloseEnabled == null)
_imageCloseEnabled = ResourceHelper.LoadBitmap(_ResourceImageCloseEnabled);
return _imageCloseEnabled;
}
}
private static Image _imageCloseDisabled = null;
protected virtual Image ImageCloseDisabled
{
get
{
if (_imageCloseDisabled == null)
_imageCloseDisabled = ResourceHelper.LoadBitmap(_ResourceImageCloseDisabled);
return _imageCloseDisabled;
}
}
private static Image _imageScrollLeftEnabled = null;
protected virtual Image ImageScrollLeftEnabled
{
get
{
if (_imageScrollLeftEnabled == null)
_imageScrollLeftEnabled = ResourceHelper.LoadBitmap(_ResourceImageScrollLeftEnabled);
return _imageScrollLeftEnabled;
}
}
private static Image _imageScrollLeftDisabled = null;
protected virtual Image ImageScrollLeftDisabled
{
get
{
if (_imageScrollLeftDisabled == null)
_imageScrollLeftDisabled = ResourceHelper.LoadBitmap(_ResourceImageScrollLeftDisabled);
return _imageScrollLeftDisabled;
}
}
private static Image _imageScrollRightEnabled = null;
protected virtual Image ImageScrollRightEnabled
{
get
{
if (_imageScrollRightEnabled == null)
_imageScrollRightEnabled = ResourceHelper.LoadBitmap(_ResourceImageScrollRightEnabled);
return _imageScrollRightEnabled;
}
}
private static Image _imageScrollRightDisabled = null;
protected virtual Image ImageScrollRightDisabled
{
get
{
if (_imageScrollRightDisabled == null)
_imageScrollRightDisabled = ResourceHelper.LoadBitmap(_ResourceImageScrollRightDisabled);
return _imageScrollRightDisabled;
}
}
private static string _toolTipClose = null;
protected virtual string ToolTipClose
{
get
{
if (_toolTipClose == null)
_toolTipClose = ResourceHelper.GetString(_ResourceToolTipClose);
return _toolTipClose;
}
}
private static string _toolTipScrollLeft = null;
protected virtual string ToolTipScrollLeft
{
get
{
if (_toolTipScrollLeft == null)
_toolTipScrollLeft = ResourceHelper.GetString(_ResourceToolTipScrollLeft);
return _toolTipScrollLeft;
}
}
private static string _toolTipScrollRight = null;
protected virtual string ToolTipScrollRight
{
get
{
if (_toolTipScrollRight == null)
_toolTipScrollRight = ResourceHelper.GetString(_ResourceToolTipScrollRight);
return _toolTipScrollRight;
}
}
private static StringFormat _toolWindowTextStringFormat = null;
protected virtual StringFormat ToolWindowTextStringFormat
{
get
{
if (_toolWindowTextStringFormat == null)
{
_toolWindowTextStringFormat = new StringFormat(StringFormat.GenericTypographic);
_toolWindowTextStringFormat.Trimming = StringTrimming.EllipsisCharacter;
_toolWindowTextStringFormat.LineAlignment = StringAlignment.Center;
_toolWindowTextStringFormat.FormatFlags = StringFormatFlags.NoWrap;
}
return _toolWindowTextStringFormat;
}
}
private static StringFormat _documentTextStringFormat = null;
public static StringFormat DocumentTextStringFormat
{
get
{
if (_documentTextStringFormat == null)
{
_documentTextStringFormat = new StringFormat(StringFormat.GenericTypographic);
_documentTextStringFormat.Alignment = StringAlignment.Center;
_documentTextStringFormat.Trimming = StringTrimming.EllipsisPath;
_documentTextStringFormat.LineAlignment = StringAlignment.Center;
_documentTextStringFormat.FormatFlags = StringFormatFlags.NoWrap;
}
return _documentTextStringFormat;
}
}
protected virtual int DocumentTabMaxWidth
{
get { return _DocumentTabMaxWidth; }
}
protected virtual int DocumentButtonGapTop
{
get { return _DocumentButtonGapTop; }
}
protected virtual int DocumentButtonGapBottom
{
get { return _DocumentButtonGapBottom; }
}
protected virtual int DocumentButtonGapBetween
{
get { return _DocumentButtonGapBetween; }
}
protected virtual int DocumentButtonGapRight
{
get { return _DocumentButtonGapRight; }
}
protected virtual int DocumentTabGapTop
{
get { return _DocumentTabGapTop; }
}
protected virtual int DocumentTabGapLeft
{
get { return _DocumentTabGapLeft; }
}
protected virtual int DocumentTabGapRight
{
get { return _DocumentTabGapRight; }
}
protected virtual int DocumentTextExtraHeight
{
get { return _DocumentTextExtraHeight; }
}
protected virtual int DocumentTextExtraWidth
{
get { return _DocumentTextExtraWidth; }
}
protected virtual void OnBeginDrawTabStrip(DockPane.AppearanceStyle appearance)
{
}
protected virtual void OnEndDrawTabStrip(DockPane.AppearanceStyle appearance)
{
}
protected virtual void OnBeginDrawTab(DockPane.AppearanceStyle appearance)
{
}
protected virtual void OnEndDrawTab(DockPane.AppearanceStyle appearance)
{
}
protected virtual Pen OutlineInnerPen
{
get { return SystemPens.ControlText; }
}
protected virtual Pen OutlineOuterPen
{
get { return SystemPens.ActiveCaptionText; }
}
protected virtual Brush ActiveBackBrush
{
get { return SystemBrushes.Control; }
}
protected virtual Brush ActiveTextBrush
{
get { return SystemBrushes.ControlText; }
}
protected virtual Pen TabSeperatorPen
{
get { return SystemPens.GrayText; }
}
protected virtual Brush InactiveTextBrush
{
get { return SystemBrushes.FromSystemColor(SystemColors.ControlDarkDark); }
}
#endregion
protected internal DockPaneStripFromBase(DockPane pane) : base(pane)
{
SetStyle(ControlStyles.ResizeRedraw, true);
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
#if FRAMEWORK_VER_2x
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
#else
SetStyle(ControlStyles.DoubleBuffer, true);
#endif
SuspendLayout();
Font = SystemInformation.MenuFont;
BackColor = Color.WhiteSmoke;
m_components = new Container();
m_toolTip = new ToolTip(Components);
m_buttonClose = new InertButton(ImageCloseEnabled, ImageCloseDisabled);
m_buttonScrollLeft = new InertButton(ImageScrollLeftEnabled, ImageScrollLeftDisabled);
m_buttonScrollRight = new InertButton(ImageScrollRightEnabled, ImageScrollRightDisabled);
m_buttonClose.ToolTipText = ToolTipClose;
m_buttonClose.Anchor = AnchorStyles.Top | AnchorStyles.Right;
m_buttonClose.Click += new EventHandler(Close_Click);
m_buttonScrollLeft.Enabled = false;
m_buttonScrollLeft.ToolTipText = ToolTipScrollLeft;
m_buttonScrollLeft.Anchor = AnchorStyles.Top | AnchorStyles.Right;
m_buttonScrollLeft.Click += new EventHandler(ScrollLeft_Click);
m_buttonScrollRight.Enabled = false;
m_buttonScrollRight.ToolTipText = ToolTipScrollRight;
m_buttonScrollRight.Anchor = AnchorStyles.Top | AnchorStyles.Right;
m_buttonScrollRight.Click += new EventHandler(ScrollRight_Click);
Controls.AddRange(new Control[] { m_buttonClose,
m_buttonScrollLeft,
m_buttonScrollRight });
ResumeLayout();
}
/// <exclude/>
protected override void Dispose(bool disposing)
{
if (disposing)
{
Components.Dispose();
}
base.Dispose (disposing);
}
protected override int MeasureHeight()
{
if (Appearance == DockPane.AppearanceStyle.ToolWindow)
return MeasureHeight_ToolWindow();
else
return MeasureHeight_Document();
}
private int MeasureHeight_ToolWindow()
{
if (DockPane.IsAutoHide || Tabs.Count <= 1)
return 0;
int height = Math.Max(Font.Height, ToolWindowImageHeight)
+ ToolWindowImageGapTop + ToolWindowImageGapBottom;
return height;
}
private int MeasureHeight_Document()
{
int height = Math.Max(Font.Height + DocumentTabGapTop + DocumentTextExtraHeight,
ImageCloseEnabled.Height + DocumentButtonGapTop + DocumentButtonGapBottom);
return height;
}
/// <exclude/>
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint (e);
Rectangle rect = TabsRectangle;
if (Appearance == DockPane.AppearanceStyle.Document)
{
rect.X -= DocumentTabGapLeft;
rect.Width += DocumentTabGapLeft;
}
using (LinearGradientBrush brush = new LinearGradientBrush(rect, SystemColors.ControlLight, Color.WhiteSmoke, LinearGradientMode.Horizontal))
{
e.Graphics.FillRectangle(brush, rect);
}
DrawTabStrip(e.Graphics);
}
protected override void OnRefreshChanges()
{
CalculateTabs();
SetInertButtons();
Invalidate();
}
protected override GraphicsPath GetOutlinePath(int index)
{
Point[] pts = new Point[8];
if (Appearance == DockPane.AppearanceStyle.Document)
{
Rectangle rectTab = GetTabRectangle(index);
rectTab.Intersect(TabsRectangle);
int y = DockPane.PointToClient(PointToScreen(new Point(0, rectTab.Bottom))).Y;
Rectangle rectPaneClient = DockPane.ClientRectangle;
pts[0] = DockPane.PointToScreen(new Point(rectPaneClient.Left, y));
pts[1] = PointToScreen(new Point(rectTab.Left, rectTab.Bottom));
pts[2] = PointToScreen(new Point(rectTab.Left, rectTab.Top));
pts[3] = PointToScreen(new Point(rectTab.Right, rectTab.Top));
pts[4] = PointToScreen(new Point(rectTab.Right, rectTab.Bottom));
pts[5] = DockPane.PointToScreen(new Point(rectPaneClient.Right, y));
pts[6] = DockPane.PointToScreen(new Point(rectPaneClient.Right, rectPaneClient.Bottom));
pts[7] = DockPane.PointToScreen(new Point(rectPaneClient.Left, rectPaneClient.Bottom));
}
else
{
Rectangle rectTab = GetTabRectangle(index);
rectTab.Intersect(TabsRectangle);
int y = DockPane.PointToClient(PointToScreen(new Point(0, rectTab.Top))).Y;
Rectangle rectPaneClient = DockPane.ClientRectangle;
pts[0] = DockPane.PointToScreen(new Point(rectPaneClient.Left, rectPaneClient.Top));
pts[1] = DockPane.PointToScreen(new Point(rectPaneClient.Right, rectPaneClient.Top));
pts[2] = DockPane.PointToScreen(new Point(rectPaneClient.Right, y));
pts[3] = PointToScreen(new Point(rectTab.Right, rectTab.Top));
pts[4] = PointToScreen(new Point(rectTab.Right, rectTab.Bottom));
pts[5] = PointToScreen(new Point(rectTab.Left, rectTab.Bottom));
pts[6] = PointToScreen(new Point(rectTab.Left, rectTab.Top));
pts[7] = DockPane.PointToScreen(new Point(rectPaneClient.Left, y));
}
GraphicsPath path = new GraphicsPath();
path.AddLines(pts);
return path;
}
private void CalculateTabs()
{
if (Appearance == DockPane.AppearanceStyle.ToolWindow)
CalculateTabs_ToolWindow();
else
CalculateTabs_Document();
}
private void CalculateTabs_ToolWindow()
{
if (Tabs.Count <= 1 || DockPane.IsAutoHide)
return;
Rectangle rectTabStrip = ClientRectangle;
// Calculate tab widths
int countTabs = Tabs.Count;
foreach (DockPaneTabFromBase tab in Tabs)
{
tab.MaxWidth = GetTabOriginalWidth(Tabs.IndexOf(tab));
tab.Flag = false;
}
// Set tab whose max width less than average width
bool anyWidthWithinAverage = true;
int totalWidth = rectTabStrip.Width - ToolWindowStripGapLeft - ToolWindowStripGapRight;
int totalAllocatedWidth = 0;
int averageWidth = totalWidth / countTabs;
int remainedTabs = countTabs;
for (anyWidthWithinAverage=true; anyWidthWithinAverage && remainedTabs>0;)
{
anyWidthWithinAverage = false;
foreach (DockPaneTabFromBase tab in Tabs)
{
if (tab.Flag)
continue;
if (tab.MaxWidth <= averageWidth)
{
tab.Flag = true;
tab.TabWidth = tab.MaxWidth;
totalAllocatedWidth += tab.TabWidth;
anyWidthWithinAverage = true;
remainedTabs--;
}
}
if (remainedTabs != 0)
averageWidth = (totalWidth - totalAllocatedWidth) / remainedTabs;
}
// If any tab width not set yet, set it to the average width
if (remainedTabs > 0)
{
int roundUpWidth = (totalWidth - totalAllocatedWidth) - (averageWidth * remainedTabs);
foreach (DockPaneTabFromBase tab in Tabs)
{
if (tab.Flag)
continue;
tab.Flag = true;
if (roundUpWidth > 0)
{
tab.TabWidth = averageWidth + 1;
roundUpWidth --;
}
else
tab.TabWidth = averageWidth;
}
}
// Set the X position of the tabs
int x = rectTabStrip.X + ToolWindowStripGapLeft;
foreach (DockPaneTabFromBase tab in Tabs)
{
tab.TabX = x;
x += tab.TabWidth;
}
}
private void CalculateTabs_Document()
{
int countTabs = Tabs.Count;
if (countTabs == 0)
return;
Rectangle rectTabStrip = ClientRectangle;
int x = rectTabStrip.X + DocumentTabGapLeft + OffsetX;
foreach (DockPaneTabFromBase tab in Tabs)
{
tab.TabX = x;
tab.TabWidth = Math.Min(GetTabOriginalWidth(Tabs.IndexOf(tab)), DocumentTabMaxWidth);
x += tab.TabWidth;
}
}
protected override void EnsureTabVisible(IDockContent content)
{
if (Appearance != DockPane.AppearanceStyle.Document)
return;
Rectangle rectTabStrip = TabsRectangle;
Rectangle rectTab = GetTabRectangle(Tabs.IndexOf(content));
if (rectTab.Right > rectTabStrip.Right)
{
OffsetX -= rectTab.Right - rectTabStrip.Right;
rectTab.X -= rectTab.Right - rectTabStrip.Right;
}
if (rectTab.Left < rectTabStrip.Left)
OffsetX += rectTabStrip.Left - rectTab.Left;
OnRefreshChanges();
}
protected virtual int GetTabOriginalWidth(int index)
{
if (Appearance == DockPane.AppearanceStyle.ToolWindow)
return GetTabOriginalWidth_ToolWindow(index);
else
return GetTabOriginalWidth_Document(index);
}
private int GetTabOriginalWidth_ToolWindow(int index)
{
IDockContent content = Tabs[index].Content;
using (Graphics g = CreateGraphics())
{
SizeF sizeString = g.MeasureString(content.DockHandler.TabText, Font);
return ToolWindowImageWidth + (int)sizeString.Width + 1 + ToolWindowImageGapLeft
+ ToolWindowImageGapRight + ToolWindowTextGapRight;
}
}
private int GetTabOriginalWidth_Document(int index)
{
IDockContent content = Tabs[index].Content;
using (Graphics g = CreateGraphics())
{
SizeF sizeText;
if (content == DockPane.ActiveContent && DockPane.IsActiveDocumentPane)
{
using (Font boldFont = new Font(this.Font, FontStyle.Bold))
{
sizeText = g.MeasureString(content.DockHandler.TabText, boldFont, DocumentTabMaxWidth, DocumentTextStringFormat);
}
}
else
sizeText = g.MeasureString(content.DockHandler.TabText, Font, DocumentTabMaxWidth, DocumentTextStringFormat);
return (int)sizeText.Width + 1 + DocumentTextExtraWidth;
}
}
protected virtual void DrawTabStrip(Graphics g)
{
OnBeginDrawTabStrip(Appearance);
if (Appearance == DockPane.AppearanceStyle.Document)
DrawTabStrip_Document(g);
else
DrawTabStrip_ToolWindow(g);
OnEndDrawTabStrip(Appearance);
}
private void DrawTabStrip_Document(Graphics g)
{
int count = Tabs.Count;
if (count == 0)
return;
Rectangle rectTabStrip = ClientRectangle;
g.DrawLine(OutlineOuterPen, rectTabStrip.Left, rectTabStrip.Bottom - 1,
rectTabStrip.Right, rectTabStrip.Bottom - 1);
// Draw the tabs
Rectangle rectTabOnly = TabsRectangle;
Rectangle rectTab = Rectangle.Empty;
g.SetClip(rectTabOnly, CombineMode.Replace);
for (int i=0; i<count; i++)
{
rectTab = GetTabRectangle(i);
if (rectTab.IntersectsWith(rectTabOnly))
DrawTab(g, Tabs[i].Content, rectTab);
}
}
private void DrawTabStrip_ToolWindow(Graphics g)
{
Rectangle rectTabStrip = ClientRectangle;
g.DrawLine(OutlineInnerPen, rectTabStrip.Left, rectTabStrip.Top,
rectTabStrip.Right, rectTabStrip.Top);
for (int i=0; i<Tabs.Count; i++)
DrawTab(g, Tabs[i].Content, GetTabRectangle(i));
}
protected virtual Rectangle GetTabRectangle(int index)
{
if (Appearance == DockPane.AppearanceStyle.ToolWindow)
return GetTabRectangle_ToolWindow(index);
else
return GetTabRectangle_Document(index);
}
private Rectangle GetTabRectangle_ToolWindow(int index)
{
Rectangle rectTabStrip = ClientRectangle;
DockPaneTabFromBase tab = (DockPaneTabFromBase)(Tabs[index]);
return new Rectangle(tab.TabX, rectTabStrip.Y, tab.TabWidth, rectTabStrip.Height);
}
private Rectangle GetTabRectangle_Document(int index)
{
Rectangle rectTabStrip = ClientRectangle;
DockPaneTabFromBase tab = (DockPaneTabFromBase)Tabs[index];
return new Rectangle(tab.TabX, rectTabStrip.Y + DocumentTabGapTop, tab.TabWidth, rectTabStrip.Height - DocumentTabGapTop);
}
private void DrawTab(Graphics g, IDockContent content, Rectangle rect)
{
OnBeginDrawTab(Appearance);
if (Appearance == DockPane.AppearanceStyle.ToolWindow)
DrawTab_ToolWindow(g, content, rect);
else
DrawTab_Document(g, content, rect);
OnEndDrawTab(Appearance);
}
private void DrawTab_ToolWindow(Graphics g, IDockContent content, Rectangle rect)
{
Rectangle rectIcon = new Rectangle(
rect.X + ToolWindowImageGapLeft,
rect.Y + rect.Height - 1 - ToolWindowImageGapBottom - ToolWindowImageHeight,
ToolWindowImageWidth, ToolWindowImageHeight);
Rectangle rectText = rectIcon;
rectText.X += rectIcon.Width + ToolWindowImageGapRight;
rectText.Width = rect.Width - rectIcon.Width - ToolWindowImageGapLeft -
ToolWindowImageGapRight - ToolWindowTextGapRight;
if (DockPane.ActiveContent == content)
{
g.FillRectangle(ActiveBackBrush, rect);
g.DrawLine(OutlineOuterPen,
rect.X, rect.Y, rect.X, rect.Y + rect.Height - 1);
g.DrawLine(OutlineInnerPen,
rect.X, rect.Y + rect.Height - 1, rect.X + rect.Width - 1, rect.Y + rect.Height - 1);
g.DrawLine(OutlineInnerPen,
rect.X + rect.Width - 1, rect.Y, rect.X + rect.Width - 1, rect.Y + rect.Height - 1);
g.DrawString(content.DockHandler.TabText, Font, ActiveTextBrush, rectText, ToolWindowTextStringFormat);
}
else
{
if (Tabs.IndexOf(DockPane.ActiveContent) != Tabs.IndexOf(content) + 1)
g.DrawLine(TabSeperatorPen,
rect.X + rect.Width - 1,
rect.Y + ToolWindowTabSeperatorGapTop,
rect.X + rect.Width - 1,
rect.Y + rect.Height - 1 - ToolWindowTabSeperatorGapBottom);
g.DrawString(content.DockHandler.TabText, Font, InactiveTextBrush, rectText, ToolWindowTextStringFormat);
}
if (rect.Contains(rectIcon))
g.DrawIcon(content.DockHandler.Icon, rectIcon);
}
private void DrawTab_Document(Graphics g, IDockContent content, Rectangle rect)
{
Rectangle rectText = rect;
rectText.X += DocumentTextExtraWidth / 2;
rectText.Width -= DocumentTextExtraWidth;
if (DockPane.ActiveContent == content)
{
g.FillRectangle(ActiveBackBrush, rect);
g.DrawLine(OutlineOuterPen, rect.X, rect.Y, rect.X, rect.Y + rect.Height);
g.DrawLine(OutlineOuterPen, rect.X, rect.Y, rect.X + rect.Width - 1, rect.Y);
g.DrawLine(OutlineInnerPen,
rect.X + rect.Width - 1, rect.Y,
rect.X + rect.Width - 1, rect.Y + rect.Height - 1);
if (DockPane.IsActiveDocumentPane)
{
using (Font boldFont = new Font(this.Font, FontStyle.Bold))
{
g.DrawString(content.DockHandler.TabText, boldFont, ActiveTextBrush, rectText, DocumentTextStringFormat);
}
}
else
g.DrawString(content.DockHandler.TabText, Font, InactiveTextBrush, rectText, DocumentTextStringFormat);
}
else
{
if (Tabs.IndexOf(DockPane.ActiveContent) != Tabs.IndexOf(content) + 1)
g.DrawLine(TabSeperatorPen,
rect.X + rect.Width - 1, rect.Y,
rect.X + rect.Width - 1, rect.Y + rect.Height - 1 - DocumentTabGapTop);
g.DrawString(content.DockHandler.TabText, Font, InactiveTextBrush, rectText, DocumentTextStringFormat);
}
}
private Rectangle TabsRectangle
{
get
{
if (Appearance == DockPane.AppearanceStyle.ToolWindow)
return ClientRectangle;
Rectangle rectWindow = ClientRectangle;
int x = rectWindow.X;
int y = rectWindow.Y;
int width = rectWindow.Width;
int height = rectWindow.Height;
x += DocumentTabGapLeft;
width -= DocumentTabGapLeft +
DocumentTabGapRight +
DocumentButtonGapRight +
m_buttonClose.Width +
m_buttonScrollRight.Width +
m_buttonScrollLeft.Width +
2 * DocumentButtonGapBetween;
return new Rectangle(x, y, width, height);
}
}
private void ScrollLeft_Click(object sender, EventArgs e)
{
Rectangle rectTabStrip = TabsRectangle;
int index;
for (index=0; index<Tabs.Count; index++)
if (GetTabRectangle(index).IntersectsWith(rectTabStrip))
break;
Rectangle rectTab = GetTabRectangle(index);
if (rectTab.Left < rectTabStrip.Left)
OffsetX += rectTabStrip.Left - rectTab.Left;
else if (index == 0)
OffsetX = 0;
else
OffsetX += rectTabStrip.Left - GetTabRectangle(index - 1).Left;
OnRefreshChanges();
}
private void ScrollRight_Click(object sender, EventArgs e)
{
Rectangle rectTabStrip = TabsRectangle;
int index;
int count = Tabs.Count;
for (index=0; index<count; index++)
if (GetTabRectangle(index).IntersectsWith(rectTabStrip))
break;
if (index + 1 < count)
{
OffsetX -= GetTabRectangle(index + 1).Left - rectTabStrip.Left;
CalculateTabs();
}
Rectangle rectLastTab = GetTabRectangle(count - 1);
if (rectLastTab.Right < rectTabStrip.Right)
OffsetX += rectTabStrip.Right - rectLastTab.Right;
OnRefreshChanges();
}
private void SetInertButtons()
{
// Set the visibility of the inert buttons
m_buttonScrollLeft.Visible = m_buttonScrollRight.Visible = m_buttonClose.Visible = (DockPane.DockState == DockState.Document);
m_buttonClose.ForeColor = m_buttonScrollRight.ForeColor = m_buttonScrollLeft.ForeColor = SystemColors.ControlDarkDark;
m_buttonClose.BorderColor = m_buttonScrollRight.BorderColor = m_buttonScrollLeft.BorderColor = SystemColors.ControlDarkDark;
// Enable/disable scroll buttons
int count = Tabs.Count;
Rectangle rectTabOnly = TabsRectangle;
Rectangle rectTab = (count == 0) ? Rectangle.Empty : GetTabRectangle(count - 1);
m_buttonScrollLeft.Enabled = (OffsetX < 0);
m_buttonScrollRight.Enabled = rectTab.Right > rectTabOnly.Right;
// Enable/disable close button
if (DockPane.ActiveContent == null)
m_buttonClose.Enabled = false;
else
m_buttonClose.Enabled = DockPane.ActiveContent.DockHandler.CloseButton;
}
protected override void OnLayout(LayoutEventArgs levent)
{
Rectangle rectTabStrip = ClientRectangle;
// Set position and size of the buttons
int buttonWidth = ImageCloseEnabled.Width;
int buttonHeight = ImageCloseEnabled.Height;
int height = rectTabStrip.Height - DocumentButtonGapTop - DocumentButtonGapBottom;
if (buttonHeight < height)
{
buttonWidth = buttonWidth * (height / buttonHeight);
buttonHeight = height;
}
Size buttonSize = new Size(buttonWidth, buttonHeight);
m_buttonClose.Size = m_buttonScrollLeft.Size = m_buttonScrollRight.Size = buttonSize;
int x = rectTabStrip.X + rectTabStrip.Width - DocumentTabGapLeft
- DocumentButtonGapRight - buttonWidth;
int y = rectTabStrip.Y + DocumentButtonGapTop;
m_buttonClose.Location = new Point(x, y);
Point point = m_buttonClose.Location;
point.Offset(-(DocumentButtonGapBetween + buttonWidth), 0);
m_buttonScrollRight.Location = point;
point.Offset(-(DocumentButtonGapBetween + buttonWidth), 0);
m_buttonScrollLeft.Location = point;
OnRefreshChanges();
base.OnLayout (levent);
}
private void Close_Click(object sender, EventArgs e)
{
DockPane.CloseActiveContent();
}
protected override int GetHitTest(Point ptMouse)
{
Rectangle rectTabStrip = TabsRectangle;
for (int i=0; i<Tabs.Count; i++)
{
Rectangle rectTab = GetTabRectangle(i);
rectTab.Intersect(rectTabStrip);
if (rectTab.Contains(ptMouse))
return i;
}
return -1;
}
/// <exclude/>
protected override void OnMouseMove(MouseEventArgs e)
{
int index = GetHitTest(PointToClient(Control.MousePosition));
string toolTip = string.Empty;
base.OnMouseMove(e);
if (index != -1)
{
Rectangle rectTab = GetTabRectangle(index);
if (Tabs[index].Content.DockHandler.ToolTipText != null)
toolTip = Tabs[index].Content.DockHandler.ToolTipText;
else if (rectTab.Width < GetTabOriginalWidth(index))
toolTip = Tabs[index].Content.DockHandler.TabText;
}
if (m_toolTip.GetToolTip(this) != toolTip)
{
m_toolTip.Active = false;
m_toolTip.SetToolTip(this, toolTip);
m_toolTip.Active = true;
}
}
}
}

50
src/Libraries/DockPanel_Src/DockSample/Extender/FromBase/DockPaneTabFromBase.cs

@ -0,0 +1,50 @@ @@ -0,0 +1,50 @@
// *****************************************************************************
//
// Copyright 2004, Weifen Luo
// All rights reserved. The software and associated documentation
// supplied hereunder are the proprietary information of Weifen Luo
// and are supplied subject to licence terms.
//
// WinFormsUI Library Version 1.0
// *****************************************************************************
using System;
using System.Drawing;
using WeifenLuo.WinFormsUI;
namespace DockSample
{
internal class DockPaneTabFromBase : DockPaneTab
{
internal DockPaneTabFromBase(IDockContent content) : base(content)
{
}
private int m_tabX;
protected internal int TabX
{
get { return m_tabX; }
set { m_tabX = value; }
}
private int m_tabWidth;
protected internal int TabWidth
{
get { return m_tabWidth; }
set { m_tabWidth = value; }
}
private int m_maxWidth;
protected internal int MaxWidth
{
get { return m_maxWidth; }
set { m_maxWidth = value; }
}
private bool m_flag;
protected internal bool Flag
{
get { return m_flag; }
set { m_flag = value; }
}
}
}

121
src/Libraries/DockPanel_Src/DockSample/Extender/FromBase/Helpers/DockHelper.cs

@ -0,0 +1,121 @@ @@ -0,0 +1,121 @@
// *****************************************************************************
//
// Copyright 2004, Weifen Luo
// All rights reserved. The software and associated documentation
// supplied hereunder are the proprietary information of Weifen Luo
// and are supplied subject to licence terms.
//
// WinFormsUI Library Version 1.0
// *****************************************************************************
using System;
using WeifenLuo.WinFormsUI;
namespace DockSample
{
internal class DockHelper
{
public static bool IsDockStateAutoHide(DockState dockState)
{
if (dockState == DockState.DockLeftAutoHide ||
dockState == DockState.DockRightAutoHide ||
dockState == DockState.DockTopAutoHide ||
dockState == DockState.DockBottomAutoHide)
return true;
else
return false;
}
public static bool IsDockStateDocked(DockState dockState)
{
return (dockState == DockState.DockLeft ||
dockState == DockState.DockRight ||
dockState == DockState.DockTop ||
dockState == DockState.DockBottom);
}
public static bool IsDockBottom(DockState dockState)
{
return (dockState == DockState.DockBottom || dockState == DockState.DockBottomAutoHide) ? true : false;
}
public static bool IsDockLeft(DockState dockState)
{
return (dockState == DockState.DockLeft || dockState == DockState.DockLeftAutoHide) ? true : false;
}
public static bool IsDockRight(DockState dockState)
{
return (dockState == DockState.DockRight || dockState == DockState.DockRightAutoHide) ? true : false;
}
public static bool IsDockTop(DockState dockState)
{
return (dockState == DockState.DockTop || dockState == DockState.DockTopAutoHide ) ? true : false;
}
public static bool IsDockStateValid(DockState dockState, DockAreas dockableAreas)
{
if (((dockableAreas & DockAreas.Float) == 0) &&
(dockState == DockState.Float))
return false;
else if (((dockableAreas & DockAreas.Document) == 0) &&
(dockState == DockState.Document))
return false;
else if (((dockableAreas & DockAreas.DockLeft) == 0) &&
(dockState == DockState.DockLeft || dockState == DockState.DockLeftAutoHide))
return false;
else if (((dockableAreas & DockAreas.DockRight) == 0) &&
(dockState == DockState.DockRight || dockState == DockState.DockRightAutoHide))
return false;
else if (((dockableAreas & DockAreas.DockTop) == 0) &&
(dockState == DockState.DockTop || dockState == DockState.DockTopAutoHide))
return false;
else if (((dockableAreas & DockAreas.DockBottom) == 0) &&
(dockState == DockState.DockBottom || dockState == DockState.DockBottomAutoHide))
return false;
else
return true;
}
public static bool IsDockWindowState(DockState state)
{
if (state == DockState.DockTop || state == DockState.DockBottom || state == DockState.DockLeft ||
state == DockState.DockRight || state == DockState.Document)
return true;
else
return false;
}
public static bool IsValidRestoreState(DockState state)
{
if (state == DockState.DockLeft || state == DockState.DockRight || state == DockState.DockTop ||
state == DockState.DockBottom || state == DockState.Document)
return true;
else
return false;
}
public static DockState ToggleAutoHideState(DockState state)
{
if (state == DockState.DockLeft)
return DockState.DockLeftAutoHide;
else if (state == DockState.DockRight)
return DockState.DockRightAutoHide;
else if (state == DockState.DockTop)
return DockState.DockTopAutoHide;
else if (state == DockState.DockBottom)
return DockState.DockBottomAutoHide;
else if (state == DockState.DockLeftAutoHide)
return DockState.DockLeft;
else if (state == DockState.DockRightAutoHide)
return DockState.DockRight;
else if (state == DockState.DockTopAutoHide)
return DockState.DockTop;
else if (state == DockState.DockBottomAutoHide)
return DockState.DockBottom;
else
return state;
}
}
}

41
src/Libraries/DockPanel_Src/DockSample/Extender/FromBase/Helpers/ResourceHelper.cs

@ -0,0 +1,41 @@ @@ -0,0 +1,41 @@
// *****************************************************************************
//
// Copyright 2004, Weifen Luo
// All rights reserved. The software and associated documentation
// supplied hereunder are the proprietary information of Weifen Luo
// and are supplied subject to licence terms.
//
// WinFormsUI Library Version 1.0
// *****************************************************************************
using System;
using System.Drawing;
using System.Reflection;
using System.Resources;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI;
namespace DockSample
{
internal class ResourceHelper
{
private static ResourceManager m_resourceManager;
static ResourceHelper()
{
m_resourceManager = new ResourceManager("WeifenLuo.WinFormsUI.Strings", typeof(DockPanel).Assembly);
}
public static Bitmap LoadBitmap(string name)
{
Assembly assembly = typeof(DockPanel).Assembly;
string fullNamePrefix = "WeifenLuo.WinFormsUI.Resources.";
return new Bitmap(assembly.GetManifestResourceStream(fullNamePrefix + name));
}
public static string GetString(string name)
{
return m_resourceManager.GetString(name);
}
}
}

701
src/Libraries/DockPanel_Src/DockSample/Extender/FromBase/Win32/Enums.cs

@ -0,0 +1,701 @@ @@ -0,0 +1,701 @@
// *****************************************************************************
//
// Copyright 2004, Weifen Luo
// All rights reserved. The software and associated documentation
// supplied hereunder are the proprietary information of Weifen Luo
// and are supplied subject to licence terms.
//
// WinFormsUI Library Version 1.0
// *****************************************************************************
using System;
namespace DockSample.Win32
{
internal enum PeekMessageFlags
{
PM_NOREMOVE = 0,
PM_REMOVE = 1,
PM_NOYIELD = 2
}
[Flags]
internal enum FlagsSetWindowPos : uint
{
SWP_NOSIZE = 0x0001,
SWP_NOMOVE = 0x0002,
SWP_NOZORDER = 0x0004,
SWP_NOREDRAW = 0x0008,
SWP_NOACTIVATE = 0x0010,
SWP_FRAMECHANGED = 0x0020,
SWP_SHOWWINDOW = 0x0040,
SWP_HIDEWINDOW = 0x0080,
SWP_NOCOPYBITS = 0x0100,
SWP_NOOWNERZORDER = 0x0200,
SWP_NOSENDCHANGING = 0x0400,
SWP_DRAWFRAME = 0x0020,
SWP_NOREPOSITION = 0x0200,
SWP_DEFERERASE = 0x2000,
SWP_ASYNCWINDOWPOS = 0x4000
}
internal enum SetWindowPosZ
{
HWND_TOP = 0,
HWND_BOTTOM = 1,
HWND_TOPMOST = -1,
HWND_NOTOPMOST = -2
}
internal enum ShowWindowStyles : short
{
SW_HIDE = 0,
SW_SHOWNORMAL = 1,
SW_NORMAL = 1,
SW_SHOWMINIMIZED = 2,
SW_SHOWMAXIMIZED = 3,
SW_MAXIMIZE = 3,
SW_SHOWNOACTIVATE = 4,
SW_SHOW = 5,
SW_MINIMIZE = 6,
SW_SHOWMINNOACTIVE = 7,
SW_SHOWNA = 8,
SW_RESTORE = 9,
SW_SHOWDEFAULT = 10,
SW_FORCEMINIMIZE = 11,
SW_MAX = 11
}
internal enum WindowStyles : uint
{
WS_OVERLAPPED = 0x00000000,
WS_POPUP = 0x80000000,
WS_CHILD = 0x40000000,
WS_MINIMIZE = 0x20000000,
WS_VISIBLE = 0x10000000,
WS_DISABLED = 0x08000000,
WS_CLIPSIBLINGS = 0x04000000,
WS_CLIPCHILDREN = 0x02000000,
WS_MAXIMIZE = 0x01000000,
WS_CAPTION = 0x00C00000,
WS_BORDER = 0x00800000,
WS_DLGFRAME = 0x00400000,
WS_VSCROLL = 0x00200000,
WS_HSCROLL = 0x00100000,
WS_SYSMENU = 0x00080000,
WS_THICKFRAME = 0x00040000,
WS_GROUP = 0x00020000,
WS_TABSTOP = 0x00010000,
WS_MINIMIZEBOX = 0x00020000,
WS_MAXIMIZEBOX = 0x00010000,
WS_TILED = 0x00000000,
WS_ICONIC = 0x20000000,
WS_SIZEBOX = 0x00040000,
WS_POPUPWINDOW = 0x80880000,
WS_OVERLAPPEDWINDOW = 0x00CF0000,
WS_TILEDWINDOW = 0x00CF0000,
WS_CHILDWINDOW = 0x40000000
}
internal enum WindowExStyles
{
WS_EX_DLGMODALFRAME = 0x00000001,
WS_EX_NOPARENTNOTIFY = 0x00000004,
WS_EX_TOPMOST = 0x00000008,
WS_EX_ACCEPTFILES = 0x00000010,
WS_EX_TRANSPARENT = 0x00000020,
WS_EX_MDICHILD = 0x00000040,
WS_EX_TOOLWINDOW = 0x00000080,
WS_EX_WINDOWEDGE = 0x00000100,
WS_EX_CLIENTEDGE = 0x00000200,
WS_EX_CONTEXTHELP = 0x00000400,
WS_EX_RIGHT = 0x00001000,
WS_EX_LEFT = 0x00000000,
WS_EX_RTLREADING = 0x00002000,
WS_EX_LTRREADING = 0x00000000,
WS_EX_LEFTSCROLLBAR = 0x00004000,
WS_EX_RIGHTSCROLLBAR = 0x00000000,
WS_EX_CONTROLPARENT = 0x00010000,
WS_EX_STATICEDGE = 0x00020000,
WS_EX_APPWINDOW = 0x00040000,
WS_EX_OVERLAPPEDWINDOW = 0x00000300,
WS_EX_PALETTEWINDOW = 0x00000188,
WS_EX_LAYERED = 0x00080000
}
internal enum VirtualKeys
{
VK_LBUTTON = 0x01,
VK_CANCEL = 0x03,
VK_BACK = 0x08,
VK_TAB = 0x09,
VK_CLEAR = 0x0C,
VK_RETURN = 0x0D,
VK_SHIFT = 0x10,
VK_CONTROL = 0x11,
VK_MENU = 0x12,
VK_CAPITAL = 0x14,
VK_ESCAPE = 0x1B,
VK_SPACE = 0x20,
VK_PRIOR = 0x21,
VK_NEXT = 0x22,
VK_END = 0x23,
VK_HOME = 0x24,
VK_LEFT = 0x25,
VK_UP = 0x26,
VK_RIGHT = 0x27,
VK_DOWN = 0x28,
VK_SELECT = 0x29,
VK_EXECUTE = 0x2B,
VK_SNAPSHOT = 0x2C,
VK_HELP = 0x2F,
VK_0 = 0x30,
VK_1 = 0x31,
VK_2 = 0x32,
VK_3 = 0x33,
VK_4 = 0x34,
VK_5 = 0x35,
VK_6 = 0x36,
VK_7 = 0x37,
VK_8 = 0x38,
VK_9 = 0x39,
VK_A = 0x41,
VK_B = 0x42,
VK_C = 0x43,
VK_D = 0x44,
VK_E = 0x45,
VK_F = 0x46,
VK_G = 0x47,
VK_H = 0x48,
VK_I = 0x49,
VK_J = 0x4A,
VK_K = 0x4B,
VK_L = 0x4C,
VK_M = 0x4D,
VK_N = 0x4E,
VK_O = 0x4F,
VK_P = 0x50,
VK_Q = 0x51,
VK_R = 0x52,
VK_S = 0x53,
VK_T = 0x54,
VK_U = 0x55,
VK_V = 0x56,
VK_W = 0x57,
VK_X = 0x58,
VK_Y = 0x59,
VK_Z = 0x5A,
VK_NUMPAD0 = 0x60,
VK_NUMPAD1 = 0x61,
VK_NUMPAD2 = 0x62,
VK_NUMPAD3 = 0x63,
VK_NUMPAD4 = 0x64,
VK_NUMPAD5 = 0x65,
VK_NUMPAD6 = 0x66,
VK_NUMPAD7 = 0x67,
VK_NUMPAD8 = 0x68,
VK_NUMPAD9 = 0x69,
VK_MULTIPLY = 0x6A,
VK_ADD = 0x6B,
VK_SEPARATOR = 0x6C,
VK_SUBTRACT = 0x6D,
VK_DECIMAL = 0x6E,
VK_DIVIDE = 0x6F,
VK_ATTN = 0xF6,
VK_CRSEL = 0xF7,
VK_EXSEL = 0xF8,
VK_EREOF = 0xF9,
VK_PLAY = 0xFA,
VK_ZOOM = 0xFB,
VK_NONAME = 0xFC,
VK_PA1 = 0xFD,
VK_OEM_CLEAR = 0xFE,
VK_LWIN = 0x5B,
VK_RWIN = 0x5C,
VK_APPS = 0x5D,
VK_LSHIFT = 0xA0,
VK_RSHIFT = 0xA1,
VK_LCONTROL = 0xA2,
VK_RCONTROL = 0xA3,
VK_LMENU = 0xA4,
VK_RMENU = 0xA5
}
internal enum Msgs
{
WM_NULL = 0x0000,
WM_CREATE = 0x0001,
WM_DESTROY = 0x0002,
WM_MOVE = 0x0003,
WM_SIZE = 0x0005,
WM_ACTIVATE = 0x0006,
WM_SETFOCUS = 0x0007,
WM_KILLFOCUS = 0x0008,
WM_ENABLE = 0x000A,
WM_SETREDRAW = 0x000B,
WM_SETTEXT = 0x000C,
WM_GETTEXT = 0x000D,
WM_GETTEXTLENGTH = 0x000E,
WM_PAINT = 0x000F,
WM_CLOSE = 0x0010,
WM_QUERYENDSESSION = 0x0011,
WM_QUIT = 0x0012,
WM_QUERYOPEN = 0x0013,
WM_ERASEBKGND = 0x0014,
WM_SYSCOLORCHANGE = 0x0015,
WM_ENDSESSION = 0x0016,
WM_SHOWWINDOW = 0x0018,
WM_WININICHANGE = 0x001A,
WM_SETTINGCHANGE = 0x001A,
WM_DEVMODECHANGE = 0x001B,
WM_ACTIVATEAPP = 0x001C,
WM_FONTCHANGE = 0x001D,
WM_TIMECHANGE = 0x001E,
WM_CANCELMODE = 0x001F,
WM_SETCURSOR = 0x0020,
WM_MOUSEACTIVATE = 0x0021,
WM_CHILDACTIVATE = 0x0022,
WM_QUEUESYNC = 0x0023,
WM_GETMINMAXINFO = 0x0024,
WM_PAINTICON = 0x0026,
WM_ICONERASEBKGND = 0x0027,
WM_NEXTDLGCTL = 0x0028,
WM_SPOOLERSTATUS = 0x002A,
WM_DRAWITEM = 0x002B,
WM_MEASUREITEM = 0x002C,
WM_DELETEITEM = 0x002D,
WM_VKEYTOITEM = 0x002E,
WM_CHARTOITEM = 0x002F,
WM_SETFONT = 0x0030,
WM_GETFONT = 0x0031,
WM_SETHOTKEY = 0x0032,
WM_GETHOTKEY = 0x0033,
WM_QUERYDRAGICON = 0x0037,
WM_COMPAREITEM = 0x0039,
WM_GETOBJECT = 0x003D,
WM_COMPACTING = 0x0041,
WM_COMMNOTIFY = 0x0044 ,
WM_WINDOWPOSCHANGING = 0x0046,
WM_WINDOWPOSCHANGED = 0x0047,
WM_POWER = 0x0048,
WM_COPYDATA = 0x004A,
WM_CANCELJOURNAL = 0x004B,
WM_NOTIFY = 0x004E,
WM_INPUTLANGCHANGEREQUEST = 0x0050,
WM_INPUTLANGCHANGE = 0x0051,
WM_TCARD = 0x0052,
WM_HELP = 0x0053,
WM_USERCHANGED = 0x0054,
WM_NOTIFYFORMAT = 0x0055,
WM_CONTEXTMENU = 0x007B,
WM_STYLECHANGING = 0x007C,
WM_STYLECHANGED = 0x007D,
WM_DISPLAYCHANGE = 0x007E,
WM_GETICON = 0x007F,
WM_SETICON = 0x0080,
WM_NCCREATE = 0x0081,
WM_NCDESTROY = 0x0082,
WM_NCCALCSIZE = 0x0083,
WM_NCHITTEST = 0x0084,
WM_NCPAINT = 0x0085,
WM_NCACTIVATE = 0x0086,
WM_GETDLGCODE = 0x0087,
WM_SYNCPAINT = 0x0088,
WM_NCMOUSEMOVE = 0x00A0,
WM_NCLBUTTONDOWN = 0x00A1,
WM_NCLBUTTONUP = 0x00A2,
WM_NCLBUTTONDBLCLK = 0x00A3,
WM_NCRBUTTONDOWN = 0x00A4,
WM_NCRBUTTONUP = 0x00A5,
WM_NCRBUTTONDBLCLK = 0x00A6,
WM_NCMBUTTONDOWN = 0x00A7,
WM_NCMBUTTONUP = 0x00A8,
WM_NCMBUTTONDBLCLK = 0x00A9,
WM_KEYDOWN = 0x0100,
WM_KEYUP = 0x0101,
WM_CHAR = 0x0102,
WM_DEADCHAR = 0x0103,
WM_SYSKEYDOWN = 0x0104,
WM_SYSKEYUP = 0x0105,
WM_SYSCHAR = 0x0106,
WM_SYSDEADCHAR = 0x0107,
WM_KEYLAST = 0x0108,
WM_IME_STARTCOMPOSITION = 0x010D,
WM_IME_ENDCOMPOSITION = 0x010E,
WM_IME_COMPOSITION = 0x010F,
WM_IME_KEYLAST = 0x010F,
WM_INITDIALOG = 0x0110,
WM_COMMAND = 0x0111,
WM_SYSCOMMAND = 0x0112,
WM_TIMER = 0x0113,
WM_HSCROLL = 0x0114,
WM_VSCROLL = 0x0115,
WM_INITMENU = 0x0116,
WM_INITMENUPOPUP = 0x0117,
WM_MENUSELECT = 0x011F,
WM_MENUCHAR = 0x0120,
WM_ENTERIDLE = 0x0121,
WM_MENURBUTTONUP = 0x0122,
WM_MENUDRAG = 0x0123,
WM_MENUGETOBJECT = 0x0124,
WM_UNINITMENUPOPUP = 0x0125,
WM_MENUCOMMAND = 0x0126,
WM_CTLCOLORMSGBOX = 0x0132,
WM_CTLCOLOREDIT = 0x0133,
WM_CTLCOLORLISTBOX = 0x0134,
WM_CTLCOLORBTN = 0x0135,
WM_CTLCOLORDLG = 0x0136,
WM_CTLCOLORSCROLLBAR = 0x0137,
WM_CTLCOLORSTATIC = 0x0138,
WM_MOUSEMOVE = 0x0200,
WM_LBUTTONDOWN = 0x0201,
WM_LBUTTONUP = 0x0202,
WM_LBUTTONDBLCLK = 0x0203,
WM_RBUTTONDOWN = 0x0204,
WM_RBUTTONUP = 0x0205,
WM_RBUTTONDBLCLK = 0x0206,
WM_MBUTTONDOWN = 0x0207,
WM_MBUTTONUP = 0x0208,
WM_MBUTTONDBLCLK = 0x0209,
WM_MOUSEWHEEL = 0x020A,
WM_PARENTNOTIFY = 0x0210,
WM_ENTERMENULOOP = 0x0211,
WM_EXITMENULOOP = 0x0212,
WM_NEXTMENU = 0x0213,
WM_SIZING = 0x0214,
WM_CAPTURECHANGED = 0x0215,
WM_MOVING = 0x0216,
WM_DEVICECHANGE = 0x0219,
WM_MDICREATE = 0x0220,
WM_MDIDESTROY = 0x0221,
WM_MDIACTIVATE = 0x0222,
WM_MDIRESTORE = 0x0223,
WM_MDINEXT = 0x0224,
WM_MDIMAXIMIZE = 0x0225,
WM_MDITILE = 0x0226,
WM_MDICASCADE = 0x0227,
WM_MDIICONARRANGE = 0x0228,
WM_MDIGETACTIVE = 0x0229,
WM_MDISETMENU = 0x0230,
WM_ENTERSIZEMOVE = 0x0231,
WM_EXITSIZEMOVE = 0x0232,
WM_DROPFILES = 0x0233,
WM_MDIREFRESHMENU = 0x0234,
WM_IME_SETCONTEXT = 0x0281,
WM_IME_NOTIFY = 0x0282,
WM_IME_CONTROL = 0x0283,
WM_IME_COMPOSITIONFULL = 0x0284,
WM_IME_SELECT = 0x0285,
WM_IME_CHAR = 0x0286,
WM_IME_REQUEST = 0x0288,
WM_IME_KEYDOWN = 0x0290,
WM_IME_KEYUP = 0x0291,
WM_MOUSEHOVER = 0x02A1,
WM_MOUSELEAVE = 0x02A3,
WM_CUT = 0x0300,
WM_COPY = 0x0301,
WM_PASTE = 0x0302,
WM_CLEAR = 0x0303,
WM_UNDO = 0x0304,
WM_RENDERFORMAT = 0x0305,
WM_RENDERALLFORMATS = 0x0306,
WM_DESTROYCLIPBOARD = 0x0307,
WM_DRAWCLIPBOARD = 0x0308,
WM_PAINTCLIPBOARD = 0x0309,
WM_VSCROLLCLIPBOARD = 0x030A,
WM_SIZECLIPBOARD = 0x030B,
WM_ASKCBFORMATNAME = 0x030C,
WM_CHANGECBCHAIN = 0x030D,
WM_HSCROLLCLIPBOARD = 0x030E,
WM_QUERYNEWPALETTE = 0x030F,
WM_PALETTEISCHANGING = 0x0310,
WM_PALETTECHANGED = 0x0311,
WM_HOTKEY = 0x0312,
WM_PRINT = 0x0317,
WM_PRINTCLIENT = 0x0318,
WM_HANDHELDFIRST = 0x0358,
WM_HANDHELDLAST = 0x035F,
WM_AFXFIRST = 0x0360,
WM_AFXLAST = 0x037F,
WM_PENWINFIRST = 0x0380,
WM_PENWINLAST = 0x038F,
WM_APP = 0x8000,
WM_USER = 0x0400
}
internal enum Cursors : uint
{
IDC_ARROW = 32512U,
IDC_IBEAM = 32513U,
IDC_WAIT = 32514U,
IDC_CROSS = 32515U,
IDC_UPARROW = 32516U,
IDC_SIZE = 32640U,
IDC_ICON = 32641U,
IDC_SIZENWSE = 32642U,
IDC_SIZENESW = 32643U,
IDC_SIZEWE = 32644U,
IDC_SIZENS = 32645U,
IDC_SIZEALL = 32646U,
IDC_NO = 32648U,
IDC_HAND = 32649U,
IDC_APPSTARTING = 32650U,
IDC_HELP = 32651U
}
internal enum TrackerEventFlags : uint
{
TME_HOVER = 0x00000001,
TME_LEAVE = 0x00000002,
TME_QUERY = 0x40000000,
TME_CANCEL = 0x80000000
}
internal enum MouseActivateFlags
{
MA_ACTIVATE = 1,
MA_ACTIVATEANDEAT = 2,
MA_NOACTIVATE = 3,
MA_NOACTIVATEANDEAT = 4
}
internal enum DialogCodes
{
DLGC_WANTARROWS = 0x0001,
DLGC_WANTTAB = 0x0002,
DLGC_WANTALLKEYS = 0x0004,
DLGC_WANTMESSAGE = 0x0004,
DLGC_HASSETSEL = 0x0008,
DLGC_DEFPUSHBUTTON = 0x0010,
DLGC_UNDEFPUSHBUTTON = 0x0020,
DLGC_RADIOBUTTON = 0x0040,
DLGC_WANTCHARS = 0x0080,
DLGC_STATIC = 0x0100,
DLGC_BUTTON = 0x2000
}
internal enum UpdateLayeredWindowsFlags
{
ULW_COLORKEY = 0x00000001,
ULW_ALPHA = 0x00000002,
ULW_OPAQUE = 0x00000004
}
internal enum AlphaFlags : byte
{
AC_SRC_OVER = 0x00,
AC_SRC_ALPHA = 0x01
}
internal enum RasterOperations : uint
{
SRCCOPY = 0x00CC0020,
SRCPAINT = 0x00EE0086,
SRCAND = 0x008800C6,
SRCINVERT = 0x00660046,
SRCERASE = 0x00440328,
NOTSRCCOPY = 0x00330008,
NOTSRCERASE = 0x001100A6,
MERGECOPY = 0x00C000CA,
MERGEPAINT = 0x00BB0226,
PATCOPY = 0x00F00021,
PATPAINT = 0x00FB0A09,
PATINVERT = 0x005A0049,
DSTINVERT = 0x00550009,
BLACKNESS = 0x00000042,
WHITENESS = 0x00FF0062
}
internal enum BrushStyles
{
BS_SOLID = 0,
BS_NULL = 1,
BS_HOLLOW = 1,
BS_HATCHED = 2,
BS_PATTERN = 3,
BS_INDEXED = 4,
BS_DIBPATTERN = 5,
BS_DIBPATTERNPT = 6,
BS_PATTERN8X8 = 7,
BS_DIBPATTERN8X8 = 8,
BS_MONOPATTERN = 9
}
internal enum HatchStyles
{
HS_HORIZONTAL = 0,
HS_VERTICAL = 1,
HS_FDIAGONAL = 2,
HS_BDIAGONAL = 3,
HS_CROSS = 4,
HS_DIAGCROSS = 5
}
internal enum CombineFlags
{
RGN_AND = 1,
RGN_OR = 2,
RGN_XOR = 3,
RGN_DIFF = 4,
RGN_COPY = 5
}
internal enum HitTest
{
HTERROR = -2,
HTTRANSPARENT = -1,
HTNOWHERE = 0,
HTCLIENT = 1,
HTCAPTION = 2,
HTSYSMENU = 3,
HTGROWBOX = 4,
HTSIZE = 4,
HTMENU = 5,
HTHSCROLL = 6,
HTVSCROLL = 7,
HTMINBUTTON = 8,
HTMAXBUTTON = 9,
HTLEFT = 10,
HTRIGHT = 11,
HTTOP = 12,
HTTOPLEFT = 13,
HTTOPRIGHT = 14,
HTBOTTOM = 15,
HTBOTTOMLEFT = 16,
HTBOTTOMRIGHT = 17,
HTBORDER = 18,
HTREDUCE = 8,
HTZOOM = 9 ,
HTSIZEFIRST = 10,
HTSIZELAST = 17,
HTOBJECT = 19,
HTCLOSE = 20,
HTHELP = 21
}
internal enum SystemParametersInfoActions : uint
{
GetBeep = 1,
SetBeep = 2,
GetMouse = 3,
SetMouse = 4,
GetBorder = 5,
SetBorder = 6,
GetKeyboardSpeed = 10,
SetKeyboardSpeed = 11,
LangDriver = 12,
IconHorizontalSpacing = 13,
GetScreenSaveTimeout = 14,
SetScreenSaveTimeout = 15,
GetScreenSaveActive = 16,
SetScreenSaveActive = 17,
GetGridGranularity = 18,
SetGridGranularity = 19,
SetDeskWallPaper = 20,
SetDeskPattern = 21,
GetKeyboardDelay = 22,
SetKeyboardDelay = 23,
IconVerticalSpacing = 24,
GetIconTitleWrap = 25,
SetIconTitleWrap = 26,
GetMenuDropAlignment = 27,
SetMenuDropAlignment = 28,
SetDoubleClkWidth = 29,
SetDoubleClkHeight = 30,
GetIconTitleLogFont = 31,
SetDoubleClickTime = 32,
SetMouseButtonSwap = 33,
SetIconTitleLogFont = 34,
GetFastTaskSwitch = 35,
SetFastTaskSwitch = 36,
SetDragFullWindows = 37,
GetDragFullWindows = 38,
GetNonClientMetrics = 41,
SetNonClientMetrics = 42,
GetMinimizedMetrics = 43,
SetMinimizedMetrics = 44,
GetIconMetrics = 45,
SetIconMetrics = 46,
SetWorkArea = 47,
GetWorkArea = 48,
SetPenWindows = 49,
GetFilterKeys = 50,
SetFilterKeys = 51,
GetToggleKeys = 52,
SetToggleKeys = 53,
GetMouseKeys = 54,
SetMouseKeys = 55,
GetShowSounds = 56,
SetShowSounds = 57,
GetStickyKeys = 58,
SetStickyKeys = 59,
GetAccessTimeout = 60,
SetAccessTimeout = 61,
GetSerialKeys = 62,
SetSerialKeys = 63,
GetSoundsEntry = 64,
SetSoundsEntry = 65,
GetHighContrast = 66,
SetHighContrast = 67,
GetKeyboardPref = 68,
SetKeyboardPref = 69,
GetScreenReader = 70,
SetScreenReader = 71,
GetAnimation = 72,
SetAnimation = 73,
GetFontSmoothing = 74,
SetFontSmoothing = 75,
SetDragWidth = 76,
SetDragHeight = 77,
SetHandHeld = 78,
GetLowPowerTimeout = 79,
GetPowerOffTimeout = 80,
SetLowPowerTimeout = 81,
SetPowerOffTimeout = 82,
GetLowPowerActive = 83,
GetPowerOffActive = 84,
SetLowPowerActive = 85,
SetPowerOffActive = 86,
SetCursors = 87,
SetIcons = 88,
GetDefaultInputLang = 89,
SetDefaultInputLang = 90,
SetLangToggle = 91,
GetWindwosExtension = 92,
SetMouseTrails = 93,
GetMouseTrails = 94,
ScreenSaverRunning = 97,
GetMouseHoverTime = 0x0066
}
[Flags]
internal enum FlagsAnimateWindow : uint
{
AW_HOR_POSITIVE = 0x00000001,
AW_HOR_NEGATIVE = 0x00000002,
AW_VER_POSITIVE = 0x00000004,
AW_VER_NEGATIVE = 0x00000008,
AW_CENTER = 0x00000010,
AW_HIDE = 0x00010000,
AW_ACTIVATE = 0x00020000,
AW_SLIDE = 0x00040000,
AW_BLEND =0x00080000
}
[Flags]
internal enum FlagsDCX : uint
{
DCX_WINDOW = 0x1,
DCX_CACHE = 0x2,
DCX_NORESETATTRS = 0x4,
DCX_CLIPCHILDREN = 0x8,
DCX_CLIPSIBLINGS = 0x10,
DCX_PARENTCLIP = 0x20,
DCX_EXCLUDERGN = 0x40,
DCX_INTERSECTRGN = 0x80,
DCX_EXCLUDEUPDATE = 0x100,
DCX_INTERSECTUPDATE = 0x200,
DCX_LOCKWINDOWUPDATE = 0x400,
DCX_NORECOMPUTE = 0x100000,
DCX_VALIDATE = 0x200000
}
}

52
src/Libraries/DockPanel_Src/DockSample/Extender/FromBase/Win32/Gdi32.cs

@ -0,0 +1,52 @@ @@ -0,0 +1,52 @@
// *****************************************************************************
//
// Copyright 2004, Weifen Luo
// All rights reserved. The software and associated documentation
// supplied hereunder are the proprietary information of Weifen Luo
// and are supplied subject to licence terms.
//
// WinFormsUI Library Version 1.0
// *****************************************************************************
using System;
using System.Runtime.InteropServices;
using DockSample.Win32;
namespace DockSample
{
internal class Gdi32
{
[DllImport("gdi32.dll", CharSet=CharSet.Auto)]
public static extern int CombineRgn(IntPtr dest, IntPtr src1, IntPtr src2, int flags);
[DllImport("gdi32.dll", CharSet=CharSet.Auto)]
public static extern IntPtr CreateRectRgnIndirect(ref Win32.RECT rect);
[DllImport("gdi32.dll", CharSet=CharSet.Auto)]
public static extern bool FillRgn(IntPtr hDC, IntPtr hrgn, IntPtr hBrush);
[DllImport("gdi32.dll", CharSet=CharSet.Auto)]
public static extern int GetClipBox(IntPtr hDC, ref Win32.RECT rectBox);
[DllImport("gdi32.dll", CharSet=CharSet.Auto)]
public static extern int SelectClipRgn(IntPtr hDC, IntPtr hRgn);
[DllImport("gdi32.dll", CharSet=CharSet.Auto)]
public static extern IntPtr CreateBrushIndirect(ref LOGBRUSH brush);
[DllImport("gdi32.dll", CharSet=CharSet.Auto)]
public static extern bool PatBlt(IntPtr hDC, int x, int y, int width, int height, uint flags);
[DllImport("gdi32.dll", CharSet=CharSet.Auto)]
public static extern IntPtr DeleteObject(IntPtr hObject);
[DllImport("gdi32.dll", CharSet=CharSet.Auto)]
public static extern bool DeleteDC(IntPtr hDC);
[DllImport("gdi32.dll", CharSet=CharSet.Auto)]
public static extern IntPtr SelectObject(IntPtr hDC, IntPtr hObject);
[DllImport("gdi32.dll", CharSet=CharSet.Auto)]
public static extern IntPtr CreateCompatibleDC(IntPtr hDC);
}
}

135
src/Libraries/DockPanel_Src/DockSample/Extender/FromBase/Win32/Structs.cs

@ -0,0 +1,135 @@ @@ -0,0 +1,135 @@
// *****************************************************************************
//
// Copyright 2004, Weifen Luo
// All rights reserved. The software and associated documentation
// supplied hereunder are the proprietary information of Weifen Luo
// and are supplied subject to licence terms.
//
// WinFormsUI Library Version 1.0
// *****************************************************************************
using System;
using System.Drawing;
using System.Runtime.InteropServices;
namespace DockSample.Win32
{
[StructLayout(LayoutKind.Sequential)]
internal struct MSG
{
public IntPtr hwnd;
public int message;
public IntPtr wParam;
public IntPtr lParam;
public int time;
public int pt_x;
public int pt_y;
}
[StructLayout(LayoutKind.Sequential)]
internal struct PAINTSTRUCT
{
public IntPtr hdc;
public int fErase;
public Rectangle rcPaint;
public int fRestore;
public int fIncUpdate;
public int Reserved1;
public int Reserved2;
public int Reserved3;
public int Reserved4;
public int Reserved5;
public int Reserved6;
public int Reserved7;
public int Reserved8;
}
[StructLayout(LayoutKind.Sequential)]
internal struct RECT
{
public int left;
public int top;
public int right;
public int bottom;
public override string ToString()
{
return "{left=" + left.ToString() + ", " + "top=" + top.ToString() + ", " +
"right=" + right.ToString() + ", " + "bottom=" + bottom.ToString() + "}";
}
}
[StructLayout(LayoutKind.Sequential)]
internal struct POINT
{
public int x;
public int y;
}
[StructLayout(LayoutKind.Sequential)]
internal struct SIZE
{
public int cx;
public int cy;
}
[StructLayout(LayoutKind.Sequential, Pack=1)]
internal struct BLENDFUNCTION
{
public byte BlendOp;
public byte BlendFlags;
public byte SourceConstantAlpha;
public byte AlphaFormat;
}
[StructLayout(LayoutKind.Sequential)]
internal struct TRACKMOUSEEVENTS
{
public const uint TME_HOVER = 0x00000001;
public const uint TME_LEAVE = 0x00000002;
public const uint TME_NONCLIENT = 0x00000010;
public const uint TME_QUERY = 0x40000000;
public const uint TME_CANCEL = 0x80000000;
public const uint HOVER_DEFAULT = 0xFFFFFFFF;
private uint cbSize;
private uint dwFlags;
private IntPtr hWnd;
private uint dwHoverTime;
public TRACKMOUSEEVENTS(uint dwFlags, IntPtr hWnd, uint dwHoverTime)
{
cbSize = 16;
this.dwFlags = dwFlags;
this.hWnd = hWnd;
this.dwHoverTime = dwHoverTime;
}
}
[StructLayout(LayoutKind.Sequential)]
internal struct LOGBRUSH
{
public uint lbStyle;
public uint lbColor;
public uint lbHatch;
}
[StructLayout(LayoutKind.Sequential)]
internal struct NCCALCSIZE_PARAMS
{
public RECT rgrc1;
public RECT rgrc2;
public RECT rgrc3;
IntPtr lppos;
}
[StructLayout(LayoutKind.Sequential)]
internal struct CWPRETSTRUCT
{
public int lResult;
public int lParam;
public int wParam;
public int message;
public IntPtr hwnd;
}
}

134
src/Libraries/DockPanel_Src/DockSample/Extender/FromBase/Win32/User32.cs

@ -0,0 +1,134 @@ @@ -0,0 +1,134 @@
// *****************************************************************************
//
// Copyright 2004, Weifen Luo
// All rights reserved. The software and associated documentation
// supplied hereunder are the proprietary information of Weifen Luo
// and are supplied subject to licence terms.
//
// WinFormsUI Library Version 1.0
// *****************************************************************************
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using DockSample.Win32;
namespace DockSample
{
internal class User32
{
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern bool AnimateWindow(IntPtr hWnd, uint dwTime, FlagsAnimateWindow dwFlags);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern bool DragDetect(IntPtr hWnd, Point pt);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern IntPtr GetSysColorBrush(int index);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern bool InvalidateRect(IntPtr hWnd, ref RECT rect, bool erase);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern IntPtr LoadCursor(IntPtr hInstance, uint cursor);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern IntPtr SetCursor(IntPtr hCursor);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern IntPtr GetFocus();
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern IntPtr SetFocus(IntPtr hWnd);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern bool ReleaseCapture();
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern bool WaitMessage();
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern bool TranslateMessage(ref MSG msg);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern bool DispatchMessage(ref MSG msg);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern bool PostMessage(IntPtr hWnd, int Msg, uint wParam, uint lParam);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern uint SendMessage(IntPtr hWnd, int Msg, uint wParam, uint lParam);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern uint SendMessage(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern bool GetMessage(ref MSG msg, int hWnd, uint wFilterMin, uint wFilterMax);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern bool PeekMessage(ref MSG msg, int hWnd, uint wFilterMin, uint wFilterMax, uint wFlag);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern IntPtr BeginPaint(IntPtr hWnd, ref PAINTSTRUCT ps);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern bool EndPaint(IntPtr hWnd, ref PAINTSTRUCT ps);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern IntPtr GetDC(IntPtr hWnd);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern IntPtr GetWindowDC(IntPtr hWnd);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern int ReleaseDC(IntPtr hWnd, IntPtr hDC);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern int ShowWindow(IntPtr hWnd, short cmdShow);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern bool MoveWindow(IntPtr hWnd, int x, int y, int width, int height, bool repaint);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern int SetWindowPos(IntPtr hWnd, IntPtr hWndAfter, int X, int Y, int Width, int Height, FlagsSetWindowPos flags);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern bool UpdateLayeredWindow(IntPtr hwnd, IntPtr hdcDst, ref POINT pptDst, ref SIZE psize, IntPtr hdcSrc, ref POINT pprSrc, Int32 crKey, ref BLENDFUNCTION pblend, Int32 dwFlags);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern bool GetWindowRect(IntPtr hWnd, ref RECT rect);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern bool ClientToScreen(IntPtr hWnd, ref POINT pt);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern bool ScreenToClient(IntPtr hWnd, ref POINT pt);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern bool TrackMouseEvent(ref TRACKMOUSEEVENTS tme);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern bool SetWindowRgn(IntPtr hWnd, IntPtr hRgn, bool redraw);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern ushort GetKeyState(int virtKey);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern IntPtr GetParent(IntPtr hWnd);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern bool DrawFocusRect(IntPtr hWnd, ref RECT rect);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern bool HideCaret(IntPtr hWnd);
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern bool ShowCaret(IntPtr hWnd);
[DllImport("user32.dll", CharSet=CharSet.Auto)]
public static extern bool SystemParametersInfo(SystemParametersInfoActions uAction, uint uParam, ref uint lpvParam, uint fuWinIni);
[DllImport("user32.dll", CharSet=CharSet.Auto)]
public static extern IntPtr WindowFromPoint(POINT point);
}
}

15
src/Libraries/DockPanel_Src/DockSample/Extender/Override/AutoHideStripOverride.cs

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
using System;
using WeifenLuo.WinFormsUI;
using System.Drawing;
using System.Drawing.Drawing2D;
namespace DockSample
{
public class AutoHideStripOverride : AutoHideStripVS2003
{
protected internal AutoHideStripOverride(DockPanel dockPanel) : base(dockPanel)
{
BackColor = SystemColors.ControlLight;
}
}
}

15
src/Libraries/DockPanel_Src/DockSample/Extender/Override/DockPaneStripOverride.cs

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
using System;
using WeifenLuo.WinFormsUI;
using System.Drawing;
using System.Drawing.Drawing2D;
namespace DockSample
{
public class DockPaneStripOverride : DockPaneStripVS2003
{
protected internal DockPaneStripOverride(DockPane pane) : base(pane)
{
BackColor = SystemColors.ControlLight;
}
}
}

BIN
src/Libraries/DockPanel_Src/DockSample/Images/File.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

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

@ -31,7 +31,63 @@ namespace DockSample @@ -31,7 +31,63 @@ namespace DockSample
private DummyToolbox m_toolbox = new DummyToolbox();
private DummyOutputWindow m_outputWindow = new DummyOutputWindow();
private DummyTaskList m_taskList = new DummyTaskList();
private Options m_options = new Options();
#if FRAMEWORK_VER_2x
private System.Windows.Forms.MenuStrip mainMenu;
private System.Windows.Forms.ToolStripSeparator menuItem4;
private System.Windows.Forms.ToolStripMenuItem menuItemFile;
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 menuItemOutputWindow;
private System.Windows.Forms.ToolStripMenuItem menuItemTaskList;
private System.Windows.Forms.ToolStripMenuItem menuItemToolbox;
private System.Windows.Forms.ToolStripMenuItem menuItemWindow;
private System.Windows.Forms.ToolStripMenuItem menuItemHelp;
private System.Windows.Forms.ToolStripMenuItem menuItemAbout;
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 menuItemTools;
private System.Windows.Forms.StatusStrip statusBar;
private System.Windows.Forms.ImageList imageList;
private System.Windows.Forms.ToolStripButton toolBarButtonNew;
private System.Windows.Forms.ToolStripButton toolBarButtonOpen;
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 menuItem1;
private System.Windows.Forms.ToolStripMenuItem menuItemToolBar;
private System.Windows.Forms.ToolStripMenuItem menuItemStatusBar;
private System.Windows.Forms.ToolStrip toolBar;
private System.Windows.Forms.ToolStripMenuItem menuItemNewWindow;
private WeifenLuo.WinFormsUI.DockPanel dockPanel;
private System.Windows.Forms.ToolStripMenuItem menuItemLockLayout;
private System.Windows.Forms.ToolStripSeparator menuItem2;
private System.Windows.Forms.ToolStripSeparator toolBarButtonSeparator1;
private System.Windows.Forms.ToolStripSeparator toolBarButtonSeparator2;
private System.Windows.Forms.ToolStripMenuItem menuItemLayoutByCode;
private System.Windows.Forms.ToolStripButton toolBarButtonLayoutByCode;
private System.Windows.Forms.ToolStripMenuItem menuItemLayoutByXml;
private System.Windows.Forms.ToolStripButton toolBarButtonLayoutByXml;
private System.Windows.Forms.ToolStripMenuItem menuItemSchemaDefault;
private System.Windows.Forms.ToolStripMenuItem menuItemSchemaOverride;
private System.Windows.Forms.ToolStripMenuItem menuItemSchemaFromBase;
private System.Windows.Forms.ToolStripSeparator menuItem3;
private System.Windows.Forms.ToolStripSeparator menuItem5;
private System.Windows.Forms.ToolStripMenuItem menuItemCloseAllButThisOne;
private System.Windows.Forms.ToolStripSeparator menuItem6;
private System.Windows.Forms.ToolStripMenuItem menuItemDockingMdi;
private System.Windows.Forms.ToolStripMenuItem menuItemDockingWindow;
private System.Windows.Forms.ToolStripMenuItem menuItemSystemMdi;
private System.Windows.Forms.ToolStripMenuItem menuItemDockingSdi;
private System.Windows.Forms.ToolStripMenuItem menuItemShowDocumentIcon;
private System.ComponentModel.IContainer components;
#else
private System.Windows.Forms.MainMenu mainMenu;
private System.Windows.Forms.MenuItem menuItem4;
private System.Windows.Forms.MenuItem menuItemFile;
@ -50,7 +106,6 @@ namespace DockSample @@ -50,7 +106,6 @@ namespace DockSample
private System.Windows.Forms.MenuItem menuItemClose;
private System.Windows.Forms.MenuItem menuItemCloseAll;
private System.Windows.Forms.MenuItem menuItemTools;
private System.Windows.Forms.MenuItem menuItemOptions;
private System.Windows.Forms.StatusBar statusBar;
private System.Windows.Forms.ImageList imageList;
private System.Windows.Forms.ToolBarButton toolBarButtonNew;
@ -79,7 +134,15 @@ namespace DockSample @@ -79,7 +134,15 @@ namespace DockSample
private System.Windows.Forms.MenuItem menuItemSchemaFromBase;
private System.Windows.Forms.MenuItem menuItem3;
private System.Windows.Forms.MenuItem menuItem5;
private System.Windows.Forms.MenuItem menuItemCloseAllButThisOne;
private System.Windows.Forms.MenuItem menuItem6;
private System.Windows.Forms.MenuItem menuItemDockingMdi;
private System.Windows.Forms.MenuItem menuItemDockingWindow;
private System.Windows.Forms.MenuItem menuItemSystemMdi;
private System.Windows.Forms.MenuItem menuItemDockingSdi;
private System.Windows.Forms.MenuItem menuItemShowDocumentIcon;
private System.ComponentModel.IContainer components;
#endif
public MainForm()
{
@ -109,6 +172,407 @@ namespace DockSample @@ -109,6 +172,407 @@ namespace DockSample
base.Dispose( disposing );
}
#if FRAMEWORK_VER_2x
#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.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(MainForm));
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.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.menuItem3 = new System.Windows.Forms.ToolStripSeparator();
this.menuItemSchemaDefault = new System.Windows.Forms.ToolStripMenuItem();
this.menuItemSchemaOverride = new System.Windows.Forms.ToolStripMenuItem();
this.menuItemSchemaFromBase = 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.menuItemShowDocumentIcon = 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.dockPanel = new WeifenLuo.WinFormsUI.DockPanel();
this.statusBar = new System.Windows.Forms.StatusStrip();
this.imageList = new System.Windows.Forms.ImageList(this.components);
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.SuspendLayout();
//
// mainMenu
//
this.mainMenu.Items.AddRange(new System.Windows.Forms.ToolStripMenuItem[] {
this.menuItemFile,
this.menuItemView,
this.menuItemTools,
this.menuItemWindow,
this.menuItemHelp});
this.mainMenu.MdiWindowListItem = this.menuItemWindow;
//
// menuItemFile
//
this.menuItemFile.Text = "&File";
this.menuItemFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuItemNew,
this.menuItemOpen,
this.menuItemClose,
this.menuItemCloseAll,
this.menuItemCloseAllButThisOne,
this.menuItem4,
this.menuItemExit});
this.menuItemFile.DropDownOpening += new System.EventHandler(this.menuItemFile_Popup);
//
// menuItemNew
//
this.menuItemNew.Text = "&New";
this.menuItemNew.Click += new System.EventHandler(this.menuItemNew_Click);
//
// menuItemOpen
//
this.menuItemOpen.Text = "&Open...";
this.menuItemOpen.Click += new System.EventHandler(this.menuItemOpen_Click);
//
// menuItemClose
//
this.menuItemClose.Text = "&Close";
this.menuItemClose.Click += new System.EventHandler(this.menuItemClose_Click);
//
// menuItemCloseAll
//
this.menuItemCloseAll.Text = "Close &All";
this.menuItemCloseAll.Click += new System.EventHandler(this.menuItemCloseAll_Click);
//
// menuItemCloseAllButThisOne
//
this.menuItemCloseAllButThisOne.Text = "Close All &But This One";
this.menuItemCloseAllButThisOne.Click += new System.EventHandler(this.menuItemCloseAllButThisOne_Click);
//
// menuItem4
//
this.menuItem4.Text = "-";
//
// menuItemExit
//
this.menuItemExit.Text = "&Exit";
this.menuItemExit.Click += new System.EventHandler(this.menuItemExit_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.Text = "&View";
//
// menuItemSolutionExplorer
//
this.menuItemSolutionExplorer.Text = "&Solution Explorer";
this.menuItemSolutionExplorer.Click += new System.EventHandler(this.menuItemSolutionExplorer_Click);
//
// menuItemPropertyWindow
//
this.menuItemPropertyWindow.ShortcutKeys = System.Windows.Forms.Keys.F4;
this.menuItemPropertyWindow.Text = "&Property Window";
this.menuItemPropertyWindow.Click += new System.EventHandler(this.menuItemPropertyWindow_Click);
//
// menuItemToolbox
//
this.menuItemToolbox.Text = "&Toolbox";
this.menuItemToolbox.Click += new System.EventHandler(this.menuItemToolbox_Click);
//
// menuItemOutputWindow
//
this.menuItemOutputWindow.Text = "&Output Window";
this.menuItemOutputWindow.Click += new System.EventHandler(this.menuItemOutputWindow_Click);
//
// menuItemTaskList
//
this.menuItemTaskList.Text = "Task &List";
this.menuItemTaskList.Click += new System.EventHandler(this.menuItemTaskList_Click);
//
// menuItemToolBar
//
this.menuItemToolBar.Checked = true;
this.menuItemToolBar.Text = "Tool &Bar";
this.menuItemToolBar.Click += new System.EventHandler(this.menuItemToolBar_Click);
//
// menuItemStatusBar
//
this.menuItemStatusBar.Checked = true;
this.menuItemStatusBar.Text = "Status B&ar";
this.menuItemStatusBar.Click += new System.EventHandler(this.menuItemStatusBar_Click);
//
// menuItem2
//
this.menuItem2.Text = "-";
//
// menuItemLayoutByCode
//
this.menuItemLayoutByCode.Text = "Layout By &Code";
this.menuItemLayoutByCode.Click += new System.EventHandler(this.menuItemLayoutByCode_Click);
//
// menuItemLayoutByXml
//
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.menuItem3,
this.menuItemSchemaDefault,
this.menuItemSchemaOverride,
this.menuItemSchemaFromBase,
this.menuItem6,
this.menuItemDockingMdi,
this.menuItemDockingSdi,
this.menuItemDockingWindow,
this.menuItemSystemMdi,
this.menuItem5,
this.menuItemShowDocumentIcon});
this.menuItemTools.MergeIndex = 2;
this.menuItemTools.Text = "&Tools";
this.menuItemTools.DropDownOpening += new System.EventHandler(this.menuItemTools_Popup);
//
// menuItemLockLayout
//
this.menuItemLockLayout.Text = "&Lock Layout";
this.menuItemLockLayout.Click += new System.EventHandler(this.menuItemLockLayout_Click);
//
// menuItem3
//
this.menuItem3.Text = "-";
//
// menuItemSchemaDefault
//
this.menuItemSchemaDefault.Checked = true;
this.menuItemSchemaDefault.Text = "Schema: &Default";
this.menuItemSchemaDefault.Click += new System.EventHandler(this.SetSchema);
//
// menuItemSchemaOverride
//
this.menuItemSchemaOverride.Text = "Schema: &Override From Default";
this.menuItemSchemaOverride.Click += new System.EventHandler(this.SetSchema);
//
// menuItemSchemaFromBase
//
this.menuItemSchemaFromBase.Text = "Schema: &Built From Base";
this.menuItemSchemaFromBase.Click += new System.EventHandler(this.SetSchema);
//
// menuItem6
//
this.menuItem6.Text = "-";
//
// menuItemDockingMdi
//
this.menuItemDockingMdi.Checked = true;
this.menuItemDockingMdi.Text = "Document Style: Docking &MDI";
this.menuItemDockingMdi.Click += new System.EventHandler(this.SetDocumentStyle);
//
// menuItemDockingSdi
//
this.menuItemDockingSdi.Text = "Document Style: Docking &SDI";
this.menuItemDockingSdi.Click += new System.EventHandler(this.SetDocumentStyle);
//
// menuItemDockingWindow
//
this.menuItemDockingWindow.Text = "Document Style: Docking &Window";
this.menuItemDockingWindow.Click += new System.EventHandler(this.SetDocumentStyle);
//
// menuItemSystemMdi
//
this.menuItemSystemMdi.Text = "Document Style: S&ystem MDI";
this.menuItemSystemMdi.Click += new System.EventHandler(this.SetDocumentStyle);
//
// menuItem5
//
this.menuItem5.Text = "-";
//
// menuItemShowDocumentIcon
//
this.menuItemShowDocumentIcon.Text = "&Show Document Icon";
this.menuItemShowDocumentIcon.Click += new System.EventHandler(this.menuItemShowDocumentIcon_Click);
//
// menuItemWindow
//
this.menuItemWindow.DropDownItems.AddRange(new System.Windows.Forms.ToolStripMenuItem[] {
this.menuItemNewWindow});
this.menuItemWindow.MergeIndex = 2;
this.menuItemWindow.Text = "&Window";
//
// menuItemNewWindow
//
this.menuItemNewWindow.Text = "&New Window";
this.menuItemNewWindow.Click += new System.EventHandler(this.menuItemNewWindow_Click);
//
// menuItemHelp
//
this.menuItemHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripMenuItem[] {
this.menuItemAbout});
this.menuItemHelp.MergeIndex = 3;
this.menuItemHelp.Text = "&Help";
//
// menuItemAbout
//
this.menuItemAbout.Text = "&About DockSample...";
this.menuItemAbout.Click += new System.EventHandler(this.menuItemAbout_Click);
//
// dockPanel
//
this.dockPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.dockPanel.Font = new System.Drawing.Font("Tahoma", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World, ((System.Byte)(0)));
this.dockPanel.Location = new System.Drawing.Point(0, 28);
this.dockPanel.Name = "dockPanel";
this.dockPanel.Size = new System.Drawing.Size(579, 359);
this.dockPanel.TabIndex = 0;
//
// statusBar
//
this.statusBar.Location = new System.Drawing.Point(0, 387);
this.statusBar.Name = "statusBar";
this.statusBar.Size = new System.Drawing.Size(579, 22);
this.statusBar.TabIndex = 4;
//
// imageList
//
this.imageList.ImageSize = new System.Drawing.Size(16, 16);
this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream")));
this.imageList.TransparentColor = System.Drawing.Color.Transparent;
//
// toolBar
//
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.ImageList = this.imageList;
this.toolBar.Location = new System.Drawing.Point(0, 0);
this.toolBar.Name = "toolBar";
this.toolBar.Size = new System.Drawing.Size(579, 28);
this.toolBar.TabIndex = 6;
this.toolBar.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.toolBar_ButtonClick);
//
// toolBarButtonNew
//
this.toolBarButtonNew.ImageIndex = 0;
this.toolBarButtonNew.ToolTipText = "Show Layout From XML";
//
// toolBarButtonOpen
//
this.toolBarButtonOpen.ImageIndex = 1;
this.toolBarButtonOpen.ToolTipText = "Open";
//
// toolBarButtonSolutionExplorer
//
this.toolBarButtonSolutionExplorer.ImageIndex = 2;
this.toolBarButtonSolutionExplorer.ToolTipText = "Solution Explorer";
//
// toolBarButtonPropertyWindow
//
this.toolBarButtonPropertyWindow.ImageIndex = 3;
this.toolBarButtonPropertyWindow.ToolTipText = "Property Window";
//
// toolBarButtonToolbox
//
this.toolBarButtonToolbox.ImageIndex = 4;
this.toolBarButtonToolbox.ToolTipText = "Tool Box";
//
// toolBarButtonOutputWindow
//
this.toolBarButtonOutputWindow.ImageIndex = 5;
this.toolBarButtonOutputWindow.ToolTipText = "Output Window";
//
// toolBarButtonTaskList
//
this.toolBarButtonTaskList.ImageIndex = 6;
this.toolBarButtonTaskList.ToolTipText = "Task List";
//
// toolBarButtonLayoutByCode
//
this.toolBarButtonLayoutByCode.ImageIndex = 7;
this.toolBarButtonLayoutByCode.ToolTipText = "Show Layout By Code";
//
// toolBarButtonLayoutByXml
//
this.toolBarButtonLayoutByXml.ImageIndex = 8;
this.toolBarButtonLayoutByXml.ToolTipText = "Show layout by predefined XML file";
//
// MainForm
//
this.ClientSize = new System.Drawing.Size(579, 409);
this.Controls.Add(this.dockPanel);
this.Controls.Add(this.toolBar);
this.Controls.Add(mainMenu);
this.Controls.Add(this.statusBar);
this.IsMdiContainer = true;
this.MainMenuStrip = this.mainMenu;
this.Name = "MainForm";
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.ResumeLayout(false);
}
#endregion
#else
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
@ -124,6 +588,7 @@ namespace DockSample @@ -124,6 +588,7 @@ namespace DockSample
this.menuItemOpen = new System.Windows.Forms.MenuItem();
this.menuItemClose = new System.Windows.Forms.MenuItem();
this.menuItemCloseAll = new System.Windows.Forms.MenuItem();
this.menuItemCloseAllButThisOne = new System.Windows.Forms.MenuItem();
this.menuItem4 = new System.Windows.Forms.MenuItem();
this.menuItemExit = new System.Windows.Forms.MenuItem();
this.menuItemView = new System.Windows.Forms.MenuItem();
@ -144,8 +609,13 @@ namespace DockSample @@ -144,8 +609,13 @@ namespace DockSample
this.menuItemSchemaDefault = new System.Windows.Forms.MenuItem();
this.menuItemSchemaOverride = new System.Windows.Forms.MenuItem();
this.menuItemSchemaFromBase = new System.Windows.Forms.MenuItem();
this.menuItem6 = new System.Windows.Forms.MenuItem();
this.menuItemDockingMdi = new System.Windows.Forms.MenuItem();
this.menuItemDockingSdi = new System.Windows.Forms.MenuItem();
this.menuItemDockingWindow = new System.Windows.Forms.MenuItem();
this.menuItemSystemMdi = new System.Windows.Forms.MenuItem();
this.menuItem5 = new System.Windows.Forms.MenuItem();
this.menuItemOptions = new System.Windows.Forms.MenuItem();
this.menuItemShowDocumentIcon = new System.Windows.Forms.MenuItem();
this.menuItemWindow = new System.Windows.Forms.MenuItem();
this.menuItemNewWindow = new System.Windows.Forms.MenuItem();
this.menuItemHelp = new System.Windows.Forms.MenuItem();
@ -184,6 +654,7 @@ namespace DockSample @@ -184,6 +654,7 @@ namespace DockSample
this.menuItemOpen,
this.menuItemClose,
this.menuItemCloseAll,
this.menuItemCloseAllButThisOne,
this.menuItem4,
this.menuItemExit});
this.menuItemFile.Text = "&File";
@ -213,14 +684,20 @@ namespace DockSample @@ -213,14 +684,20 @@ namespace DockSample
this.menuItemCloseAll.Text = "Close &All";
this.menuItemCloseAll.Click += new System.EventHandler(this.menuItemCloseAll_Click);
//
// menuItemCloseAllButThisOne
//
this.menuItemCloseAllButThisOne.Index = 4;
this.menuItemCloseAllButThisOne.Text = "Close All &But This One";
this.menuItemCloseAllButThisOne.Click += new System.EventHandler(this.menuItemCloseAllButThisOne_Click);
//
// menuItem4
//
this.menuItem4.Index = 4;
this.menuItem4.Index = 5;
this.menuItem4.Text = "-";
//
// menuItemExit
//
this.menuItemExit.Index = 5;
this.menuItemExit.Index = 6;
this.menuItemExit.Text = "&Exit";
this.menuItemExit.Click += new System.EventHandler(this.menuItemExit_Click);
//
@ -318,8 +795,13 @@ namespace DockSample @@ -318,8 +795,13 @@ namespace DockSample
this.menuItemSchemaDefault,
this.menuItemSchemaOverride,
this.menuItemSchemaFromBase,
this.menuItem6,
this.menuItemDockingMdi,
this.menuItemDockingSdi,
this.menuItemDockingWindow,
this.menuItemSystemMdi,
this.menuItem5,
this.menuItemOptions});
this.menuItemShowDocumentIcon});
this.menuItemTools.MergeOrder = 2;
this.menuItemTools.Text = "&Tools";
this.menuItemTools.Popup += new System.EventHandler(this.menuItemTools_Popup);
@ -354,16 +836,46 @@ namespace DockSample @@ -354,16 +836,46 @@ namespace DockSample
this.menuItemSchemaFromBase.Text = "Schema: &Built From Base";
this.menuItemSchemaFromBase.Click += new System.EventHandler(this.SetSchema);
//
// menuItem6
//
this.menuItem6.Index = 5;
this.menuItem6.Text = "-";
//
// menuItemDockingMdi
//
this.menuItemDockingMdi.Checked = true;
this.menuItemDockingMdi.Index = 6;
this.menuItemDockingMdi.Text = "Document Style: Docking &MDI";
this.menuItemDockingMdi.Click += new System.EventHandler(this.SetDocumentStyle);
//
// menuItemDockingSdi
//
this.menuItemDockingSdi.Index = 7;
this.menuItemDockingSdi.Text = "Document Style: Docking &SDI";
this.menuItemDockingSdi.Click += new System.EventHandler(this.SetDocumentStyle);
//
// menuItemDockingWindow
//
this.menuItemDockingWindow.Index = 8;
this.menuItemDockingWindow.Text = "Document Style: Docking &Window";
this.menuItemDockingWindow.Click += new System.EventHandler(this.SetDocumentStyle);
//
// menuItemSystemMdi
//
this.menuItemSystemMdi.Index = 9;
this.menuItemSystemMdi.Text = "Document Style: S&ystem MDI";
this.menuItemSystemMdi.Click += new System.EventHandler(this.SetDocumentStyle);
//
// menuItem5
//
this.menuItem5.Index = 5;
this.menuItem5.Index = 10;
this.menuItem5.Text = "-";
//
// menuItemOptions
// menuItemShowDocumentIcon
//
this.menuItemOptions.Index = 6;
this.menuItemOptions.Text = "&Options...";
this.menuItemOptions.Click += new System.EventHandler(this.menuItemOptions_Click);
this.menuItemShowDocumentIcon.Index = 11;
this.menuItemShowDocumentIcon.Text = "&Show Document Icon";
this.menuItemShowDocumentIcon.Click += new System.EventHandler(this.menuItemShowDocumentIcon_Click);
//
// menuItemWindow
//
@ -493,6 +1005,7 @@ namespace DockSample @@ -493,6 +1005,7 @@ namespace DockSample
// toolBarButtonLayoutByXml
//
this.toolBarButtonLayoutByXml.ImageIndex = 8;
this.toolBarButtonLayoutByXml.ToolTipText = "Show layout by predefined XML file";
//
// MainForm
//
@ -512,6 +1025,7 @@ namespace DockSample @@ -512,6 +1025,7 @@ namespace DockSample
}
#endregion
#endif
/// <summary>
/// The main entry point for the application.
@ -559,21 +1073,38 @@ namespace DockSample @@ -559,21 +1073,38 @@ namespace DockSample
aboutDialog.ShowDialog(this);
}
private DockContent FindDocument(string text)
private IDockContent FindDocument(string text)
{
DockContent[] documents = dockPanel.Documents;
if (dockPanel.DocumentStyle == DocumentStyles.SystemMdi)
{
foreach (Form form in MdiChildren)
if (form.Text == text)
return form as IDockContent;
return null;
}
else
{
IDockContent[] documents = dockPanel.Documents;
foreach (DockContent content in documents)
if (content.Text == text)
return content;
foreach (IDockContent content in documents)
if (content.DockHandler.TabText == text)
return content;
return null;
return null;
}
}
private void menuItemNew_Click(object sender, System.EventArgs e)
{
DummyDoc dummyDoc = CreateNewDocument();
dummyDoc.Show(dockPanel);
if (dockPanel.DocumentStyle == DocumentStyles.SystemMdi)
{
dummyDoc.MdiParent = this;
dummyDoc.Show();
}
else
dummyDoc.Show(dockPanel);
}
private DummyDoc CreateNewDocument()
@ -636,14 +1167,23 @@ namespace DockSample @@ -636,14 +1167,23 @@ namespace DockSample
private void menuItemFile_Popup(object sender, System.EventArgs e)
{
menuItemClose.Enabled = (dockPanel.ActiveDocument != null);
menuItemCloseAll.Enabled = (dockPanel.Documents.Length > 0);
if (dockPanel.DocumentStyle == DocumentStyles.SystemMdi)
{
menuItemClose.Enabled = menuItemCloseAll.Enabled = (ActiveMdiChild != null);
}
else
{
menuItemClose.Enabled = (dockPanel.ActiveDocument != null);
menuItemCloseAll.Enabled = (dockPanel.Documents.Length > 0);
}
}
private void menuItemClose_Click(object sender, System.EventArgs e)
{
if (dockPanel.ActiveDocument != null)
dockPanel.ActiveDocument.Close();
if (dockPanel.DocumentStyle == DocumentStyles.SystemMdi)
ActiveMdiChild.Close();
else if (dockPanel.ActiveDocument != null)
dockPanel.ActiveDocument.DockHandler.Close();
}
private void menuItemCloseAll_Click(object sender, System.EventArgs e)
@ -653,50 +1193,19 @@ namespace DockSample @@ -653,50 +1193,19 @@ namespace DockSample
private void CloseAllDocuments()
{
foreach (DockContent content in dockPanel.Documents)
content.Close();
}
private void dockPanel_ActiveDocumentChanged(object sender, System.EventArgs e)
{
if (m_options.ActiveDocumentChanged)
if (dockPanel.DocumentStyle == DocumentStyles.SystemMdi)
{
string text = "Event: ActiveDocumentChanged.\n";
if (dockPanel.ActiveDocument != null)
text += "ActiveDocument.Text = " + dockPanel.ActiveDocument.Text;
else
text += "ActiveDocument = (null)";
MessageBox.Show(text);
foreach (Form form in MdiChildren)
form.Close();
}
}
private void menuItemOptions_Click(object sender, System.EventArgs e)
{
OptionsDialog optionsDialog = new OptionsDialog(m_options);
optionsDialog.ShowDialog();
}
private void dockPanel_PaneAdded(object sender, WeifenLuo.WinFormsUI.DockContentEventArgs e)
{
if (m_options.ContentAdded)
{
string text = "Event: PaneAdded.\n";
text += "Pane.Text = " + e.Content.Text;
MessageBox.Show(text);
}
}
private void dockPanel_PaneRemoved(object sender, WeifenLuo.WinFormsUI.DockContentEventArgs e)
{
if (m_options.ContentRemoved)
else
{
string text = "Event: PaneRemoved.\n";
text += "Pane.Text = " + e.Content.Text;
MessageBox.Show(text);
foreach (IDockContent content in dockPanel.Documents)
content.DockHandler.Close();
}
}
private DockContent GetContentFromPersistString(string persistString)
private IDockContent GetContentFromPersistString(string persistString)
{
if (persistString == typeof(DummySolutionExplorer).ToString())
return m_solutionExplorer;
@ -751,6 +1260,29 @@ namespace DockSample @@ -751,6 +1260,29 @@ namespace DockSample
statusBar.Visible = menuItemStatusBar.Checked = !menuItemStatusBar.Checked;
}
#if FRAMEWORK_VER_2x
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);
}
#else
private void toolBar_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
{
if (e.Button == toolBarButtonNew)
@ -772,6 +1304,7 @@ namespace DockSample @@ -772,6 +1304,7 @@ namespace DockSample
else if (e.Button == toolBarButtonLayoutByXml)
menuItemLayoutByXml_Click(null, null);
}
#endif
private void menuItemNewWindow_Click(object sender, System.EventArgs e)
{
@ -792,6 +1325,8 @@ namespace DockSample @@ -792,6 +1325,8 @@ namespace DockSample
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));
@ -807,10 +1342,14 @@ namespace DockSample @@ -807,10 +1342,14 @@ namespace DockSample
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();
@ -818,6 +1357,8 @@ namespace DockSample @@ -818,6 +1357,8 @@ namespace DockSample
Stream xmlStream = assembly.GetManifestResourceStream("DockSample.Resources.DockPanel.xml");
dockPanel.LoadFromXml(xmlStream, m_deserializeDockContent);
xmlStream.Close();
dockPanel.ResumeLayout(true, true);
}
private void CloseAllContents()
@ -835,21 +1376,76 @@ namespace DockSample @@ -835,21 +1376,76 @@ namespace DockSample
private void SetSchema(object sender, System.EventArgs e)
{
MenuItem schema = (MenuItem)sender;
CloseAllContents();
if (schema == menuItemSchemaDefault)
if (sender == menuItemSchemaDefault)
Extender.SetSchema(dockPanel, Extender.Schema.Default);
else if (schema == menuItemSchemaOverride)
else if (sender == menuItemSchemaOverride)
Extender.SetSchema(dockPanel, Extender.Schema.Override);
else if (schema == menuItemSchemaFromBase)
else if (sender == menuItemSchemaFromBase)
Extender.SetSchema(dockPanel, Extender.Schema.FromBase);
menuItemSchemaDefault.Checked = false;
menuItemSchemaOverride.Checked = false;
menuItemSchemaFromBase.Checked = false;
schema.Checked = true;
menuItemSchemaDefault.Checked = (sender == menuItemSchemaDefault);
menuItemSchemaOverride.Checked = (sender == menuItemSchemaOverride);
menuItemSchemaFromBase.Checked = (sender == menuItemSchemaFromBase);
}
private void SetDocumentStyle(object sender, System.EventArgs e)
{
DocumentStyles oldStyle = dockPanel.DocumentStyle;
DocumentStyles newStyle;
if (sender == menuItemDockingMdi)
newStyle = DocumentStyles.DockingMdi;
else if (sender == menuItemDockingWindow)
newStyle = DocumentStyles.DockingWindow;
else if (sender == menuItemDockingSdi)
newStyle = DocumentStyles.DockingSdi;
else
newStyle = DocumentStyles.SystemMdi;
if (oldStyle == newStyle)
return;
if (oldStyle == DocumentStyles.SystemMdi || newStyle == DocumentStyles.SystemMdi)
CloseAllDocuments();
dockPanel.DocumentStyle = newStyle;
menuItemDockingMdi.Checked = (newStyle == DocumentStyles.DockingMdi);
menuItemDockingWindow.Checked = (newStyle == DocumentStyles.DockingWindow);
menuItemDockingSdi.Checked = (newStyle == DocumentStyles.DockingSdi);
menuItemSystemMdi.Checked = (newStyle == DocumentStyles.SystemMdi);
menuItemLayoutByCode.Enabled = (newStyle != DocumentStyles.SystemMdi);
menuItemLayoutByXml.Enabled = (newStyle != DocumentStyles.SystemMdi);
toolBarButtonLayoutByCode.Enabled = (newStyle != DocumentStyles.SystemMdi);
toolBarButtonLayoutByXml.Enabled = (newStyle != DocumentStyles.SystemMdi);
}
private void menuItemCloseAllButThisOne_Click(object sender, System.EventArgs e)
{
if (dockPanel.DocumentStyle == DocumentStyles.SystemMdi)
{
Form activeMdi = ActiveMdiChild;
foreach (Form form in MdiChildren)
{
if (form != activeMdi)
form.Close();
}
}
else
{
IDockContent[] documents = dockPanel.Documents;
foreach (IDockContent document in documents)
{
if (!document.DockHandler.IsActivated)
document.DockHandler.Close();
}
}
}
private void menuItemShowDocumentIcon_Click(object sender, System.EventArgs e)
{
dockPanel.ShowDocumentIcon = menuItemShowDocumentIcon.Checked= !menuItemShowDocumentIcon.Checked;
}
}
}

46
src/Libraries/DockPanel_Src/DockSample/MainForm.resx

@ -136,6 +136,12 @@ @@ -136,6 +136,12 @@
<data name="menuItemCloseAll.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="menuItemCloseAllButThisOne.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="menuItemCloseAllButThisOne.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="menuItem4.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
@ -256,16 +262,46 @@ @@ -256,16 +262,46 @@
<data name="menuItemSchemaFromBase.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="menuItem6.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="menuItem6.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="menuItemDockingMdi.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="menuItemDockingMdi.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="menuItemDockingSdi.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="menuItemDockingSdi.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="menuItemDockingWindow.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="menuItemDockingWindow.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="menuItemSystemMdi.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="menuItemSystemMdi.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="menuItem5.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="menuItem5.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="menuItemOptions.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<data name="menuItemShowDocumentIcon.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="menuItemOptions.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<data name="menuItemShowDocumentIcon.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="menuItemWindow.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@ -472,6 +508,9 @@ @@ -472,6 +508,9 @@
<data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="$this.Name">
<value>MainForm</value>
</data>
<data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
@ -481,9 +520,6 @@ @@ -481,9 +520,6 @@
<data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.Name">
<value>MainForm</value>
</data>
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>

35
src/Libraries/DockPanel_Src/DockSample/Options.cs

@ -1,35 +0,0 @@ @@ -1,35 +0,0 @@
using System;
namespace DockSample
{
/// <summary>
/// Summary description for Options.
/// </summary>
public class Options
{
public Options()
{
}
private bool m_activeDocumentChanged = false;
public bool ActiveDocumentChanged
{
get { return m_activeDocumentChanged; }
set { m_activeDocumentChanged = value; }
}
private bool m_contentAdded = false;
public bool ContentAdded
{
get { return m_contentAdded; }
set { m_contentAdded = value; }
}
private bool m_contentRemoved = false;
public bool ContentRemoved
{
get { return m_contentRemoved; }
set { m_contentRemoved = value; }
}
}
}

161
src/Libraries/DockPanel_Src/DockSample/OptionsDialog.cs

@ -1,161 +0,0 @@ @@ -1,161 +0,0 @@
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace DockSample
{
/// <summary>
/// Summary description for Options.
/// </summary>
public class OptionsDialog: System.Windows.Forms.Form
{
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.CheckBox ActiveDocumentChanged;
private System.Windows.Forms.CheckBox ContentAdded;
private System.Windows.Forms.CheckBox ContentRemoved;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.Button buttonCancel;
private Options m_options = null;
public OptionsDialog(Options options)
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
m_options = options;
ActiveDocumentChanged.Checked = m_options.ActiveDocumentChanged;
ContentAdded.Checked = m_options.ContentAdded;
ContentRemoved.Checked = m_options.ContentRemoved;
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(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.groupBox1 = new System.Windows.Forms.GroupBox();
this.ContentRemoved = new System.Windows.Forms.CheckBox();
this.ContentAdded = new System.Windows.Forms.CheckBox();
this.ActiveDocumentChanged = new System.Windows.Forms.CheckBox();
this.buttonOK = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.ContentRemoved);
this.groupBox1.Controls.Add(this.ContentAdded);
this.groupBox1.Controls.Add(this.ActiveDocumentChanged);
this.groupBox1.Location = new System.Drawing.Point(24, 24);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(264, 112);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Monitor &Events";
//
// ContentRemoved
//
this.ContentRemoved.Location = new System.Drawing.Point(24, 72);
this.ContentRemoved.Name = "ContentRemoved";
this.ContentRemoved.Size = new System.Drawing.Size(224, 24);
this.ContentRemoved.TabIndex = 2;
this.ContentRemoved.Text = "&3. ContentRemoved";
//
// ContentAdded
//
this.ContentAdded.Location = new System.Drawing.Point(24, 48);
this.ContentAdded.Name = "ContentAdded";
this.ContentAdded.Size = new System.Drawing.Size(224, 24);
this.ContentAdded.TabIndex = 1;
this.ContentAdded.Text = "&2. ContentAdded";
//
// ActiveDocumentChanged
//
this.ActiveDocumentChanged.Location = new System.Drawing.Point(24, 24);
this.ActiveDocumentChanged.Name = "ActiveDocumentChanged";
this.ActiveDocumentChanged.Size = new System.Drawing.Size(224, 24);
this.ActiveDocumentChanged.TabIndex = 0;
this.ActiveDocumentChanged.Text = "&1. ActiveDocumentChanged";
//
// buttonOK
//
this.buttonOK.Location = new System.Drawing.Point(112, 160);
this.buttonOK.Name = "buttonOK";
this.buttonOK.TabIndex = 1;
this.buttonOK.Text = "&OK";
this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
//
// buttonCancel
//
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.Location = new System.Drawing.Point(208, 160);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.TabIndex = 2;
this.buttonCancel.Text = "&Cancel";
this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
//
// OptionsDialog
//
this.AcceptButton = this.buttonOK;
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.CancelButton = this.buttonCancel;
this.ClientSize = new System.Drawing.Size(322, 215);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.groupBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "OptionsDialog";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Options";
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void buttonCancel_Click(object sender, System.EventArgs e)
{
Close();
}
private void buttonOK_Click(object sender, System.EventArgs e)
{
m_options.ActiveDocumentChanged = ActiveDocumentChanged.Checked;
m_options.ContentAdded = ContentAdded.Checked;
m_options.ContentRemoved = ContentRemoved.Checked;
Close();
}
}
}

193
src/Libraries/DockPanel_Src/DockSample/OptionsDialog.resx

@ -1,193 +0,0 @@ @@ -1,193 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
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">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</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 forserialized 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.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:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<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" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</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>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="groupBox1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="groupBox1.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="groupBox1.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="groupBox1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="groupBox1.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="groupBox1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="ContentRemoved.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="ContentRemoved.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="ContentRemoved.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="ContentAdded.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="ContentAdded.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="ContentAdded.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="ActiveDocumentChanged.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="ActiveDocumentChanged.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="ActiveDocumentChanged.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="buttonOK.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="buttonOK.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="buttonOK.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="buttonCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="buttonCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="buttonCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>(Default)</value>
</data>
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>80</value>
</data>
<data name="$this.Name">
<value>OptionsDialog</value>
</data>
<data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
</root>

BIN
src/Libraries/DockPanel_Src/DockSample/Resources/DockPanel.xml

Binary file not shown.

9
src/Libraries/DockPanel_Src/WinFormsUI.ndoc

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
<project SchemaVersion="1.3">
<assemblies>
<assembly location=".\WinFormsUI\bin\Debug\WeifenLuo.WinFormsUI.Docking.dll" documentation=".\WinFormsUI\bin\Debug\CodeDoc.xml" />
<assembly location=".\WinFormsUI\bin\NDoc\WeifenLuo.WinFormsUI.Docking.dll" documentation=".\WinFormsUI\bin\NDoc\CodeDoc.xml" />
</assemblies>
<documenters>
<documenter name="JavaDoc">
@ -20,13 +20,16 @@ @@ -20,13 +20,16 @@
<documenter name="MSDN">
<property name="OutputDirectory" value="..\doc\" />
<property name="HtmlHelpName" value="DockPanel" />
<property name="Title" value="DockPanel Class Library" />
<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="Preliminary" value="True" />
<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" />

2
src/Libraries/DockPanel_Src/WinFormsUI/AssemblyInfo.cs

@ -26,4 +26,4 @@ using System.Runtime.CompilerServices; @@ -26,4 +26,4 @@ using System.Runtime.CompilerServices;
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("0.99.0.3")]
[assembly: AssemblyVersion("1.0.0.0")]

2466
src/Libraries/DockPanel_Src/WinFormsUI/CodeDoc/CodeDoc.xml

File diff suppressed because it is too large Load Diff

73
src/Libraries/DockPanel_Src/WinFormsUI/Components/DragForm.cs

@ -0,0 +1,73 @@ @@ -0,0 +1,73 @@
// *****************************************************************************
//
// Copyright 2004, Weifen Luo
// All rights reserved. The software and associated documentation
// supplied hereunder are the proprietary information of Weifen Luo
// and are supplied subject to licence terms.
//
// WinFormsUI Library Version 1.0
// *****************************************************************************
using System;
using System.Windows.Forms;
namespace WeifenLuo.WinFormsUI
{
// Inspired by Chris Sano's article:
// http://msdn.microsoft.com/smartclient/default.aspx?pull=/library/en-us/dnwinforms/html/colorpicker.asp
// In Sano's article, the DragForm needs to meet the following criteria:
// (1) it was not to show up in the task bar;
// ShowInTaskBar = false
// (2) it needed to be the top-most window;
// TopMost = true (not necessary here)
// (3) its icon could not show up in the ALT+TAB window if the user pressed ALT+TAB during a drag-and-drop;
// FormBorderStyle = FormBorderStyle.None;
// Create with WS_EX_TOOLWINDOW window style.
// Compares with the solution in the artile by setting FormBorderStyle as FixedToolWindow,
// and then clip the window caption and border, this way is much simplier.
// (4) it was not to steal focus from the application when displayed.
// User Win32 ShowWindow API with SW_SHOWNOACTIVATE
// In addition, this form should only for display and therefore should act as transparent, otherwise
// WindowFromPoint will return this form, instead of the control beneath. Need BOTH of the following to
// achieve this (don't know why, spent hours to try it out :( ):
// 1. Enabled = false;
// 2. WM_NCHITTEST returns HTTRANSPARENT
internal class DragForm : Form
{
public DragForm()
{
FormBorderStyle = FormBorderStyle.None;
ShowInTaskbar = false;
SetStyle(ControlStyles.Selectable, false);
Enabled = false;
}
protected override CreateParams CreateParams
{
get
{
CreateParams createParams = base.CreateParams;
createParams.ExStyle |= (int)Win32.WindowExStyles.WS_EX_TOOLWINDOW;
return createParams;
}
}
protected override void WndProc(ref Message m)
{
if (m.Msg == (int)Win32.Msgs.WM_NCHITTEST)
{
m.Result = (IntPtr)Win32.HitTest.HTTRANSPARENT;
return;
}
base.WndProc (ref m);
}
public virtual void Show(bool bActivate)
{
if (bActivate)
Show();
else
User32.ShowWindow(Handle, (int)Win32.ShowWindowStyles.SW_SHOWNOACTIVATE);
}
}
}

556
src/Libraries/DockPanel_Src/WinFormsUI/Components/MdiClientController.cs

@ -0,0 +1,556 @@ @@ -0,0 +1,556 @@
// *****************************************************************************
//
// Copyright 2004, Weifen Luo
// All rights reserved. The software and associated documentation
// supplied hereunder are the proprietary information of Weifen Luo
// and are supplied subject to licence terms.
//
// WinFormsUI Library Version 1.0
// *****************************************************************************
using System;
using System.Drawing;
using System.Windows.Forms;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Runtime.InteropServices;
namespace WeifenLuo.WinFormsUI
{
// This class comes from Jacob Slusser's MdiClientController class.
// It has been modified to the coding standards.
[ToolboxBitmap(typeof(MdiClientController), "Resources.MdiClientController.bmp")]
internal class MdiClientController : NativeWindow, IComponent, IDisposable
{
private bool m_autoScroll = true;
private Color m_backColor = SystemColors.AppWorkspace;
private BorderStyle m_borderStyle = BorderStyle.Fixed3D;
private MdiClient m_mdiClient = null;
private Image m_image = null;
private ContentAlignment m_imageAlign = ContentAlignment.MiddleCenter;
private Form m_parentForm = null;
private ISite m_site = null;
private bool m_stretchImage = false;
public MdiClientController() : this(null)
{
}
public MdiClientController(Form parentForm)
{
ParentForm = parentForm;
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if(disposing)
{
lock(this)
{
if(Site != null && Site.Container != null)
Site.Container.Remove(this);
if(Disposed != null)
Disposed(this, EventArgs.Empty);
}
}
}
[DefaultValue(true), Category("Layout")]
[LocalizedDescription("MdiClientController.AutoScroll.Description")]
public bool AutoScroll
{
get { return m_autoScroll; }
set
{
// By default the MdiClient control scrolls. It can appear though that
// there are no scrollbars by turning them off when the non-client
// area is calculated. I decided to expose this method following
// the .NET vernacular of an AutoScroll property.
m_autoScroll = value;
if(MdiClient != null)
UpdateStyles();
}
}
[DefaultValue(typeof(Color), "AppWorkspace")]
[Category("Appearance")]
[LocalizedDescription("MdiClientController.BackColor.Description")]
public Color BackColor
{
// Use the BackColor property of the MdiClient control. This is one of
// the few properties in the MdiClient class that actually works.
get
{
if(MdiClient != null)
return MdiClient.BackColor;
return m_backColor;
}
set
{
m_backColor = value;
if(MdiClient != null)
MdiClient.BackColor = value;
}
}
[DefaultValue(BorderStyle.Fixed3D)]
[Category("Appearance")]
[LocalizedDescription("MdiClientController.BorderStyle.Description")]
public BorderStyle BorderStyle
{
get { return m_borderStyle; }
set
{
// Error-check the enum.
if(!Enum.IsDefined(typeof(BorderStyle), value))
throw new InvalidEnumArgumentException();
m_borderStyle = value;
if(MdiClient == null)
return;
// This property can actually be visible in design-mode,
// but to keep it consistent with the others,
// prevent this from being show at design-time.
if(Site != null && Site.DesignMode)
return;
// There is no BorderStyle property exposed by the MdiClient class,
// but this can be controlled by Win32 functions. A Win32 ExStyle
// of WS_EX_CLIENTEDGE is equivalent to a Fixed3D border and a
// Style of WS_BORDER is equivalent to a FixedSingle border.
// This code is inspired Jason Dori's article:
// "Adding designable borders to user controls".
// http://www.codeproject.com/cs/miscctrl/CsAddingBorders.asp
// Get styles using Win32 calls
int style = User32.GetWindowLong(MdiClient.Handle, (int)Win32.GetWindowLongIndex.GWL_STYLE);
int exStyle = User32.GetWindowLong(MdiClient.Handle, (int)Win32.GetWindowLongIndex.GWL_EXSTYLE);
// Add or remove style flags as necessary.
switch(m_borderStyle)
{
case BorderStyle.Fixed3D:
exStyle |= (int)Win32.WindowExStyles.WS_EX_CLIENTEDGE;
style &= ~((int)Win32.WindowStyles.WS_BORDER);
break;
case BorderStyle.FixedSingle:
exStyle &= ~((int)Win32.WindowExStyles.WS_EX_CLIENTEDGE);
style |= (int)Win32.WindowStyles.WS_BORDER;
break;
case BorderStyle.None:
style &= ~((int)Win32.WindowStyles.WS_BORDER);
exStyle &= ~((int)Win32.WindowExStyles.WS_EX_CLIENTEDGE);
break;
}
// Set the styles using Win32 calls
User32.SetWindowLong(MdiClient.Handle, (int)Win32.GetWindowLongIndex.GWL_STYLE, style);
User32.SetWindowLong(MdiClient.Handle, (int)Win32.GetWindowLongIndex.GWL_EXSTYLE, exStyle);
// Cause an update of the non-client area.
UpdateStyles();
}
}
[Browsable(false)]
public MdiClient MdiClient
{
get { return m_mdiClient; }
}
[Browsable(false)]
public new IntPtr Handle
{
// Hide this property during design-time.
get { return base.Handle; }
}
[DefaultValue(null)]
[Category("Appearance")]
[LocalizedDescription("MdiClientController.Image.Description")]
public Image Image
{
get { return m_image; }
set
{
m_image = value;
if(MdiClient != null)
MdiClient.Invalidate();
}
}
[DefaultValue(ContentAlignment.MiddleCenter)]
[Category("Appearance")]
[LocalizedDescription("MdiClientController.ImageAlign.Description")]
public ContentAlignment ImageAlign
{
get { return m_imageAlign; }
set
{
// Error-check the enum.
if(!Enum.IsDefined(typeof(ContentAlignment), value))
throw new InvalidEnumArgumentException();
m_imageAlign = value;
if(MdiClient != null)
MdiClient.Invalidate();
}
}
[Browsable(false)]
public Form ParentForm
{
get { return m_parentForm; }
set
{
// If the ParentForm has previously been set,
// unwire events connected to the old parent.
if(m_parentForm != null)
{
m_parentForm.HandleCreated -= new EventHandler(ParentFormHandleCreated);
m_parentForm.MdiChildActivate -= new EventHandler(ParentFormMdiChildActivate);
}
m_parentForm = value;
if(m_parentForm == null)
return;
// If the parent form has not been created yet,
// wait to initialize the MDI client until it is.
if(m_parentForm.IsHandleCreated)
{
InitializeMdiClient();
RefreshProperties();
}
else
m_parentForm.HandleCreated += new EventHandler(ParentFormHandleCreated);
m_parentForm.MdiChildActivate += new EventHandler(ParentFormMdiChildActivate);
}
}
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public ISite Site
{
get { return m_site; }
set
{
m_site = value;
if(m_site == null)
return;
// If the component is dropped onto a form during design-time,
// set the ParentForm property.
IDesignerHost host = (value.GetService(typeof(IDesignerHost)) as IDesignerHost);
if(host != null)
{
Form parent = host.RootComponent as Form;
if(parent != null)
ParentForm = parent;
}
}
}
[Category("Appearance"), DefaultValue(false)]
[LocalizedDescription("MdiClientController.StretchImage.Description")]
public bool StretchImage
{
get { return m_stretchImage; }
set
{
m_stretchImage = value;
if(MdiClient != null)
MdiClient.Invalidate();
}
}
public void RenewMdiClient()
{
// Reinitialize the MdiClient and its properties.
InitializeMdiClient();
RefreshProperties();
}
[Browsable(false)]
public event EventHandler Disposed;
[Browsable(false)]
public event EventHandler HandleAssigned;
[Browsable(false)]
public event EventHandler MdiChildActivate;
[Browsable(false)]
public event LayoutEventHandler Layout;
protected virtual void OnHandleAssigned(EventArgs e)
{
// Raise the HandleAssigned event.
if(HandleAssigned != null)
HandleAssigned(this, e);
}
protected virtual void OnMdiChildActivate(EventArgs e)
{
// Raise the MdiChildActivate event
if (MdiChildActivate != null)
MdiChildActivate(this, e);
}
protected virtual void OnLayout(LayoutEventArgs e)
{
// Raise the Layout event
if (Layout != null)
Layout(this, e);
}
[Category("Appearance")]
[LocalizedDescription("MdiClientController.Paint.Description")]
public event PaintEventHandler Paint;
protected virtual void OnPaint(PaintEventArgs e)
{
// Raise the Paint event.
if(Paint != null)
Paint(this, e);
}
protected override void WndProc(ref Message m)
{
switch(m.Msg)
{
//Do all painting in WM_PAINT to reduce flicker.
case (int)Win32.Msgs.WM_ERASEBKGND:
return;
case (int)Win32.Msgs.WM_PAINT:
// This code is influenced by Steve McMahon's article:
// "Painting in the MDI Client Area".
// http://vbaccelerator.com/article.asp?id=4306
// Use Win32 to get a Graphics object.
Win32.PAINTSTRUCT paintStruct = new Win32.PAINTSTRUCT();
IntPtr screenHdc = User32.BeginPaint(m.HWnd, ref paintStruct);
using(Graphics screenGraphics = Graphics.FromHdc(screenHdc))
{
// Get the area to be updated.
Rectangle clipRect = paintStruct.rcPaint;
// Double-buffer by painting everything to an image and
// then drawing the image.
int width = (MdiClient.ClientRectangle.Width > 0 ? MdiClient.ClientRectangle.Width : 0);
int height = (MdiClient.ClientRectangle.Height > 0 ? MdiClient.ClientRectangle.Height : 0);
if (width > 0 && height > 0)
{
using(Image i = new Bitmap(width, height))
{
using(Graphics g = Graphics.FromImage(i))
{
// This code comes from J Young's article:
// "Generating missing Paint event for TreeView and ListView".
// http://www.codeproject.com/cs/miscctrl/genmissingpaintevent.asp
// Draw base graphics and raise the base Paint event.
IntPtr hdc = g.GetHdc();
Message printClientMessage = Message.Create(m.HWnd, (int)Win32.Msgs.WM_PRINTCLIENT, hdc, IntPtr.Zero);
DefWndProc(ref printClientMessage);
g.ReleaseHdc(hdc);
// Draw the image here.
if(Image != null)
DrawImage(g, clipRect);
// Call our OnPaint here to draw graphics over the
// original and raise our Paint event.
OnPaint(new PaintEventArgs(g, clipRect));
}
// Now draw all the graphics at once.
screenGraphics.DrawImage(i, MdiClient.ClientRectangle);
}
}
}
User32.EndPaint(m.HWnd, ref paintStruct);
return;
case (int)Win32.Msgs.WM_SIZE:
// Repaint on every resize.
MdiClient.Invalidate();
break;
case (int)Win32.Msgs.WM_NCCALCSIZE:
// If AutoScroll is set to false, hide the scrollbars when the control
// calculates its non-client area.
if(!AutoScroll)
User32.ShowScrollBar(m.HWnd, (int)Win32.ScrollBars.SB_BOTH, 0 /*false*/);
break;
}
base.WndProc(ref m);
}
private void ParentFormHandleCreated(object sender, EventArgs e)
{
// The form has been created, unwire the event, and initialize the MdiClient.
this.m_parentForm.HandleCreated -= new EventHandler(ParentFormHandleCreated);
InitializeMdiClient();
RefreshProperties();
}
private void ParentFormMdiChildActivate(object sender, EventArgs e)
{
OnMdiChildActivate(e);
}
private void MdiClientLayout(object sender, LayoutEventArgs e)
{
OnLayout(e);
}
private void MdiClientHandleDestroyed(object sender, EventArgs e)
{
// If the MdiClient handle has been released, drop the reference and
// release the handle.
if(m_mdiClient != null)
{
m_mdiClient.HandleDestroyed -= new EventHandler(MdiClientHandleDestroyed);
m_mdiClient = null;
}
ReleaseHandle();
}
private void InitializeMdiClient()
{
// If the mdiClient has previously been set, unwire events connected
// to the old MDI.
if(MdiClient != null)
{
MdiClient.HandleDestroyed -= new EventHandler(MdiClientHandleDestroyed);
MdiClient.Layout -= new LayoutEventHandler(MdiClientLayout);
}
if(ParentForm == null)
return;
// Get the MdiClient from the parent form.
foreach (Control control in ParentForm.Controls)
{
// If the form is an MDI container, it will contain an MdiClient control
// just as it would any other control.
m_mdiClient = control as MdiClient;
if(m_mdiClient == null)
continue;
// Assign the MdiClient Handle to the NativeWindow.
ReleaseHandle();
AssignHandle(MdiClient.Handle);
// Raise the HandleAssigned event.
OnHandleAssigned(EventArgs.Empty);
// Monitor the MdiClient for when its handle is destroyed.
MdiClient.HandleDestroyed += new EventHandler(MdiClientHandleDestroyed);
MdiClient.Layout += new LayoutEventHandler(MdiClientLayout);
break;
}
}
private void RefreshProperties()
{
// Refresh all the properties
BackColor = m_backColor;
BorderStyle = m_borderStyle;
AutoScroll = m_autoScroll;
Image = m_image;
ImageAlign = m_imageAlign;
StretchImage = m_stretchImage;
}
private void DrawImage(Graphics g, Rectangle clipRect)
{
// Paint the background image.
if(StretchImage)
g.DrawImage(this.Image, MdiClient.ClientRectangle);
else
{
// Calculate the location of the image. (Note: this logic could be calculated during sizing
// instead of during painting to improve performance.)
Point pt = Point.Empty;
switch(ImageAlign)
{
case ContentAlignment.TopLeft:
pt = new Point(0, 0);
break;
case ContentAlignment.TopCenter:
pt = new Point((MdiClient.ClientRectangle.Width / 2) - (Image.Width / 2), 0);
break;
case ContentAlignment.TopRight:
pt = new Point(MdiClient.ClientRectangle.Width - Image.Width, 0);
break;
case ContentAlignment.MiddleLeft:
pt = new Point(0, (MdiClient.ClientRectangle.Height / 2) - (Image.Height / 2));
break;
case ContentAlignment.MiddleCenter:
pt = new Point((MdiClient.ClientRectangle.Width / 2) - (Image.Width / 2),
(MdiClient.ClientRectangle.Height / 2) - (Image.Height / 2));
break;
case ContentAlignment.MiddleRight:
pt = new Point(MdiClient.ClientRectangle.Width - Image.Width,
(MdiClient.ClientRectangle.Height / 2) - (Image.Height / 2));
break;
case ContentAlignment.BottomLeft:
pt = new Point(0, MdiClient.ClientRectangle.Height - Image.Height);
break;
case ContentAlignment.BottomCenter:
pt = new Point((MdiClient.ClientRectangle.Width / 2) - (Image.Width / 2),
MdiClient.ClientRectangle.Height - Image.Height);
break;
case ContentAlignment.BottomRight:
pt = new Point(MdiClient.ClientRectangle.Width - Image.Width,
MdiClient.ClientRectangle.Height - Image.Height);
break;
}
// Paint the image with the calculated coordinates and image size.
g.DrawImage(Image, new Rectangle(pt, Image.Size));
}
}
private void UpdateStyles()
{
// To show style changes, the non-client area must be repainted. Using the
// control's Invalidate method does not affect the non-client area.
// Instead use a Win32 call to signal the style has changed.
User32.SetWindowPos(MdiClient.Handle, IntPtr.Zero, 0, 0, 0, 0,
Win32.FlagsSetWindowPos.SWP_NOACTIVATE |
Win32.FlagsSetWindowPos.SWP_NOMOVE |
Win32.FlagsSetWindowPos.SWP_NOSIZE |
Win32.FlagsSetWindowPos.SWP_NOZORDER |
Win32.FlagsSetWindowPos.SWP_NOOWNERZORDER |
Win32.FlagsSetWindowPos.SWP_FRAMECHANGED);
}
}
}

16
src/Libraries/DockPanel_Src/WinFormsUI/Controls/CodeDoc/InertButton.xml

@ -63,6 +63,22 @@ @@ -63,6 +63,22 @@
<summary>Determines if the button is displayed as black and white.</summary>
<value><b>True</b> if the button is displayed as as black and white; otherwise <b>false</b>. The default value is <b>false</b>.</value>
</Property>
<Property name="RepeatClick">
<summary>Determines if the button will generate repeat click event when mouse is holding down.</summary>
<value><b>True</b> if the button will generate repeat click event when mouse is holding down; otherwise <b>false</b>. The default value is <b>false</b>.</value>
<remarks>The interval of generating repeat click is determined by <see cref="WeifenLuo.WinFormsUI.InertButton.RepeatClickDelay"/> and
<see cref="WeifenLuo.WinFormsUI.InertButton.RepeatClickInterval" /> properties.</remarks>
</Property>
<Property name="RepeatClickDelay">
<summary>Gets or sets the amount of time, in milliseconds, the <see cref="WeifenLuo.WinFormsUI.InertButton" />
waits while it is pressed before it starts repeating. The value must be non-negative.</summary>
<value>The default value is 500 milliseconds.</value>
</Property>
<Property name="RepeatClickInterval">
<summary>Gets or sets the amount of time, in milliseconds, between repeats once repeating
starts. The value must be non-negative.</summary>
<value>The default value is 100 milliseconds.</value>
</Property>
<Property name="TextAlign">
<summary>Gets or sets the alignment of the text in the button.</summary>
<value>One of the <see cref="System.Drawing.ContentAlignment" /> values. The default is <b>MiddleCenter</b>.</value>

171
src/Libraries/DockPanel_Src/WinFormsUI/Controls/InertButton.cs

@ -17,8 +17,32 @@ using System.ComponentModel; @@ -17,8 +17,32 @@ using System.ComponentModel;
namespace WeifenLuo.WinFormsUI
{
/// <include file='CodeDoc\InertButton.xml' path='//CodeDoc/Class[@name="InertButton"]/ClassDef/*'/>
public class InertButton : Control
[ToolboxItem(false)]
public class InertButton : Button
{
private enum RepeatClickStatus
{
Disabled,
Started,
Repeating,
Stopped
}
private class RepeatClickEventArgs : EventArgs
{
private static RepeatClickEventArgs _empty;
static RepeatClickEventArgs()
{
_empty = new RepeatClickEventArgs();
}
public new static RepeatClickEventArgs Empty
{
get { return _empty; }
}
}
private IContainer components = new Container();
private int m_borderWidth = 1;
private bool m_mouseOver = false;
@ -26,11 +50,9 @@ namespace WeifenLuo.WinFormsUI @@ -26,11 +50,9 @@ namespace WeifenLuo.WinFormsUI
private bool m_isPopup = false;
private Image m_imageEnabled = null;
private Image m_imageDisabled = null;
private ImageList m_imageList = null;
private int m_imageIndexEnabled = -1;
private int m_imageIndexDisabled = -1;
private bool m_monochrom = true;
private ContentAlignment m_textAlign = ContentAlignment.MiddleCenter;
private ToolTip m_toolTip = null;
private string m_toolTipText = "";
private Color m_borderColor = Color.Empty;
@ -64,15 +86,18 @@ namespace WeifenLuo.WinFormsUI @@ -64,15 +86,18 @@ namespace WeifenLuo.WinFormsUI
SetStyle(ControlStyles.ResizeRedraw, true);
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
// Prevent base class from trying to generate double click events and
// so testing clicks against the double click time and rectangle. Getting
// rid of this allows the user to press then release button very quickly.
SetStyle(ControlStyles.StandardDoubleClick, false);
//SetStyle(ControlStyles.StandardDoubleClick, false);
// Should not be allowed to select this control
SetStyle(ControlStyles.Selectable, false);
m_timer = new Timer();
m_timer.Enabled = false;
m_timer.Tick += new EventHandler(Timer_Tick);
}
/// <exclude/>
@ -89,7 +114,11 @@ namespace WeifenLuo.WinFormsUI @@ -89,7 +114,11 @@ namespace WeifenLuo.WinFormsUI
/// <include file='CodeDoc\InertButton.xml' path='//CodeDoc/Class[@name="InertButton"]/Property[@name="BorderColor"]/*'/>
[Category("Appearance")]
[LocalizedDescription("InertButton.BorderColor.Description")]
public Color BorderColor
#if FRAMEWORK_VER_2x
public new Color BorderColor
#else
public Color BorderColor
#endif
{
get { return m_borderColor; }
set
@ -140,10 +169,10 @@ namespace WeifenLuo.WinFormsUI @@ -140,10 +169,10 @@ namespace WeifenLuo.WinFormsUI
try
{
if (m_imageList == null || m_imageIndexEnabled == -1)
if (ImageList == null || ImageIndexEnabled == -1)
return null;
else
return m_imageList.Images[m_imageIndexEnabled];
return ImageList.Images[m_imageIndexEnabled];
}
catch
{
@ -179,10 +208,10 @@ namespace WeifenLuo.WinFormsUI @@ -179,10 +208,10 @@ namespace WeifenLuo.WinFormsUI
try
{
if (m_imageList == null || m_imageIndexDisabled == -1)
if (ImageList == null || ImageIndexDisabled == -1)
return null;
else
return m_imageList.Images[m_imageIndexDisabled];
return ImageList.Images[m_imageIndexDisabled];
}
catch
{
@ -205,24 +234,6 @@ namespace WeifenLuo.WinFormsUI @@ -205,24 +234,6 @@ namespace WeifenLuo.WinFormsUI
return (m_imageDisabled != null);
}
/// <include file='CodeDoc\InertButton.xml' path='//CodeDoc/Class[@name="InertButton"]/Property[@name="ImageList"]/*'/>
[Category("Appearance")]
[LocalizedDescription("InertButton.ImageList.Description")]
[DefaultValue(null)]
[RefreshProperties(RefreshProperties.Repaint)]
public ImageList ImageList
{
get { return m_imageList; }
set
{
if (m_imageList != value)
{
m_imageList = value;
Invalidate();
}
}
}
/// <include file='CodeDoc\InertButton.xml' path='//CodeDoc/Class[@name="InertButton"]/Property[@name="ImageIndexEnabled"]/*'/>
[Category("Appearance")]
[LocalizedDescription("InertButton.ImageIndexEnabled.Description")]
@ -298,23 +309,66 @@ namespace WeifenLuo.WinFormsUI @@ -298,23 +309,66 @@ namespace WeifenLuo.WinFormsUI
}
}
/// <include file='CodeDoc\InertButton.xml' path='//CodeDoc/Class[@name="InertButton"]/Property[@name="TextAlign"]/*'/>
[Category("Appearance")]
[LocalizedDescription("InertButton.TextAlign.Description")]
[DefaultValue(ContentAlignment.MiddleCenter)]
public ContentAlignment TextAlign
/// <include file='CodeDoc\InertButton.xml' path='//CodeDoc/Class[@name="InertButton"]/Property[@name="RepeatClick"]/*'/>
[Category("Behavior")]
[LocalizedDescription("InertButton.RepeatClick.Description")]
[DefaultValue(false)]
public bool RepeatClick
{
get { return (ClickStatus != RepeatClickStatus.Disabled); }
set { ClickStatus = RepeatClickStatus.Stopped; }
}
private RepeatClickStatus m_clickStatus = RepeatClickStatus.Disabled;
private RepeatClickStatus ClickStatus
{
get { return m_textAlign; }
get { return m_clickStatus; }
set
{
if (m_textAlign != value)
if (m_clickStatus == value)
return;
m_clickStatus = value;
if (ClickStatus == RepeatClickStatus.Started)
{
m_textAlign = value;
Invalidate();
Timer.Interval = RepeatClickDelay;
Timer.Enabled = true;
}
else if (ClickStatus == RepeatClickStatus.Repeating)
Timer.Interval = RepeatClickInterval;
else
Timer.Enabled = false;
}
}
private int m_repeatClickDelay = 500;
/// <include file='CodeDoc\InertButton.xml' path='//CodeDoc/Class[@name="InertButton"]/Property[@name="RepeatClickDelay"]/*'/>
[Category("Behavior")]
[LocalizedDescription("InertButton.RepeatClickDelay.Description")]
[DefaultValue(500)]
public int RepeatClickDelay
{
get { return m_repeatClickDelay; }
set { m_repeatClickDelay = value; }
}
private int m_repeatClickInterval = 100;
/// <include file='CodeDoc\InertButton.xml' path='//CodeDoc/Class[@name="InertButton"]/Property[@name="RepeatClickInterval"]/*'/>
[Category("Behavior")]
[LocalizedDescription("InertButton.RepeatClickInterval.Description")]
[DefaultValue(100)]
public int RepeatClickInterval
{
get { return m_repeatClickInterval; }
set { m_repeatClickInterval = value; }
}
private Timer m_timer;
private Timer Timer
{
get { return m_timer; }
}
/// <include file='CodeDoc\InertButton.xml' path='//CodeDoc/Class[@name="InertButton"]/Property[@name="ToolTipText"]/*'/>
[Category("Appearance")]
[LocalizedDescription("InertButton.ToolTipText.Description")]
@ -334,6 +388,14 @@ namespace WeifenLuo.WinFormsUI @@ -334,6 +388,14 @@ namespace WeifenLuo.WinFormsUI
}
}
private void Timer_Tick(object sender, EventArgs e)
{
if (m_mouseCapture && m_mouseOver)
OnClick(RepeatClickEventArgs.Empty);
if (ClickStatus == RepeatClickStatus.Started)
ClickStatus = RepeatClickStatus.Repeating;
}
/// <exclude/>
protected override void OnMouseDown(MouseEventArgs e)
{
@ -350,6 +412,21 @@ namespace WeifenLuo.WinFormsUI @@ -350,6 +412,21 @@ namespace WeifenLuo.WinFormsUI
//Redraw to show button state
Invalidate();
}
if (RepeatClick)
{
OnClick(RepeatClickEventArgs.Empty);
ClickStatus = RepeatClickStatus.Started;
}
}
/// <exclude/>
protected override void OnClick(EventArgs e)
{
if (RepeatClick && !(e is RepeatClickEventArgs))
return;
base.OnClick (e);
}
/// <exclude/>
@ -369,7 +446,8 @@ namespace WeifenLuo.WinFormsUI @@ -369,7 +446,8 @@ namespace WeifenLuo.WinFormsUI
Invalidate();
}
base.OnMouseUp(e);
if (RepeatClick)
ClickStatus = RepeatClickStatus.Stopped;
}
/// <exclude/>
@ -425,11 +503,20 @@ namespace WeifenLuo.WinFormsUI @@ -425,11 +503,20 @@ namespace WeifenLuo.WinFormsUI
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
DrawBackground(e.Graphics);
DrawImage(e.Graphics);
DrawText(e.Graphics);
DrawBorder(e.Graphics);
}
private void DrawBackground(Graphics g)
{
using (SolidBrush brush = new SolidBrush(BackColor))
{
g.FillRectangle(brush, ClientRectangle);
}
}
private void DrawImage(Graphics g)
{
Image image = this.Enabled ? ImageEnabled : ((ImageDisabled != null) ? ImageDisabled : ImageEnabled);
@ -562,10 +649,10 @@ namespace WeifenLuo.WinFormsUI @@ -562,10 +649,10 @@ namespace WeifenLuo.WinFormsUI
// Decide on the type of border to draw around image
if (!this.Enabled)
bs = m_isPopup ? ButtonBorderStyle.Outset : ButtonBorderStyle.Solid;
bs = IsPopup ? ButtonBorderStyle.Outset : ButtonBorderStyle.Solid;
else if (m_mouseOver && m_mouseCapture)
bs = ButtonBorderStyle.Inset;
else if (m_isPopup || m_mouseOver)
else if (IsPopup || m_mouseOver)
bs = ButtonBorderStyle.Outset;
else
bs = ButtonBorderStyle.Solid;
@ -602,8 +689,10 @@ namespace WeifenLuo.WinFormsUI @@ -602,8 +689,10 @@ namespace WeifenLuo.WinFormsUI
{
m_mouseOver = false;
m_mouseCapture = false;
if (RepeatClick && ClickStatus != RepeatClickStatus.Stopped)
ClickStatus = RepeatClickStatus.Stopped;
}
Invalidate();
}
}
}
}

16
src/Libraries/DockPanel_Src/WinFormsUI/Docking/AutoHidePane.cs

@ -24,6 +24,12 @@ namespace WeifenLuo.WinFormsUI @@ -24,6 +24,12 @@ namespace WeifenLuo.WinFormsUI
m_tabs = new AutoHideTabCollection(DockPane);
}
/// <exclude/>
~AutoHidePane()
{
Dispose(false);
}
/// <include file='CodeDoc/AutoHidePane.xml' path='//CodeDoc/Class[@name="AutoHidePane"]/Property[@name="DockPane"]/*'/>
public DockPane DockPane
{
@ -39,10 +45,14 @@ namespace WeifenLuo.WinFormsUI @@ -39,10 +45,14 @@ namespace WeifenLuo.WinFormsUI
/// <include file='CodeDoc/AutoHidePane.xml' path='//CodeDoc/Class[@name="AutoHidePane"]/Method[@name="Dispose"]/*'/>
/// <include file='CodeDoc/AutoHidePane.xml' path='//CodeDoc/Class[@name="AutoHidePane"]/Method[@name="Dispose()"]/*'/>
public virtual void Dispose()
public void Dispose()
{
Dispose(true);
}
/// <include file='CodeDoc/AutoHidePane.xml' path='//CodeDoc/Class[@name="AutoHidePane"]/Method[@name="Dispose(bool)"]/*'/>
protected virtual void Dispose(bool disposing)
{
// we don't need to dispose anything here, but we want to allow deriving classes
// to override dispose
}
}
}

29
src/Libraries/DockPanel_Src/WinFormsUI/Docking/AutoHideStripBase.cs

@ -26,6 +26,11 @@ namespace WeifenLuo.WinFormsUI @@ -26,6 +26,11 @@ namespace WeifenLuo.WinFormsUI
m_panesLeft = new AutoHidePaneCollection(panel, DockState.DockLeftAutoHide);
m_panesRight = new AutoHidePaneCollection(panel, DockState.DockRightAutoHide);
#if FRAMEWORK_VER_2x
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
#else
SetStyle(ControlStyles.DoubleBuffer, true);
#endif
SetStyle(ControlStyles.Selectable, false);
}
@ -149,9 +154,6 @@ namespace WeifenLuo.WinFormsUI @@ -149,9 +154,6 @@ namespace WeifenLuo.WinFormsUI
private void SetRegion()
{
if (Region == null)
Region = new Region();
DisplayingArea.Reset();
DisplayingArea.AddRectangle(RectangleTopLeft);
DisplayingArea.AddRectangle(RectangleTopRight);
@ -164,12 +166,6 @@ namespace WeifenLuo.WinFormsUI @@ -164,12 +166,6 @@ namespace WeifenLuo.WinFormsUI
Region = new Region(DisplayingArea);
}
/// <exclude />
protected override Size DefaultSize
{
get { return Size.Empty; }
}
/// <exclude/>
protected override void OnMouseDown(MouseEventArgs e)
{
@ -178,15 +174,15 @@ namespace WeifenLuo.WinFormsUI @@ -178,15 +174,15 @@ namespace WeifenLuo.WinFormsUI
if (e.Button != MouseButtons.Left)
return;
DockContent content = GetHitTest();
IDockContent content = GetHitTest();
if (content == null)
return;
if (content != DockPanel.ActiveAutoHideContent)
DockPanel.ActiveAutoHideContent = content;
if (!content.Pane.IsActivated)
content.Pane.Activate();
if (!content.DockHandler.Pane.IsActivated)
content.DockHandler.Pane.Activate();
}
/// <exclude/>
@ -194,13 +190,14 @@ namespace WeifenLuo.WinFormsUI @@ -194,13 +190,14 @@ namespace WeifenLuo.WinFormsUI
{
base.OnMouseHover(e);
DockContent content = GetHitTest();
IDockContent content = GetHitTest();
if (content != null && DockPanel.ActiveAutoHideContent != content)
DockPanel.ActiveAutoHideContent = content;
// requires further tracking of mouse hover behavior,
// call TrackMouseEvent
this.ResetMouseEventArgs();
Win32.TRACKMOUSEEVENTS tme = new Win32.TRACKMOUSEEVENTS(Win32.TRACKMOUSEEVENTS.TME_HOVER, Handle, Win32.TRACKMOUSEEVENTS.HOVER_DEFAULT);
User32.TrackMouseEvent(ref tme);
}
/// <exclude />
@ -224,13 +221,13 @@ namespace WeifenLuo.WinFormsUI @@ -224,13 +221,13 @@ namespace WeifenLuo.WinFormsUI
/// <include file='CodeDoc/AutoHideStripBase.xml' path='//CodeDoc/Class[@name="AutoHideStripBase"]/Method[@name="MeasureHeight()"]/*'/>
protected internal abstract int MeasureHeight();
private DockContent GetHitTest()
private IDockContent GetHitTest()
{
Point ptMouse = PointToClient(Control.MousePosition);
return GetHitTest(ptMouse);
}
/// <include file='CodeDoc/AutoHideStripBase.xml' path='//CodeDoc/Class[@name="AutoHideStripBase"]/Method[@name="GetHitTest(Point)"]/*'/>
protected abstract DockContent GetHitTest(Point point);
protected abstract IDockContent GetHitTest(Point point);
}
}

21
src/Libraries/DockPanel_Src/WinFormsUI/Docking/AutoHideStripVS2003.cs

@ -11,10 +11,12 @@ using System; @@ -11,10 +11,12 @@ using System;
using System.Drawing;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using System.ComponentModel;
namespace WeifenLuo.WinFormsUI
{
/// <include file='CodeDoc/AutoHideStripVS2003.xml' path='//CodeDoc/Class[@name="AutoHideStripVS2003"]/ClassDef/*'/>
[ToolboxItem(false)]
public class AutoHideStripVS2003 : AutoHideStripBase
{
private const int _ImageHeight = 16;
@ -179,7 +181,6 @@ namespace WeifenLuo.WinFormsUI @@ -179,7 +181,6 @@ namespace WeifenLuo.WinFormsUI
SetStyle(ControlStyles.ResizeRedraw, true);
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
BackColor = Color.WhiteSmoke;
}
@ -255,7 +256,7 @@ namespace WeifenLuo.WinFormsUI @@ -255,7 +256,7 @@ namespace WeifenLuo.WinFormsUI
foreach (AutoHideTabVS2003 tab in pane.Tabs)
{
int width = imageWidth + ImageGapLeft + ImageGapRight +
(int)g.MeasureString(tab.Content.TabText, Font).Width + 1 +
(int)g.MeasureString(tab.Content.DockHandler.TabText, Font).Width + 1 +
TextGapLeft + TextGapRight;
if (width > maxWidth)
maxWidth = width;
@ -281,8 +282,8 @@ namespace WeifenLuo.WinFormsUI @@ -281,8 +282,8 @@ namespace WeifenLuo.WinFormsUI
if (rectTab.IsEmpty)
return;
DockState dockState = tab.Content.DockState;
DockContent content = tab.Content;
DockState dockState = tab.Content.DockHandler.DockState;
IDockContent content = tab.Content;
OnBeginDrawTab(tab);
@ -314,19 +315,19 @@ namespace WeifenLuo.WinFormsUI @@ -314,19 +315,19 @@ namespace WeifenLuo.WinFormsUI
rectImage.Height = imageHeight;
rectImage.Width = imageWidth;
rectImage = GetTransformedRectangle(dockState, rectImage);
g.DrawIcon(content.Icon, rectImage);
g.DrawIcon(((Form)content).Icon, rectImage);
// Draw the text
if (content == content.Pane.ActiveContent)
if (content == content.DockHandler.Pane.ActiveContent)
{
Rectangle rectText = rectTab;
rectText.X += ImageGapLeft + imageWidth + ImageGapRight + TextGapLeft;
rectText.Width -= ImageGapLeft + imageWidth + ImageGapRight + TextGapLeft;
rectText = GetTransformedRectangle(dockState, rectText);
if (dockState == DockState.DockLeftAutoHide || dockState == DockState.DockRightAutoHide)
g.DrawString(content.TabText, Font, brushTabText, rectText, StringFormatTabVertical);
g.DrawString(content.DockHandler.TabText, Font, brushTabText, rectText, StringFormatTabVertical);
else
g.DrawString(content.TabText, Font, brushTabText, rectText, StringFormatTabHorizontal);
g.DrawString(content.DockHandler.TabText, Font, brushTabText, rectText, StringFormatTabHorizontal);
}
// Set rotate back
@ -397,7 +398,7 @@ namespace WeifenLuo.WinFormsUI @@ -397,7 +398,7 @@ namespace WeifenLuo.WinFormsUI
private Rectangle GetTabRectangle(AutoHideTabVS2003 tab, bool transformed)
{
DockState dockState = tab.Content.DockState;
DockState dockState = tab.Content.DockHandler.DockState;
Rectangle rectTabStrip = GetLogicalTabStripRectangle(dockState);
if (rectTabStrip.IsEmpty)
@ -437,7 +438,7 @@ namespace WeifenLuo.WinFormsUI @@ -437,7 +438,7 @@ namespace WeifenLuo.WinFormsUI
}
/// <exclude />
protected override DockContent GetHitTest(Point ptMouse)
protected override IDockContent GetHitTest(Point ptMouse)
{
foreach(DockState state in DockStates)
{

24
src/Libraries/DockPanel_Src/WinFormsUI/Docking/AutoHideTab.cs

@ -15,26 +15,36 @@ namespace WeifenLuo.WinFormsUI @@ -15,26 +15,36 @@ namespace WeifenLuo.WinFormsUI
/// <include file='CodeDoc/AutoHideTab.xml' path='//CodeDoc/Class[@name="AutoHideTab"]/ClassDef/*'/>
public class AutoHideTab : IDisposable
{
private DockContent m_content;
private IDockContent m_content;
/// <include file='CodeDoc/AutoHideTab.xml' path='//CodeDoc/Class[@name="AutoHideTab"]/Construct[@name="(DockContent)"]/*'/>
public AutoHideTab(DockContent content)
/// <include file='CodeDoc/AutoHideTab.xml' path='//CodeDoc/Class[@name="AutoHideTab"]/Construct[@name="(IDockContent)"]/*'/>
public AutoHideTab(IDockContent content)
{
m_content = content;
}
/// <exclude/>
~AutoHideTab()
{
Dispose(false);
}
/// <include file='CodeDoc/AutoHideTab.xml' path='//CodeDoc/Class[@name="AutoHideTab"]/Property[@name="Content"]/*'/>
public DockContent Content
public IDockContent Content
{
get { return m_content; }
}
/// <include file='CodeDoc/AutoHideTab.xml' path='//CodeDoc/Class[@name="AutoHideTab"]/Method[@name="Dispose"]/*'/>
/// <include file='CodeDoc/AutoHideTab.xml' path='//CodeDoc/Class[@name="AutoHideTab"]/Method[@name="Dispose()"]/*'/>
public virtual void Dispose()
public void Dispose()
{
Dispose(true);
}
/// <include file='CodeDoc/AutoHideTab.xml' path='//CodeDoc/Class[@name="AutoHideTab"]/Method[@name="Dispose(bool)"]/*'/>
protected virtual void Dispose(bool disposing)
{
// we don't need to dispose anything here, but we want to allow deriving classes
// to override dispose
}
}
}

12
src/Libraries/DockPanel_Src/WinFormsUI/Docking/AutoHideTabCollection.cs

@ -90,10 +90,10 @@ namespace WeifenLuo.WinFormsUI @@ -90,10 +90,10 @@ namespace WeifenLuo.WinFormsUI
{
get
{
DockContent content = DockPane.DisplayingContents[index];
IDockContent content = DockPane.DisplayingContents[index];
if (content == null)
throw(new IndexOutOfRangeException());
return content.AutoHideTab;
return content.DockHandler.AutoHideTab;
}
}
@ -104,8 +104,8 @@ namespace WeifenLuo.WinFormsUI @@ -104,8 +104,8 @@ namespace WeifenLuo.WinFormsUI
return (IndexOf(tab) != -1);
}
/// <include file='CodeDoc\AutoHideTabCollection.xml' path='//CodeDoc/Class[@name="AutoHideTabCollection"]/Method[@name="Contains(DockContent)"]/*'/>>
public bool Contains(DockContent content)
/// <include file='CodeDoc\AutoHideTabCollection.xml' path='//CodeDoc/Class[@name="AutoHideTabCollection"]/Method[@name="Contains(IDockContent)"]/*'/>>
public bool Contains(IDockContent content)
{
return (IndexOf(content) != -1);
}
@ -117,8 +117,8 @@ namespace WeifenLuo.WinFormsUI @@ -117,8 +117,8 @@ namespace WeifenLuo.WinFormsUI
return IndexOf(tab.Content);
}
/// <include file='CodeDoc\AutoHideTabCollection.xml' path='//CodeDoc/Class[@name="AutoHideTabCollection"]/Method[@name="IndexOf(DockContent)"]/*'/>>
public int IndexOf(DockContent content)
/// <include file='CodeDoc\AutoHideTabCollection.xml' path='//CodeDoc/Class[@name="AutoHideTabCollection"]/Method[@name="IndexOf(IDockContent)"]/*'/>>
public int IndexOf(IDockContent content)
{
return DockPane.DisplayingContents.IndexOf(content);
}

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

@ -14,7 +14,7 @@ namespace WeifenLuo.WinFormsUI @@ -14,7 +14,7 @@ namespace WeifenLuo.WinFormsUI
{
internal class AutoHideTabVS2003 : AutoHideTab
{
internal AutoHideTabVS2003(DockContent content) : base(content)
internal AutoHideTabVS2003(IDockContent content) : base(content)
{
}

72
src/Libraries/DockPanel_Src/WinFormsUI/Docking/AutoHideWindow.cs

@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
using System;
using System.Windows.Forms;
using System.Drawing;
using System.Runtime.InteropServices;
namespace WeifenLuo.WinFormsUI
{
@ -57,7 +58,7 @@ namespace WeifenLuo.WinFormsUI @@ -57,7 +58,7 @@ namespace WeifenLuo.WinFormsUI
}
private void SetActivePane()
{
DockPane value = (ActiveContent == null ? null : ActiveContent.Pane);
DockPane value = (ActiveContent == null ? null : ActiveContent.DockHandler.Pane);
if (value == m_activePane)
return;
@ -69,8 +70,8 @@ namespace WeifenLuo.WinFormsUI @@ -69,8 +70,8 @@ namespace WeifenLuo.WinFormsUI
m_activePane = value;
}
private DockContent m_activeContent = null;
public DockContent ActiveContent
private IDockContent m_activeContent = null;
public IDockContent ActiveContent
{
get { return m_activeContent; }
set
@ -80,7 +81,7 @@ namespace WeifenLuo.WinFormsUI @@ -80,7 +81,7 @@ namespace WeifenLuo.WinFormsUI
if (value != null)
{
if (!DockHelper.IsDockStateAutoHide(value.DockState) || value.DockPanel != DockPanel)
if (!DockHelper.IsDockStateAutoHide(value.DockHandler.DockState) || value.DockHandler.DockPanel != DockPanel)
throw(new InvalidOperationException(ResourceHelper.GetString(_ExceptionInvalidActiveContent)));
}
@ -106,7 +107,7 @@ namespace WeifenLuo.WinFormsUI @@ -106,7 +107,7 @@ namespace WeifenLuo.WinFormsUI
public DockState DockState
{
get { return ActiveContent == null ? DockState.Unknown : ActiveContent.DockState; }
get { return ActiveContent == null ? DockState.Unknown : ActiveContent.DockHandler.DockState; }
}
private bool m_flagAnimate = true;
@ -116,14 +117,30 @@ namespace WeifenLuo.WinFormsUI @@ -116,14 +117,30 @@ namespace WeifenLuo.WinFormsUI
set { m_flagAnimate = value; }
}
private bool m_flagDragging = false;
internal bool FlagDragging
{
get { return m_flagDragging; }
set
{
if (m_flagDragging == value)
return;
m_flagDragging = value;
SetTimerMouseTrack();
}
}
private void AnimateWindow(bool show)
{
if (!FlagAnimate)
if (!FlagAnimate && Visible != show)
{
Visible = show;
return;
}
Parent.SuspendLayout();
Rectangle rectSource = GetBounds(!show);
Rectangle rectTarget = GetBounds(show);
int dxLoc, dyLoc;
@ -147,14 +164,16 @@ namespace WeifenLuo.WinFormsUI @@ -147,14 +164,16 @@ namespace WeifenLuo.WinFormsUI
if (show)
{
Bounds = new Rectangle(-rectTarget.Width, -rectTarget.Height, rectTarget.Width, rectTarget.Height);
Visible = true;
if (Visible == false)
Visible = true;
PerformLayout();
}
SuspendLayout();
LayoutAnimateWindow(rectSource);
Visible = true;
if (Visible == false)
Visible = true;
int speedFactor = 1;
int totalPixels = (rectSource.Width != rectTarget.Width) ?
@ -180,7 +199,8 @@ namespace WeifenLuo.WinFormsUI @@ -180,7 +199,8 @@ namespace WeifenLuo.WinFormsUI
rectSource.Height = rectTarget.Height;
LayoutAnimateWindow(rectSource);
DockPanel.Update();
if (Parent != null)
Parent.Update();
remainPixels -= speedFactor;
@ -201,6 +221,7 @@ namespace WeifenLuo.WinFormsUI @@ -201,6 +221,7 @@ namespace WeifenLuo.WinFormsUI
}
}
ResumeLayout();
Parent.ResumeLayout();
}
private void LayoutAnimateWindow(Rectangle rect)
@ -210,9 +231,9 @@ namespace WeifenLuo.WinFormsUI @@ -210,9 +231,9 @@ namespace WeifenLuo.WinFormsUI
Rectangle rectClient = ClientRectangle;
if (DockState == DockState.DockLeftAutoHide)
ActivePane.Location = new Point(rectClient.Right - 2 - MeasureAutoHideWindow.SplitterSize - ActivePane.Width, ActivePane.Location.Y);
ActivePane.Location = new Point(rectClient.Right - 2 - Measures.SplitterSize - ActivePane.Width, ActivePane.Location.Y);
else if (DockState == DockState.DockTopAutoHide)
ActivePane.Location = new Point(ActivePane.Location.X, rectClient.Bottom - 2 - MeasureAutoHideWindow.SplitterSize - ActivePane.Height);
ActivePane.Location = new Point(ActivePane.Location.X, rectClient.Bottom - 2 - Measures.SplitterSize - ActivePane.Height);
}
private Rectangle GetBounds(bool show)
@ -245,7 +266,7 @@ namespace WeifenLuo.WinFormsUI @@ -245,7 +266,7 @@ namespace WeifenLuo.WinFormsUI
private void SetTimerMouseTrack()
{
if (ActivePane == null || ActivePane.IsActivated)
if (ActivePane == null || ActivePane.IsActivated || FlagDragging)
{
m_timerMouseTrack.Enabled = false;
return;
@ -273,18 +294,18 @@ namespace WeifenLuo.WinFormsUI @@ -273,18 +294,18 @@ namespace WeifenLuo.WinFormsUI
// exclude the border and the splitter
if (DockState == DockState.DockBottomAutoHide)
{
rect.Y += 2 + MeasureAutoHideWindow.SplitterSize;
rect.Height -= 2 + MeasureAutoHideWindow.SplitterSize;
rect.Y += 2 + Measures.SplitterSize;
rect.Height -= 2 + Measures.SplitterSize;
}
else if (DockState == DockState.DockRightAutoHide)
{
rect.X += 2 + MeasureAutoHideWindow.SplitterSize;
rect.Width -= 2 + MeasureAutoHideWindow.SplitterSize;
rect.X += 2 + Measures.SplitterSize;
rect.Width -= 2 + Measures.SplitterSize;
}
else if (DockState == DockState.DockTopAutoHide)
rect.Height -= 2 + MeasureAutoHideWindow.SplitterSize;
rect.Height -= 2 + Measures.SplitterSize;
else if (DockState == DockState.DockLeftAutoHide)
rect.Width -= 2 + MeasureAutoHideWindow.SplitterSize;
rect.Width -= 2 + Measures.SplitterSize;
return rect;
}
@ -357,7 +378,7 @@ namespace WeifenLuo.WinFormsUI @@ -357,7 +378,7 @@ namespace WeifenLuo.WinFormsUI
if (ActiveContent == null)
return;
if (!DockHelper.IsDockStateAutoHide(ActiveContent.DockState))
if (!DockHelper.IsDockStateAutoHide(ActiveContent.DockHandler.DockState))
{
FlagAnimate = false;
ActiveContent = null;
@ -390,5 +411,18 @@ namespace WeifenLuo.WinFormsUI @@ -390,5 +411,18 @@ namespace WeifenLuo.WinFormsUI
m_timerMouseTrack.Enabled = false;
}
}
protected override void WndProc(ref Message m)
{
if (m.Msg == (int)Win32.Msgs.WM_WINDOWPOSCHANGING)
{
int offset = (int)Marshal.OffsetOf(typeof(Win32.WINDOWPOS), "flags");
int flags = Marshal.ReadInt32(m.LParam, offset);
Marshal.WriteInt32(m.LParam, offset, flags | (int)Win32.FlagsSetWindowPos.SWP_NOCOPYBITS);
}
base.WndProc (ref m);
}
}
}

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

@ -20,7 +20,7 @@ namespace WeifenLuo.WinFormsUI @@ -20,7 +20,7 @@ namespace WeifenLuo.WinFormsUI
{
protected override int SplitterSize
{
get { return MeasureAutoHideWindow.SplitterSize; }
get { return Measures.SplitterSize; }
}
protected override void StartDrag()

2
src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/AutoHideStripVS2003.xml

@ -91,7 +91,7 @@ @@ -91,7 +91,7 @@
<Method name="GetHitTest(Point)">
<summary>Gets the hit test result of the auto hide tab strip using specified point.</summary>
<param name="point">The specified point.</param>
<returns>The <see cref="DockContent"/> tab of the specified point, null for nothing.</returns>
<returns>The <see cref="IDockContent"/> tab of the specified point, null for nothing.</returns>
</Method>
<Method name="OnBeginDrawTab(AutoHideTab)">
<summary>Invoked when begin to draw the tab.</summary>

12
src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/AutoHideTab.xml

@ -2,22 +2,22 @@ @@ -2,22 +2,22 @@
<CodeDoc>
<Class name="AutoHideTab">
<ClassDef>
<summary>Represent a <see cref="DockContent"/> displayed in the auto-hide tab strip area of <see cref="DockPanel"/>.</summary>
<summary>Represent a <see cref="IDockContent"/> displayed in the auto-hide tab strip area of <see cref="DockPanel"/>.</summary>
<remarks>When customizing the auto-hide tab strip area of the <see cref="DockPanel"/>, you can derive a class from <see cref="AutoHideStripBase"/>
class, and then plug it into the <see cref="DockPanel"/> through the <see cref="DockPanelExtender.AutoHideStripFactory"/> property of <see cref="DockPanel.Extender"/>. If you want to
associate data with auto-hide <see cref="DockContent"/>, you can derived a class from <see cref="AutoHideTab"/> class,
associate data with auto-hide <see cref="IDockContent"/>, you can derived a class from <see cref="AutoHideTab"/> class,
then plug it into the <see cref="DockPanel"/> through <see cref="DockPanelExtender.AutoHideTabFactory"/> property of <see cref="DockPanel.Extender"/>. The docking framework
will create the class instances and you can reference them through <see cref="AutoHidePane.Tabs"/> property.</remarks>
</ClassDef>
<Construct name="(DockContent)">
<Construct name="(IDockContent)">
<summary>Creates a instance of <see cref="AutoHideTab"/> class.</summary>
<param name="content">The <see cref="DockContent"/> object to associate with.</param>
<param name="content">The <see cref="IDockContent"/> object to associate with.</param>
<remarks>Instance of <see cref="AutoHideTab"/> or derived class should only be created by the docking framework.
The constructor should only be called within the implementation of <see cref="DockPanelExtender.IAutoHideTabFactory"/> interface or derived class's constructor.</remarks>
</Construct>
<Property name="Content">
<summary>Gets the associated <see cref="DockContent"/> object.</summary>
<value>A <see cref="DockContent" /> object which associates with this <see cref="AutoHideTab"/> object.</value>
<summary>Gets the associated <see cref="IDockContent"/> object.</summary>
<value>A <see cref="IDockContent" /> object which associates with this <see cref="AutoHideTab"/> object.</value>
</Property>
<Method name="Dispose">
<overloads>

12
src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/AutoHideTabCollection.xml

@ -34,9 +34,9 @@ @@ -34,9 +34,9 @@
<param name="tab">The <see cref="AutoHideTab" /> to locate in <see cref="AutoHideTabCollection" />.</param>
<returns><b>true</b> if <paramref name="tab" /> is found in the <see cref="AutoHideTabCollection" />; otherwise, <b>false</b>.</returns>
</Method>
<Method name="Contains(DockContent)">
<summary>Determines whether a <see cref="DockContent" /> is in the <see cref="AutoHideTabCollection" />.</summary>
<param name="content">The <see cref="DockContent" /> to locate in <see cref="AutoHideTabCollection" />.</param>
<Method name="Contains(IDockContent)">
<summary>Determines whether a <see cref="IDockContent" /> is in the <see cref="AutoHideTabCollection" />.</summary>
<param name="content">The <see cref="IDockContent" /> to locate in <see cref="AutoHideTabCollection" />.</param>
<returns><b>true</b> if <paramref name="content" /> is found in the <see cref="AutoHideTabCollection" />; otherwise, <b>false</b>.</returns>
</Method>
<Method name="IndexOf">
@ -47,9 +47,9 @@ @@ -47,9 +47,9 @@
<param name="tab">The <see cref="AutoHideTab" /> to locate in the <see cref="AutoHideTabCollection" />.</param>
<returns>The zero-based index of <paramref name="tab" /> within the entire <see cref="AutoHideTabCollection" />, if found; otherwise, -1.</returns>
</Method>
<Method name="IndexOf(DockContent)">
<summary>Searches for the specified <see cref="DockContent" /> and returns the zero-based index within the entire <see cref="AutoHideTabCollection" />.</summary>
<param name="content">The <see cref="DockContent" /> to locate in the <see cref="AutoHideTabCollection" />.</param>
<Method name="IndexOf(IDockContent)">
<summary>Searches for the specified <see cref="IDockContent" /> and returns the zero-based index within the entire <see cref="AutoHideTabCollection" />.</summary>
<param name="content">The <see cref="IDockContent" /> to locate in the <see cref="AutoHideTabCollection" />.</param>
<returns>The zero-based index of <paramref name="content" /> within the entire <see cref="AutoHideTabCollection" />, if found; otherwise, -1.</returns>
</Method>
</Class>

164
src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/DockContent.xml

@ -2,146 +2,79 @@ @@ -2,146 +2,79 @@
<CodeDoc>
<Class name="DockContent">
<ClassDef>
<summary>The smallest dockable unit within the docking framework.</summary>
<summary>The <see cref="System.Windows.Forms.Form" /> derived class that implements
<see cref="WeifenLuo.WinFormsUI.IDockContent" /> interface.</summary>
<remarks>
<para>
<see cref="DockContent" /> derives from <see cref="Form" /> class.
To use the DockPanel library, derive your form from <see cref="DockContent" /> class,
and implement your user interface in this class. There are several overloaded
<see cref="DockContent.Show" /> methods to show <see cref="DockContent" /> as specified docking state.
If <see cref="WeifenLuo.WinFormsUI.DockPanel.MdiIntegration" /> property is set to <b>true</b> and <see cref="DockContent.DockState" />
is <see cref="WeifenLuo.WinFormsUI.DockState.Document" />, the menu of the form will be merged into to the main form automatically.
<see cref="WeifenLuo.WinFormsUI.DockContent" /> derives from <see cref="Form" /> class.
To use the DockPanel library, you can derive your form from <see cref="DockContent" /> class,
and implement your user interface in this class. <see cref="WeifenLuo.WinFormsUI.DockContent" />
wraps all the properties, methods and events of <see cref="WeifenLuo.WinFormsUI.DockContentHandler" /> objects.
</para>
</remarks>
</ClassDef>
<Constructor name="()">
<summary>Initialize a new DockContent instance.</summary>
<summary>Initialize a new <see cref="WeifenLuo.WinFormsUI.Content" /> instance.</summary>
</Constructor>
<Property name="DockHandler">
<summary>Implementation of <see cref="WeifenLuo.WinFormsUI.IDockContent.DockHandler" />.</summary>
</Property>
<Property name="AllowRedocking">
<summary>Gets or sets to specify whether drag and drop re-docking is allowed.</summary>
<value><b>True</b> if drag and drop re-docking is allowed, otherwise, <b>false</b>.</value>
<summary>Wrapper of <see cref="WeifenLuo.WinFormsUI.DockContentHandler.AllowRedocking"/>.</summary>
</Property>
<Property name="AutoHidePortion">
<summary>Gets or sets to specify the portion of the screen size when showing in auto-hide mode.</summary>
<value>A value between 0 and 1 to specify the portion of the DockPanel to determine the size of the window when
displaying in auto-hide mode. The default value is 0.25 (25%).</value>
<exception cref="ArgumentOutOfRangeException">Thrown when value is not between 0 and 1.</exception>
<summary>Wrapper of <see cref="WeifenLuo.WinFormsUI.DockContentHandler.AutoHidePortion"/>.</summary>
</Property>
<Property name="CloseButton">
<summary>Gets or sets to enalbe/disable the close button for this DockContent in the DockPane.</summary>
<value><b>True</b> to enable the close button; <b>false</b> to disable.</value>
<summary>Wrapper of <see cref="WeifenLuo.WinFormsUI.DockContentHandler.CloseButton"/>.</summary>
</Property>
<Property name="DockableAreas">
<summary>Gets or sets to specify the areas this DockContent can be displayed.</summary>
<value>
Combination of <see cref="DockAreas" /> values.
If <see cref="DockContent.DockState" /> conflicts with this value, a exception will be thrown.
</value>
<summary>Wrapper of <see cref="WeifenLuo.WinFormsUI.DockContentHandler.DockableAreas"/>.</summary>
</Property>
<Property name="DockPanel">
<summary>Gets or sets to attach/detach the DockContent to DockPanel.</summary>
<value><see cref="WeifenLuo.WinFormsUI.DockPanel" /> object to attach. <b>Null</b> to detach this DockContent to any DockPanel.</value>
<summary>Wrapper of <see cref="WeifenLuo.WinFormsUI.DockContentHandler.DockPanel"/>.</summary>
</Property>
<Property name="DockState">
<summary>Gets or sets the docking state of <see cref="WeifenLuo.WinFormsUI.DockContent" />.</summary>
<value>
One of the <see cref="WeifenLuo.WinFormsUI.DockState" /> values:
<list type="table">
<listheader>
<term>Value</term>
<term>Description</term>
</listheader>
<item>
<description>
<see cref="WeifenLuo.WinFormsUI.DockState.Unknown" />
</description>
<description>Valid only when the <see cref="WeifenLuo.WinFormsUI.DockContent" /> is newly
initialized or detached from <see cref="WeifenLuo.WinFormsUI.DockPanel" />. Can not
be explicitly set.</description>
</item>
<item>
<description>
<see cref="WeifenLuo.WinFormsUI.DockState.Hidden" />
</description>
<description>Synchronized with the <see cref="WeifenLuo.WinFormsUI.DockContent.IsHidden" /> property.</description>
</item>
<item>
<description>
<b>Others</b>
</description>
<description>Synchronized with the docking state of
<see cref="WeifenLuo.WinFormsUI.DockContent.Pane" />.</description>
</item>
</list>
</value>
<include file='DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Property[@name="Pane"]/remarks' />
<summary>Wrapper of <see cref="WeifenLuo.WinFormsUI.DockContentHandler.DockState"/>.</summary>
</Property>
<Property name="FloatPane">
<summary>Gets or sets the containing <see cref="WeifenLuo.WinFormsUI.DockPane" /> object when floating.</summary>
<value>The containing <see cref="WeifenLuo.WinFormsUI.DockPane" /> object when floating.</value>
<include file='DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Property[@name="Pane"]/remarks' />
<summary>Wrapper of <see cref="WeifenLuo.WinFormsUI.DockContentHandler.FloatPane"/>.</summary>
</Property>
<Property name="HideOnClose">
<summary>Gets or sets to determine when clicking the close button, the DockContent form should be closed or hidden.</summary>
<value><b>True</b> to hide the form when clicking the close button; otherwise, <b>false</b>. The default value is <b>false</b>.</value>
<summary>Wrapper of <see cref="WeifenLuo.WinFormsUI.DockContentHandler.HideOnClose"/>.</summary>
</Property>
<Property name="IsActivated">
<summary>Gets to specified the DockContent object is currently activated.</summary>
<value><b>True</b> if the DockContent object is currently activated, otherwise, <b>false</b>.</value>
<summary>Wrapper of <see cref="WeifenLuo.WinFormsUI.DockContentHandler.IsActivated"/>.</summary>
</Property>
<Property name="IsFloat">
<summary>Gets or sets whether the DockContent object is floating.</summary>
<value><b>True</b> if the DockContent object is floating; otherwise, false.</value>
<summary>Wrapper of <see cref="WeifenLuo.WinFormsUI.DockContentHandler.IsFloat"/>.</summary>
</Property>
<Property name="IsHidden">
<summary>Gets or sets whether the DockContent object is hidden.</summary>
<value><b>True</b> if the DockContent object is hidden; otherwise, false.</value>
<summary>Wrapper of <see cref="WeifenLuo.WinFormsUI.DockContentHandler.IsHidden"/>.</summary>
</Property>
<Property name="Pane">
<summary>Gets or sets the displayed containing <see cref="WeifenLuo.WinFormsUI.DockPane" /> object.</summary>
<value>The currently displayed containing <see cref="WeifenLuo.WinFormsUI.DockPane" /> object.</value>
<remarks>
A <see cref="WeifenLuo.WinFormsUI.DockContent" /> object can have two containing
<see cref="WeifenLuo.WinFormsUI.DockPane" /> objects: <see cref="WeifenLuo.WinFormsUI.DockContent.PanelPane" /> and
<see cref="WeifenLuo.WinFormsUI.DockContent.FloatPane" />. The <see cref="WeifenLuo.WinFormsUI.DockContent.Pane" />
property returns currently displaying containing <see cref="WeifenLuo.WinFormsUI.DockPane" />. The docking state of a
<see cref="WeifenLuo.WinFormsUI.DockContent" /> object is always synchronized with its displaying containing
<see cref="WeifenLuo.WinFormsUI.DockPane" />.
</remarks>
<summary>Wrapper of <see cref="WeifenLuo.WinFormsUI.DockContentHandler.Pane"/>.</summary>
</Property>
<Property name="PanelPane">
<summary>Gets or sets the containing <see cref="WeifenLuo.WinFormsUI.DockPane" /> object when docked.</summary>
<value>The containing <see cref="WeifenLuo.WinFormsUI.DockPane" /> object when docked.</value>
<include file='DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Property[@name="Pane"]/remarks' />
<summary>Wrapper of <see cref="WeifenLuo.WinFormsUI.DockContentHandler.PanelPane"/>.</summary>
</Property>
<Property name="ShowHint">
<summary>Gets or sets the desired docking state for this DockContent object.</summary>
<value>One of the valid <see cref="WeifenLuo.WinFormsUI.DockState" /> values. This value should not
conflicts with <see cref="WeifenLuo.WinFormsUI.DockContent.DockableAreas" /> property.</value>
<summary>Wrapper of <see cref="WeifenLuo.WinFormsUI.DockContentHandler.ShowHint"/>.</summary>
</Property>
<Property name="TabPageContextMenu">
<summary>Gets or sets the context menu for the DockPane tab page.</summary>
<value>The <see cref="System.Windows.Forms.ContextMenu" /> for the DockPane tab page.</value>
<summary>Wrapper of <see cref="WeifenLuo.WinFormsUI.DockContentHandler.TabPageContextMenu"/>.</summary>
</Property>
<Property name="TabText">
<summary>Gets or sets the text to display for the DockPane tab strip.</summary>
<value>The text to display for the DockPane tab strip.</value>
<remarks>If this value is not set, the value of <see cref="Control.Text" /> will be used.</remarks>
<summary>Wrapper of <see cref="WeifenLuo.WinFormsUI.DockContentHandler.TabText"/>.</summary>
</Property>
<Property name="ToolTipText">
<summary>Gets or sets the tooltip text for this form.</summary>
<value>The tooltip text for this form.</value>
<summary>Wrapper of <see cref="WeifenLuo.WinFormsUI.DockContentHandler.ToolTipText"/>.</summary>
</Property>
<Property name="VisibleState">
<summary>Gets or sets the visible docking state for this form.</summary>
<value>One of the <see cref="WeifenLuo.WinFormsUI.DockState" /> values for visible docking state of this form.</value>
<summary>Wrapper of <see cref="WeifenLuo.WinFormsUI.DockContentHandler.VisibleState"/>.</summary>
</Property>
<Method name="Activate()">
<summary>Activates the DockContent form and gives it focus.</summary>
<remarks>Activating the DockContent form makes it the <see cref="WeifenLuo.WinFormsUI.DockPane.ActiveContent" /> of its
containing <see cref="WeifenLuo.WinFormsUI.DockPane" />. To determine the active DockContent in an application,
use <see cref="WeifenLuo.WinFormsUI.DockPanel.ActiveContent" /> property. To determine the active document
content, use <see cref="WeifenLuo.WinFormsUI.DockPanel.ActiveDocument" /> property.</remarks>
<summary>Wrapper of <see cref="WeifenLuo.WinFormsUI.DockContentHandler.Activate"/>.</summary>
</Method>
<Method name="GetPersistString()">
<summary>Gets the string to persist this DockContent object.</summary>
@ -149,52 +82,29 @@ @@ -149,52 +82,29 @@
<include file='DockPanel.xml' path='//CodeDoc/Delegate[@name="DeserializeDockContent"]/remarks' />
</Method>
<Method name="IsDockStateValid(DockState)">
<summary>Test with <see cref="WeifenLuo.WinFormsUI.DockContent.DockableAreas" /> to see whether the specified
<see cref="WeifenLuo.WinFormsUI.DockState" /> is valid.</summary>
<param name="dockState">The specified <see cref="WeifenLuo.WinFormsUI.DockState" /> value to test.</param>
<summary>Wrapper of <see cref="WeifenLuo.WinFormsUI.DockContentHandler.IsDockStateValid"/>.</summary>
</Method>
<Method name="OnDockStateChanged(EventArgs)">
<summary>Raises the <see cref="WeifenLuo.WinFormsUI.DockContent.DockStateChanged" /> event.</summary>
<param name="e">An <see cref="System.EventArgs" /> that contains the event data.</param>
</Method>
<Method name="Show">
<overloads>
<summary>Displays the form. Overloaded.</summary>
</overloads>
</Method>
<Method name="Show()">
<summary>Displays the form, with default settings.</summary>
<remarks>If <see cref="WeifenLuo.WinFormsUI.DockContent.DockPanel"/> property is set, the form
will be displayed as <see cref="WeifenLuo.WinFormsUI.DockContent.ShowHint"/> docking state;
otherwise it will be displayed as normal form.</remarks>
<summary>Wrapper of <see cref="WeifenLuo.WinFormsUI.DockContentHandler.Show"/>.</summary>
</Method>
<Method name="Show(DockPane, DockAlignment, double)">
<summary>Displays the form, as specified nested docking.</summary>
<param name="prevPane">The target <see cref="WeifenLuo.WinFormsUI.DockPane"/> to dock.</param>
<param name="alignment">The edge of the target <see cref="WeifenLuo.WinFormsUI.DockPane"/> to dock.</param>
<param name="proportion">The proportion size of the source <see cref="WeifenLuo.WinFormsUI.DockPane"/> to take
inside the target <see cref="WeifenLuo.WinFormsUI.DockPane"/>.</param>
<summary>Wrapper of <see cref="WeifenLuo.WinFormsUI.DockContentHandler.Show"/>.</summary>
</Method>
<Method name="Show(DockPane, DockContent)">
<summary>Displays the form, at the specified tab location of DockPane</summary>
<param name="pane">The target <see cref="WeifenLuo.WinFormsUI.DockPane"/> to contain this DockContent.</param>
<param name="beforeContent">The position to show in the tab strip of the <see cref="WeifenLuo.WinFormsUI.DockPane"/>.
<b>Null</b> to show at the last position in the tab strip.
</param>
<Method name="Show(DockPane, IDockContent)">
<summary>Wrapper of <see cref="WeifenLuo.WinFormsUI.DockContentHandler.Show"/>.</summary>
</Method>
<Method name="Show(DockPanel)">
<summary>Displays the form, attaching to specified DockPanel.</summary>
<param name="dockPanel">The <see cref="WeifenLuo.WinFormsUI.DockPanel"/> object to attach.</param>
<summary>Wrapper of <see cref="WeifenLuo.WinFormsUI.DockContentHandler.Show"/>.</summary>
</Method>
<Method name="Show(DockPanel, Rectangle)">
<summary>Displays the form, as floating window at the specified location and size.</summary>
<param name="dockPanel">The <see cref="WeifenLuo.WinFormsUI.DockPanel"/> object to attach.</param>
<param name="floatWindowBounds">The bounds of the floating window.</param>
<summary>Wrapper of <see cref="WeifenLuo.WinFormsUI.DockContentHandler.Show"/>.</summary>
</Method>
<Method name="Show(DockPanel, DockState)">
<summary>Displays the form, with specified docking state.</summary>
<param name="dockPanel">The <see cref="WeifenLuo.WinFormsUI.DockPanel"/> object to attach.</param>
<param name="dockState">The docking state to display.</param>
<summary>Wrapper of <see cref="WeifenLuo.WinFormsUI.DockContentHandler.Show"/>.</summary>
</Method>
<Event name="DockStateChanged">
<summary>Occurs when the <see cref="WeifenLuo.WinFormsUI.DockContent.DockState"/> property changed.</summary>

16
src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/DockContentCollection.xml

@ -2,21 +2,21 @@ @@ -2,21 +2,21 @@
<CodeDoc>
<Class name="DockContentCollection">
<ClassDef>
<summary>Provides methods to manage a collection of <see cref="WeifenLuo.WinFormsUI.DockContent" /> objects.</summary>
<summary>Provides methods to manage a collection of <see cref="WeifenLuo.WinFormsUI.IDockContent" /> objects.</summary>
</ClassDef>
<Property name="Item">
<summary>
<para>Gets a <see cref="WeifenLuo.WinFormsUI.DockContent" /> at the specified index.</para>
<para>Gets a <see cref="WeifenLuo.WinFormsUI.IDockContent" /> at the specified index.</para>
<para>In C#, this property is the indexer for the <see cref="WeifenLuo.WinFormsUI.DockContentCollection" /> class.</para>
</summary>
</Property>
<Method name="Contains(DockContent)">
<Method name="Contains(IDockContent)">
<summary>
Determines whether a <see cref="WeifenLuo.WinFormsUI.DockContent" /> is in the
Determines whether a <see cref="WeifenLuo.WinFormsUI.IDockContent" /> is in the
<see cref="WeifenLuo.WinFormsUI.DockContentCollection" />.
</summary>
<param name="content">
The <see cref="WeifenLuo.WinFormsUI.DockContent" /> to locate in
The <see cref="WeifenLuo.WinFormsUI.IDockContent" /> to locate in
<see cref="WeifenLuo.WinFormsUI.DockContentCollection" />.
</param>
<returns>
@ -25,14 +25,14 @@ @@ -25,14 +25,14 @@
otherwise, <b>false</b>.
</returns>
</Method>
<Method name="IndexOf(DockContent)">
<Method name="IndexOf(IDockContent)">
<summary>
Searches for the specified <see cref="WeifenLuo.WinFormsUI.DockContent" />
Searches for the specified <see cref="WeifenLuo.WinFormsUI.IDockContent" />
and returns the zero-based index within the entire
<see cref="WeifenLuo.WinFormsUI.DockContentCollection" />.
</summary>
<param name="content">
The <see cref="WeifenLuo.WinFormsUI.DockContent" />
The <see cref="WeifenLuo.WinFormsUI.IDockContent" />
to locate in the <see cref="WeifenLuo.WinFormsUI.DockContentCollection" />
</param>
<returns>

247
src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/DockContentHandler.xml

@ -0,0 +1,247 @@ @@ -0,0 +1,247 @@
<?xml version="1.0" encoding="utf-8" ?>
<CodeDoc>
<Delegate name="GetPersistStringDelegate">
<summary>
Callback used by <see cref="WeifenLuo.WinFormsUI.DockContentHandler"/>
to get a string for serialization.
</summary>
<returns>
The string for serialization.
</returns>
<remarks>
A <see cref="WeifenLuo.WinFormsUI.GetPersistStringDelegate"/> can be passed to DockContentHandler
through the constructor, or by setting its <see cref="WeifenLuo.WinFormsUI.DockContentHandler.GetPersistStringDelegate" /> property.
</remarks>
</Delegate>
<Class name="DockContentHandler">
<ClassDef>
<summary>Handles the form as dockable by DockPanel.</summary>
<remarks>
<para>
To use the DockPanel library, implement <see cref="IDockContent" /> interface on your form.
the <see cref="IDockContent" /> interface has a property <see cref="WeifenLuo.WinFormsUI.IDockContent.DockHandler" /> returns a
<see cref="WeifenLuo.WinFormsUI.DockContentHandler" /> object.
There are several overloaded <see cref="DockContentHandler.Show" /> methods to show <see cref="IDockContent" /> as specified docking state.
</para>
</remarks>
</ClassDef>
<Constructor name="Overloads">
<overloads>
<summary>Initializes a new instance of <see cref="WeifenLuo.WinFormsUI.DockContentHandler" /> class.</summary>
</overloads>
</Constructor>
<Constructor name="(Form)">
<summary>Initialize a new instance of <see cref="WeifenLuo.WinFormsUI.DockContentHandler" /> class,
associates with the specified <see cref="Form" /> object.</summary>
<param name="form">The <see cref="Form"/> object to associate with.</param>
</Constructor>
<Constructor name="(Form, GetPersistStringDelegate)">
<summary>Initialize a new instance of <see cref="WeifenLuo.WinFormsUI.DockContentHandler" /> class,
associates with the specified <see cref="Form" /> object, providing the specified serialization callback.</summary>
<param name="form">The <see cref="Form"/> object to associate with.</param>
<param name="getPersistStringDelegate">The <see cref="WeifenLuo.WinFormsUI.GetPersistStringDelegate"/> callback for serialization.</param>
</Constructor>
<Property name="AllowRedocking">
<summary>Gets or sets to specify whether drag and drop re-docking is allowed.</summary>
<value><b>True</b> if drag and drop re-docking is allowed, otherwise, <b>false</b>.</value>
</Property>
<Property name="AutoHidePortion">
<summary>Gets or sets to specify the portion of the screen size when showing in auto-hide mode.</summary>
<value>A value between 0 and 1 to specify the portion of the DockPanel to determine the size of the window when
displaying in auto-hide mode. The default value is 0.25 (25%).</value>
<exception cref="ArgumentOutOfRangeException">Thrown when value is not between 0 and 1.</exception>
</Property>
<Property name="CloseButton">
<summary>Gets or sets to enalbe/disable the close button for this IDockContent in the DockPane.</summary>
<value><b>True</b> to enable the close button; <b>false</b> to disable.</value>
</Property>
<Property name="DockableAreas">
<summary>Gets or sets to specify the areas this IDockContent can be displayed.</summary>
<value>
Combination of <see cref="DockAreas" /> values.
If <see cref="DockContentHandler.DockState" /> conflicts with this value, a exception will be thrown.
</value>
</Property>
<Property name="DockPanel">
<summary>Gets or sets to attach/detach the IDockContent to DockPanel.</summary>
<value><see cref="WeifenLuo.WinFormsUI.DockPanel" /> object to attach. <b>Null</b> to detach this IDockContent to any DockPanel.</value>
</Property>
<Property name="DockState">
<summary>Gets or sets the docking state of <see cref="WeifenLuo.WinFormsUI.IDockContent" />.</summary>
<value>
One of the <see cref="WeifenLuo.WinFormsUI.DockState" /> values:
<list type="table">
<listheader>
<term>Value</term>
<term>Description</term>
</listheader>
<item>
<description>
<see cref="WeifenLuo.WinFormsUI.DockState.Unknown" />
</description>
<description>Valid only when the <see cref="WeifenLuo.WinFormsUI.IDockContent" /> is newly
initialized or detached from <see cref="WeifenLuo.WinFormsUI.DockPanel" />. Can not
be explicitly set.</description>
</item>
<item>
<description>
<see cref="WeifenLuo.WinFormsUI.DockState.Hidden" />
</description>
<description>Synchronized with the <see cref="WeifenLuo.WinFormsUI.DockContentHandler.IsHidden" /> property.</description>
</item>
<item>
<description>
<b>Others</b>
</description>
<description>Synchronized with the docking state of
<see cref="WeifenLuo.WinFormsUI.DockContentHandler.Pane" />.</description>
</item>
</list>
</value>
<include file='DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Property[@name="Pane"]/remarks' />
</Property>
<Property name="FloatPane">
<summary>Gets or sets the containing <see cref="WeifenLuo.WinFormsUI.DockPane" /> object when floating.</summary>
<value>The containing <see cref="WeifenLuo.WinFormsUI.DockPane" /> object when floating.</value>
<include file='DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Property[@name="Pane"]/remarks' />
</Property>
<Property name="Form">
<summary>Gets the form associated with this <see cref="WeifenLuo.WinFormsUI.DockContentHandler" />.</summary>
<value>The form associated with this <see cref="WeifenLuo.WinFormsUI.DockContentHandler" />.</value>
</Property>
<Property name="Content">
<summary>Gets the IDockContent form associated with this <see cref="WeifenLuo.WinFormsUI.DockContentHandler" />.</summary>
<value>The IDockContent form associated with this <see cref="WeifenLuo.WinFormsUI.DockContentHandler" />.</value>
</Property>
<Property name="HideOnClose">
<summary>Gets or sets to determine when clicking the close button, the IDockContent form should be closed or hidden.</summary>
<value><b>True</b> to hide the form when clicking the close button; otherwise, <b>false</b>. The default value is <b>false</b>.</value>
</Property>
<Property name="Icon">
<summary>Gets the icon for displaying in the tab strip.</summary>
<value>The icon of the form for displaying in the tab strip.</value>
</Property>
<Property name="IsActivated">
<summary>Gets to specified the IDockContent object is currently activated.</summary>
<value><b>True</b> if the IDockContent object is currently activated, otherwise, <b>false</b>.</value>
</Property>
<Property name="IsFloat">
<summary>Gets or sets whether the IDockContent object is floating.</summary>
<value><b>True</b> if the IDockContent object is floating; otherwise, false.</value>
</Property>
<Property name="IsHidden">
<summary>Gets or sets whether the IDockContent object is hidden.</summary>
<value><b>True</b> if the IDockContent object is hidden; otherwise, false.</value>
</Property>
<Property name="Pane">
<summary>Gets or sets the displayed containing <see cref="WeifenLuo.WinFormsUI.DockPane" /> object.</summary>
<value>The currently displayed containing <see cref="WeifenLuo.WinFormsUI.DockPane" /> object.</value>
<remarks>
A <see cref="WeifenLuo.WinFormsUI.IDockContent" /> object can have two containing
<see cref="WeifenLuo.WinFormsUI.DockPane" /> objects: <see cref="WeifenLuo.WinFormsUI.DockContentHandler.PanelPane" /> and
<see cref="WeifenLuo.WinFormsUI.DockContentHandler.FloatPane" />. The <see cref="WeifenLuo.WinFormsUI.DockContentHandler.Pane" />
property returns currently displaying containing <see cref="WeifenLuo.WinFormsUI.DockPane" />. The docking state of a
<see cref="WeifenLuo.WinFormsUI.IDockContent" /> object is always synchronized with its displaying containing
<see cref="WeifenLuo.WinFormsUI.DockPane" />.
</remarks>
</Property>
<Property name="PanelPane">
<summary>Gets or sets the containing <see cref="WeifenLuo.WinFormsUI.DockPane" /> object when docked.</summary>
<value>The containing <see cref="WeifenLuo.WinFormsUI.DockPane" /> object when docked.</value>
<include file='DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Property[@name="Pane"]/remarks' />
</Property>
<Property name="ShowHint">
<summary>Gets or sets the desired docking state for this IDockContent object.</summary>
<value>One of the valid <see cref="WeifenLuo.WinFormsUI.DockState" /> values. This value should not
conflicts with <see cref="WeifenLuo.WinFormsUI.DockContentHandler.DockableAreas" /> property.</value>
</Property>
<Property name="TabPageContextMenu">
<summary>Gets or sets the context menu for the DockPane tab page.</summary>
<value>The <see cref="System.Windows.Forms.ContextMenu" /> for the DockPane tab page.</value>
</Property>
<Property name="TabText">
<summary>Gets or sets the text to display for the DockPane tab strip.</summary>
<value>The text to display for the DockPane tab strip.</value>
<remarks>If this value is not set, the value of <see cref="Control.Text" /> will be used.</remarks>
</Property>
<Property name="ToolTipText">
<summary>Gets or sets the tooltip text for this form.</summary>
<value>The tooltip text for this form.</value>
</Property>
<Property name="VisibleState">
<summary>Gets or sets the visible docking state for this form.</summary>
<value>One of the <see cref="WeifenLuo.WinFormsUI.DockState" /> values for visible docking state of this form.</value>
</Property>
<Method name="Activate()">
<summary>Activates the IDockContent form and gives it focus.</summary>
<remarks>Activating the IDockContent form makes it the <see cref="WeifenLuo.WinFormsUI.DockPane.ActiveContent" /> of its
containing <see cref="WeifenLuo.WinFormsUI.DockPane" />. To determine the active IDockContent in an application,
use <see cref="WeifenLuo.WinFormsUI.DockPanel.ActiveContent" /> property. To determine the active document
content, use <see cref="WeifenLuo.WinFormsUI.DockPanel.ActiveDocument" /> property.</remarks>
</Method>
<Method name="Close()">
<summary>Closes the IDockContent form.</summary>
</Method>
<Method name="Hide()">
<summary>Conceals the IDockContent form the user.</summary>
<remarks>
Hiding the IDockContent form is equivalent to setting the <see cref="WeifenLuo.WinFormsUI.DockContentHandler.IsHidden" /> to <b>true</b>.
</remarks>
</Method>
<Property name="GetPersistStringDelegate">
<summary>Gets or sets the callback to return the serialization string for this IDockContent object.</summary>
<value>The <see cref="WeifenLuo.WinFormsUI.GetPersistStringDelegate" /> callback to return the serialization string for this IDockContent object.</value>
</Property>
<Method name="IsDockStateValid(DockState)">
<summary>Test with <see cref="WeifenLuo.WinFormsUI.DockContentHandler.DockableAreas" /> to see whether the specified
<see cref="WeifenLuo.WinFormsUI.DockState" /> is valid.</summary>
<param name="dockState">The specified <see cref="WeifenLuo.WinFormsUI.DockState" /> value to test.</param>
</Method>
<Method name="OnDockStateChanged(EventArgs)">
<summary>Raises the <see cref="WeifenLuo.WinFormsUI.DockContentHandler.DockStateChanged" /> event.</summary>
<param name="e">An <see cref="System.EventArgs" /> that contains the event data.</param>
</Method>
<Method name="Show">
<overloads>
<summary>Displays the form. Overloaded.</summary>
</overloads>
</Method>
<Method name="Show()">
<summary>Displays the form, with default settings.</summary>
<remarks>If <see cref="WeifenLuo.WinFormsUI.DockContentHandler.DockPanel"/> property is set, the form
will be displayed as <see cref="WeifenLuo.WinFormsUI.DockContentHandler.ShowHint"/> docking state;
otherwise it will be displayed as normal form.</remarks>
</Method>
<Method name="Show(DockPane, DockAlignment, double)">
<summary>Displays the form, as specified nested docking.</summary>
<param name="prevPane">The target <see cref="WeifenLuo.WinFormsUI.DockPane"/> to dock.</param>
<param name="alignment">The edge of the target <see cref="WeifenLuo.WinFormsUI.DockPane"/> to dock.</param>
<param name="proportion">The proportion size of the source <see cref="WeifenLuo.WinFormsUI.DockPane"/> to take
inside the target <see cref="WeifenLuo.WinFormsUI.DockPane"/>.</param>
</Method>
<Method name="Show(DockPane, IDockContent)">
<summary>Displays the form, at the specified tab location of DockPane</summary>
<param name="pane">The target <see cref="WeifenLuo.WinFormsUI.DockPane"/> to contain this IDockContent.</param>
<param name="beforeContent">The position to show in the tab strip of the <see cref="WeifenLuo.WinFormsUI.DockPane"/>.
<b>Null</b> to show at the last position in the tab strip.
</param>
</Method>
<Method name="Show(DockPanel)">
<summary>Displays the form, attaching to specified DockPanel.</summary>
<param name="dockPanel">The <see cref="WeifenLuo.WinFormsUI.DockPanel"/> object to attach.</param>
</Method>
<Method name="Show(DockPanel, Rectangle)">
<summary>Displays the form, as floating window at the specified location and size.</summary>
<param name="dockPanel">The <see cref="WeifenLuo.WinFormsUI.DockPanel"/> object to attach.</param>
<param name="floatWindowBounds">The bounds of the floating window.</param>
</Method>
<Method name="Show(DockPanel, DockState)">
<summary>Displays the form, with specified docking state.</summary>
<param name="dockPanel">The <see cref="WeifenLuo.WinFormsUI.DockPanel"/> object to attach.</param>
<param name="dockState">The docking state to display.</param>
</Method>
<Event name="DockStateChanged">
<summary>Occurs when the <see cref="WeifenLuo.WinFormsUI.DockContentHandler.DockState"/> property changed.</summary>
</Event>
</Class>
</CodeDoc>

94
src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/DockPane.xml

@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
</Member>
</Enum>
<ClassDef>
<summary>The containing window for a collection of <see cref="WeifenLuo.WinFormsUI.DockContent" /> forms
<summary>The containing window for a collection of <see cref="WeifenLuo.WinFormsUI.IDockContent" /> forms
displayed in a tabbed manner.</summary>
<remarks>
<include file='DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Property[@name="Contents"]/remarks/*' />
@ -34,36 +34,36 @@ @@ -34,36 +34,36 @@
<summary>Initializes a new instance of DockPane class.</summary>
</overloads>
</Constructor>
<Constructor name="(DockContent, DockState, bool)">
<Constructor name="(IDockContent, DockState, bool)">
<summary>Initializes a new instance of DockPane class, with specified visible docking state.</summary>
<param name="content">The first DockContent for this DockPane.</param>
<param name="content">The first IDockContent for this DockPane.</param>
<param name="visibleState">The visible docking state for this DockPane.</param>
<param name="show"><b>True</b> to show the <paramref name="content" />, otherwise, <b>false</b>.</param>
</Constructor>
<Constructor name="(DockContent, FloatWindow, bool)">
<Constructor name="(IDockContent, FloatWindow, bool)">
<summary>Initializes a new instance of DockPane class, as nested docking to specified FloatWindow.</summary>
<param name="content">The first DockContent for this DockPane.</param>
<param name="content">The first IDockContent for this DockPane.</param>
<param name="floatWindow">The <see cref="WeifenLuo.WinFormsUI.FloatWindow"/> for nested docking.</param>
<param name="show"><b>True</b> to show the <paramref name="content" />, otherwise, <b>false</b>.</param>
</Constructor>
<Constructor name="(DockContent, DockPane, DockAlignment, double, bool)">
<Constructor name="(IDockContent, DockPane, DockAlignment, double, bool)">
<summary>Initializes a new instance of DockPane class, as specified nested docking.</summary>
<include file='DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="(DockContent, DockState, bool)"]/param[@name="content"]' />
<include file='DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="(IDockContent, DockState, bool)"]/param[@name="content"]' />
<param name="prevPane">The target <see cref="WeifenLuo.WinFormsUI.DockPane" /> to dock.</param>
<param name="alignment">The edge of the target <see cref="WeifenLuo.WinFormsUI.DockPane" /> to dock.</param>
<param name="proportion">The proportion size of the source <see cref="WeifenLuo.WinFormsUI.DockPane" />
to take inside the target <see cref="WeifenLuo.WinFormsUI.DockPane" />.</param>
<include file='DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="(DockContent, DockState, bool)"]/param[@name="show"]' />
<include file='DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="(IDockContent, DockState, bool)"]/param[@name="show"]' />
</Constructor>
<Constructor name="(DockContent, Rectangle, bool)">
<Constructor name="(IDockContent, Rectangle, bool)">
<summary>Initializes a new instance of DockPane class, as floating at the specified bounds.</summary>
<include file='DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="(DockContent, DockState, bool)"]/param[@name="content"]' />
<include file='DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="(IDockContent, DockState, bool)"]/param[@name="content"]' />
<param name="floatWindowBounds">The bounds of the floating window.</param>
<include file='DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="(DockContent, DockState, bool)"]/param[@name="show"]' />
<include file='DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="(IDockContent, DockState, bool)"]/param[@name="show"]' />
</Constructor>
<Property name="ActiveContent">
<summary>Gets or sets the currently active <see cref="WeifenLuo.WinFormsUI.DockContent" /> form.</summary>
<value>The currently active <see cref="WeifenLuo.WinFormsUI.DockContent" /> form.</value>
<summary>Gets or sets the currently active <see cref="WeifenLuo.WinFormsUI.IDockContent" /> form.</summary>
<value>The currently active <see cref="WeifenLuo.WinFormsUI.IDockContent" /> form.</value>
</Property>
<Property name="AllowRedocking">
<summary>Gets or sets to specify whether drag and drop re-docking is allowed.</summary>
@ -77,57 +77,57 @@ @@ -77,57 +77,57 @@
<summary>Gets the text displayed for the caption.</summary>
<value>The text displayed for the caption.</value>
<remarks>The default implementation returns the <see cref="System.Windows.Forms.Control.Text" /> property
of current active <see cref="WeifenLuo.WinFormsUI.DockContent" /> form. You can override this
of current active <see cref="WeifenLuo.WinFormsUI.IDockContent" /> form. You can override this
property to provide your own implementation.</remarks>
</Property>
<Property name="Contents">
<summary>Gets the collection of contained <see cref="WeifenLuo.WinFormsUI.DockContent" /> forms.</summary>
<summary>Gets the collection of contained <see cref="WeifenLuo.WinFormsUI.IDockContent" /> forms.</summary>
<value>The <see cref="WeifenLuo.WinFormsUI.DockContentCollection" /> which contains all the
<see cref="WeifenLuo.WinFormsUI.DockContent" /> forms for this <see cref="WeifenLuo.WinFormsUI.DockPane" />.</value>
<see cref="WeifenLuo.WinFormsUI.IDockContent" /> forms for this <see cref="WeifenLuo.WinFormsUI.DockPane" />.</value>
<remarks>
<para>
A <see cref="WeifenLuo.WinFormsUI.DockContent" /> object can be added to the
A <see cref="WeifenLuo.WinFormsUI.IDockContent" /> object can be added to the
<see cref="WeifenLuo.WinFormsUI.DockPane" /> by various of ways:
<list type="number">
<item>
<description>Calling one of <see cref="WeifenLuo.WinFormsUI.DockPane" /> class's constructors,
providing the <see cref="WeifenLuo.WinFormsUI.DockContent" /> object as parameter.
providing the <see cref="WeifenLuo.WinFormsUI.IDockContent" /> object as parameter.
</description>
</item>
<item>
<description>Explicitly setting one of the
<see cref="WeifenLuo.WinFormsUI.DockContent.Pane" />,
<see cref="WeifenLuo.WinFormsUI.DockContent.PanelPane" /> or
<see cref="WeifenLuo.WinFormsUI.DockContent.FloatPane" /> properties
of <see cref="WeifenLuo.WinFormsUI.DockContent" /> class.
<see cref="WeifenLuo.WinFormsUI.DockContentHandler.Pane" />,
<see cref="WeifenLuo.WinFormsUI.DockContentHandler.PanelPane" /> or
<see cref="WeifenLuo.WinFormsUI.DockContentHandler.FloatPane" /> properties
of <see cref="WeifenLuo.WinFormsUI.IDockContent.DockHandler" /> class.
</description>
</item>
<item>
<description>Implicitly setting the docking state of the <see cref="WeifenLuo.WinFormsUI.DockContent" />,
for example, calling one of the <see cref="WeifenLuo.WinFormsUI.DockContent.Show" /> methods.
<description>Implicitly setting the docking state of the <see cref="WeifenLuo.WinFormsUI.IDockContent" />,
for example, calling one of the <see cref="WeifenLuo.WinFormsUI.DockContentHandler.Show" /> methods.
</description>
</item>
</list>
You can access the contained collection of
<see cref="WeifenLuo.WinFormsUI.DockContent" /> forms through the
<see cref="WeifenLuo.WinFormsUI.IDockContent" /> forms through the
<see cref="WeifenLuo.WinFormsUI.DockPane.Contents" /> property of class
<see cref="WeifenLuo.WinFormsUI.DockPane" />, and you can access a
<see cref="WeifenLuo.WinFormsUI.DockContent" />'s containing
<see cref="WeifenLuo.WinFormsUI.DockPane" /> through its
<see cref="WeifenLuo.WinFormsUI.DockContent.Pane" />,
<see cref="WeifenLuo.WinFormsUI.DockContent.PanelPane" /> or
<see cref="WeifenLuo.WinFormsUI.DockContent.FloatPane" /> properties.
<see cref="WeifenLuo.WinFormsUI.IDockContent" />'s containing
<see cref="WeifenLuo.WinFormsUI.DockPane" /> through its <see cref="WeifenLuo.WinFormsUI.DockContentHandler" />'s
<see cref="WeifenLuo.WinFormsUI.DockContentHandler.Pane" />,
<see cref="WeifenLuo.WinFormsUI.DockContentHandler.PanelPane" /> or
<see cref="WeifenLuo.WinFormsUI.DockContentHandler.FloatPane" /> properties.
</para>
<para>If there is no <see cref="WeifenLuo.WinFormsUI.DockContent" /> in
<para>If there is no <see cref="WeifenLuo.WinFormsUI.IDockContent" /> in
this <see cref="WeifenLuo.WinFormsUI.DockPane" />,
this <see cref="WeifenLuo.WinFormsUI.DockPane" /> will be disposed automatically.
</para>
</remarks>
</Property>
<Property name="DisplayingContents">
<summary>Gets the collection of displaying <see cref="DockContent" /> forms.</summary>
<summary>Gets the collection of displaying <see cref="IDockContent" /> forms.</summary>
<value>The <see cref="DockContentCollection" /> which contains all the displaying
<see cref="DockContent" /> forms for this <see cref="DockPane" />.</value>
<see cref="IDockContent" /> forms for this <see cref="DockPane" />.</value>
<seealso cref="DockPane.Contents"/>
</Property>
<Property name="DockListContainer">
@ -190,9 +190,9 @@ @@ -190,9 +190,9 @@
</remarks>
</Property>
<Property name="IsHidden">
<summary>Gets whether all the contained <see cref="WeifenLuo.WinFormsUI.DockContent" /> forms
<summary>Gets whether all the contained <see cref="WeifenLuo.WinFormsUI.IDockContent" /> forms
are invisible in this <see cref="WeifenLuo.WinFormsUI.DockPane" />.</summary>
<value><b>True</b> if all the contained <see cref="WeifenLuo.WinFormsUI.DockContent" /> forms
<value><b>True</b> if all the contained <see cref="WeifenLuo.WinFormsUI.IDockContent" /> forms
are invisible in this <see cref="WeifenLuo.WinFormsUI.DockPane" />.</value>
</Property>
<Property name="NestedDockingStatus">
@ -229,21 +229,21 @@ @@ -229,21 +229,21 @@
<include file='DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Method[@name="AddToDockList(IDockListContainer)"]/returns' />
</Method>
<Method name="CloseActiveContent()">
<summary>Closes the currently active <see cref="DockContent"/>.</summary>
<summary>Closes the currently active <see cref="IDockContent"/>.</summary>
</Method>
<Method name="Float()">
<summary>Shows all contained <see cref="WeifenLuo.WinFormsUI.DockContent" /> forms as floating.</summary>
<summary>Shows all contained <see cref="WeifenLuo.WinFormsUI.IDockContent" /> forms as floating.</summary>
<returns>The new floating <see cref="WeifenLuo.WinFormsUI.DockPane" /> for the
<see cref="WeifenLuo.WinFormsUI.DockContent" /> forms.</returns>
<see cref="WeifenLuo.WinFormsUI.IDockContent" /> forms.</returns>
</Method>
<Method name="IsDockStateValid(DockState)">
<summary>Tests if the giving docking state conforms to the
<see cref="WeifenLuo.WinFormsUI.DockContent.DockableAreas" /> property of all the
contained <see cref="WeifenLuo.WinFormsUI.DockContent" /> forms.</summary>
<see cref="WeifenLuo.WinFormsUI.DockContentHandler.DockableAreas" /> property of all the
contained <see cref="WeifenLuo.WinFormsUI.IDockContent" /> forms.</summary>
<param name="dockState"></param>
<returns><b>True</b> if the giving docking state conforms to the
<see cref="WeifenLuo.WinFormsUI.DockContent.DockableAreas" /> property of all the
contained <see cref="WeifenLuo.WinFormsUI.DockContent" /> forms; otherwise, <b>false</b>.</returns>
<see cref="WeifenLuo.WinFormsUI.DockContentHandler.DockableAreas" /> property of all the
contained <see cref="WeifenLuo.WinFormsUI.IDockContent" /> forms; otherwise, <b>false</b>.</returns>
</Method>
<Method name="OnDockStateChanged(EventArgs)">
<summary>Raises the <see cref="WeifenLuo.WinFormsUI.DockPane.DockStateChanged" /> event.</summary>
@ -258,16 +258,16 @@ @@ -258,16 +258,16 @@
<param name="e">An <see cref="System.EventArgs" /> that contains the event data.</param>
</Method>
<Method name="RestoreToPanel()">
<summary>Shows all contained <see cref="WeifenLuo.WinFormsUI.DockContent" /> forms as non-floating.</summary>
<summary>Shows all contained <see cref="WeifenLuo.WinFormsUI.IDockContent" /> forms as non-floating.</summary>
</Method>
<Method name="SetContentIndex(DockContent, int)">
<summary>Moves the specified <see cref="WeifenLuo.WinFormsUI.DockContent" /> form to the
<Method name="SetContentIndex(IDockContent, int)">
<summary>Moves the specified <see cref="WeifenLuo.WinFormsUI.IDockContent" /> form to the
specified position in the tab strip.</summary>
<param name="content">The specified <see cref="WeifenLuo.WinFormsUI.DockContent" /> form.</param>
<param name="content">The specified <see cref="WeifenLuo.WinFormsUI.IDockContent" /> form.</param>
<param name="index">The zero-based index represents the new position in the tab strip.</param>
</Method>
<Method name="SetDockState(DockState)">
<summary>Shows all contained <see cref="WeifenLuo.WinFormsUI.DockContent" /> forms as specified docking state.</summary>
<summary>Shows all contained <see cref="WeifenLuo.WinFormsUI.IDockContent" /> forms as specified docking state.</summary>
<param name="value">The specified docking state to display.</param>
<returns>The <see cref="WeifenLuo.WinFormsUI.DockPane" /> for the new docking state.</returns>
</Method>

4
src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/DockPaneStripBase.xml

@ -24,9 +24,9 @@ @@ -24,9 +24,9 @@
<summary>Gets the appearance style of the <see cref="DockPane"/>.</summary>
<value>A <see cref="WeifenLuo.WinFormsUI.DockPane.AppearanceStyle"/> value that specifies the appearance style of the <see cref="DockPaneTab"/> objects for the <see cref="DockPane"/>.</value>
</Property>
<Method name="EnsureTabVisible(DockContent)">
<Method name="EnsureTabVisible(IDockContent)">
<summary>Ensures the specified content tab visible in the tab strip.</summary>
<param name="content">The specified <see cref="DockContent"/>.</param>
<param name="content">The specified <see cref="IDockContent"/>.</param>
</Method>
<Method name="GetHitTest">
<overloads><summary>Gets the hit test result of the tab strip.</summary></overloads>

15
src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/DockPaneStripVS2003.xml

@ -168,6 +168,21 @@ @@ -168,6 +168,21 @@
<value>The extra width, in pixel, for drawing text of document style tab.</value>
<remarks>Derived class can override this property to provide its own value.</remarks>
</Property>
<Property name="DocumentIconGapLeft">
<summary>Gets the left side extra space of the document icon.</summary>
<value>The left side extra width, in pixel, of the document icon.</value>
<remarks>Derived class can override this property to provide its own value.</remarks>
</Property>
<Property name="DocumentIconGapWidth">
<summary>Gets the width of the document icon.</summary>
<value>The width, in pixel, of the document icon.</value>
<remarks>Derived class can override this property to provide its own value.</remarks>
</Property>
<Property name="DocumentIconGapHeight">
<summary>Gets the height of the document icon.</summary>
<value>The height, in pixel, of the document icon.</value>
<remarks>Derived class can override this property to provide its own value.</remarks>
</Property>
<Property name="OutlineInnerPen">
<summary>Gets the <see cref="Pen"/> for drawing the inner outline.</summary>
<value>The <see cref="Pen"/> for drawing the inner outline.</value>

12
src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/DockPaneTab.xml

@ -2,22 +2,22 @@ @@ -2,22 +2,22 @@
<CodeDoc>
<Class name="DockPaneTab">
<ClassDef>
<summary>Represent a <see cref="DockContent"/> displayed in the tab strip area of <see cref="DockPane"/>.</summary>
<summary>Represent a <see cref="IDockContent"/> displayed in the tab strip area of <see cref="DockPane"/>.</summary>
<remarks>When customizing the tab strip area of the <see cref="DockPane"/>, you can derive a class from <see cref="DockPaneStripBase"/>
class, and then plug it into the <see cref="DockPanel"/> through the <see cref="DockPanelExtender.DockPaneStripFactory"/> property of <see cref="DockPanel.Extender"/>. If you want to
associate data with the <see cref="DockContent"/>, you can derived a class from <see cref="DockPaneTab"/> class,
associate data with the <see cref="IDockContent"/>, you can derived a class from <see cref="DockPaneTab"/> class,
then plug it into the <see cref="DockPanel"/> through <see cref="DockPanelExtender.DockPaneTabFactory"/> property of <see cref="DockPanel.Extender"/>. The docking framework
will create the class instances and you can reference them through <see cref="DockPaneStripBase.Tabs"/> property.</remarks>
</ClassDef>
<Construct name="(DockContent)">
<Construct name="(IDockContent)">
<summary>Creates a instance of <see cref="DockPaneTab"/> class.</summary>
<param name="content">The <see cref="DockContent"/> object to associate with.</param>
<param name="content">The <see cref="IDockContent"/> object to associate with.</param>
<remarks>Instance of <see cref="DockPaneTab"/> or derived class should only be created by the docking framework.
The constructor should only be called within the implementation of <see cref="DockPanelExtender.IDockPaneTabFactory"/> interface or derived class's constructor.</remarks>
</Construct>
<Property name="Content">
<summary>Gets the associated <see cref="DockContent"/> object.</summary>
<value>A <see cref="DockContent" /> object which associates with this <see cref="DockPaneTab"/> object.</value>
<summary>Gets the associated <see cref="IDockContent"/> object.</summary>
<value>A <see cref="IDockContent" /> object which associates with this <see cref="DockPaneTab"/> object.</value>
</Property>
<Method name="Dispose">
<overloads>

12
src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/DockPaneTabCollection.xml

@ -26,9 +26,9 @@ @@ -26,9 +26,9 @@
<param name="tab">The <see cref="DockPaneTab" /> to locate in <see cref="DockPaneTabCollection" />.</param>
<returns><b>true</b> if <paramref name="tab" /> is found in the <see cref="DockPaneTabCollection" />; otherwise, <b>false</b>.</returns>
</Method>
<Method name="Contains(DockContent)">
<summary>Determines whether a <see cref="DockContent" /> is in the <see cref="DockPaneTabCollection" />.</summary>
<param name="content">The <see cref="DockContent" /> to locate in <see cref="DockPaneTabCollection" />.</param>
<Method name="Contains(IDockContent)">
<summary>Determines whether a <see cref="IDockContent" /> is in the <see cref="DockPaneTabCollection" />.</summary>
<param name="content">The <see cref="IDockContent" /> to locate in <see cref="DockPaneTabCollection" />.</param>
<returns><b>true</b> if <paramref name="content" /> is found in the <see cref="DockPaneTabCollection" />; otherwise, <b>false</b>.</returns>
</Method>
<Method name="IndexOf">
@ -39,9 +39,9 @@ @@ -39,9 +39,9 @@
<param name="tab">The <see cref="DockPaneTab" /> to locate in the <see cref="DockPaneTabCollection" />.</param>
<returns>The zero-based index of <paramref name="tab" /> within the entire <see cref="DockPaneTabCollection" />, if found; otherwise, -1.</returns>
</Method>
<Method name="IndexOf(DockContent)">
<summary>Searches for the specified <see cref="DockContent" /> and returns the zero-based index within the entire <see cref="DockPaneTabCollection" />.</summary>
<param name="content">The <see cref="DockContent" /> to locate in the <see cref="DockPaneTabCollection" />.</param>
<Method name="IndexOf(IDockContent)">
<summary>Searches for the specified <see cref="IDockContent" /> and returns the zero-based index within the entire <see cref="DockPaneTabCollection" />.</summary>
<param name="content">The <see cref="IDockContent" /> to locate in the <see cref="DockPaneTabCollection" />.</param>
<returns>The zero-based index of <paramref name="content" /> within the entire <see cref="DockPaneTabCollection" />, if found; otherwise, -1.</returns>
</Method>
</Class>

94
src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/DockPanel.xml

@ -3,14 +3,14 @@ @@ -3,14 +3,14 @@
<Delegate name="DeserializeDockContent">
<summary>
Callback used by <see cref="WeifenLuo.WinFormsUI.DockPanel.LoadFromXml"/>
to get a instance of <see cref="WeifenLuo.WinFormsUI.DockContent"/> from a
to get a instance of <see cref="WeifenLuo.WinFormsUI.IDockContent"/> from a
serialized string.
</summary>
<param name="persistString">
The serialized string of the <see cref="WeifenLuo.WinFormsUI.DockContent"/> object.
The serialized string of the <see cref="WeifenLuo.WinFormsUI.IDockContent"/> object.
</param>
<returns>
The <see cref="WeifenLuo.WinFormsUI.DockContent"/> object.
The <see cref="WeifenLuo.WinFormsUI.IDockContent"/> object.
</returns>
<remarks>
<para>
@ -18,17 +18,22 @@ @@ -18,17 +18,22 @@
can be saved to and loaded from XML data by calling
<see cref="WeifenLuo.WinFormsUI.DockPanel.SaveAsXml"/> and
<see cref="WeifenLuo.WinFormsUI.DockPanel.LoadFromXml"/>.
When saving, the system will persist the <see cref="WeifenLuo.WinFormsUI.DockContent"/>
When saving, the system will persist the <see cref="WeifenLuo.WinFormsUI.IDockContent"/>
object to a string by calling its
<see cref="WeifenLuo.WinFormsUI.DockContent.GetPersistString"/> method;
<see cref="WeifenLuo.WinFormsUI.DockContentHandler.GetPersistStringDelegate"/> property;
when loading, the system will call the <see cref="WeifenLuo.WinFormsUI.DeserializeDockContent"/>
call back to get the instance of <see cref="WeifenLuo.WinFormsUI.DockContent"/> object.
call back to get the instance of <see cref="WeifenLuo.WinFormsUI.IDockContent"/> object.
</para>
<para>
The default implementation of <see cref="WeifenLuo.WinFormsUI.DockContent.GetPersistString"/>
If you derive your class from <see cref="WeifenLuo.WinFormsUI.DockContent" />, the default implementation of <see cref="WeifenLuo.WinFormsUI.DockContent.GetPersistString"/>
returns the type name of the <see cref="WeifenLuo.WinFormsUI.DockContent"/> class. You can overwrite
this method for your own implementation.
</para>
<param>
If you implement your own <see cref="WeifenLuo.WinFormsUI.IDockContent" />, you can pass a
delegate to the constructor of <see cref="WeifenLuo.WinFormsUI.DockContentHandler" /> class,
and provide this object for the interface implementation.
</param>
<para>
You always need to provide a <see cref="WeifenLuo.WinFormsUI.DeserializeDockContent"/>
callback when loading the layout.
@ -51,16 +56,16 @@ @@ -51,16 +56,16 @@
<summary>Initializes a new instance of <see cref="WeifenLuo.WinFormsUI.DockPanel"/> class.</summary>
</Constructor>
<Property name="ActiveAutoHideContent">
<summary>Gets or sets the active auto-hide <see cref="WeifenLuo.WinFormsUI.DockContent"/>.</summary>
<value>The auto-hide <see cref="WeifenLuo.WinFormsUI.DockContent"/> is currently active.</value>
<summary>Gets or sets the active auto-hide <see cref="WeifenLuo.WinFormsUI.IDockContent"/>.</summary>
<value>The auto-hide <see cref="WeifenLuo.WinFormsUI.IDockContent"/> is currently active.</value>
</Property>
<Property name="ActiveContent">
<summary>Gets the active <see cref="WeifenLuo.WinFormsUI.DockContent"/>.</summary>
<value>The <see cref="WeifenLuo.WinFormsUI.DockContent"/> is currently active.</value>
<summary>Gets the active <see cref="WeifenLuo.WinFormsUI.IDockContent"/>.</summary>
<value>The <see cref="WeifenLuo.WinFormsUI.IDockContent"/> is currently active.</value>
</Property>
<Property name="ActiveDocument">
<summary>Gets the active document <see cref="WeifenLuo.WinFormsUI.DockContent"/>.</summary>
<value>The document <see cref="WeifenLuo.WinFormsUI.DockContent"/> is currently active.</value>
<summary>Gets the active document <see cref="WeifenLuo.WinFormsUI.IDockContent"/>.</summary>
<value>The document <see cref="WeifenLuo.WinFormsUI.IDockContent"/> is currently active.</value>
</Property>
<Property name="ActiveDocumentPane">
<summary>Gets the active document <see cref="WeifenLuo.WinFormsUI.DockPane"/>.</summary>
@ -75,11 +80,11 @@ @@ -75,11 +80,11 @@
<value><b>True</b>, if drag and drop redocking is allowed, otherwise, <b>false</b>.</value>
</Property>
<Property name="Contents">
<summary>Gets the collection of contained <see cref="WeifenLuo.WinFormsUI.DockContent" /> forms.</summary>
<summary>Gets the collection of contained <see cref="WeifenLuo.WinFormsUI.IDockContent" /> forms.</summary>
<value>The <see cref="WeifenLuo.WinFormsUI.DockContentCollection" /> which contains all the
<see cref="WeifenLuo.WinFormsUI.DockContent" /> forms for this <see cref="WeifenLuo.WinFormsUI.DockPanel" />.</value>
<remarks>A <see cref="WeifenLuo.WinFormsUI.DockContent" /> object is added to <see cref="WeifenLuo.WinFormsUI.DockPanel.Contents" />
collection by setting the value of its <see cref="WeifenLuo.WinFormsUI.DockContent.DockPanel" /> property.</remarks>
<see cref="WeifenLuo.WinFormsUI.IDockContent" /> forms for this <see cref="WeifenLuo.WinFormsUI.DockPanel" />.</value>
<remarks>A <see cref="WeifenLuo.WinFormsUI.IDockContent" /> object is added to <see cref="WeifenLuo.WinFormsUI.DockPanel.Contents" />
collection by setting the value of its <see cref="WeifenLuo.WinFormsUI.DockContentHandler.DockPanel" /> property.</remarks>
</Property>
<Property name="DockBottomPortion">
<summary>Gets or sets the size of the bottom side <see cref="WeifenLuo.WinFormsUI.DockWindow"/>.</summary>
@ -117,16 +122,12 @@ @@ -117,16 +122,12 @@
<see cref="WeifenLuo.WinFormsUI.DockPane" /> windows for this <see cref="WeifenLuo.WinFormsUI.DockPanel" />.</value>
</Property>
<Property name="Documents">
<summary>Gets the document <see cref="WeifenLuo.WinFormsUI.DockContent"/> forms.</summary>
<value>An array of the document <see cref="WeifenLuo.WinFormsUI.DockContent"/> forms.</value>
<summary>Gets the document <see cref="WeifenLuo.WinFormsUI.IDockContent"/> forms.</summary>
<value>An array of the document <see cref="WeifenLuo.WinFormsUI.IDockContent"/> forms.</value>
</Property>
<Property name="MdiIntegration">
<summary>Gets or sets a value indicating whether all the document <see cref="WeifenLuo.WinFormsUI.DockContent"/> forms are treated as MDI forms.</summary>
<value><b>True</b>, if all the document <see cref="WeifenLuo.WinFormsUI.DockContent"/> forms are treated as MDI forms, otherwise, <b>false</b>.</value>
</Property>
<Property name="SdiDocument">
<summary>Gets or sets a value indicating whether the tab strip of document <see cref="WeifenLuo.WinFormsUI.DockPane"/> will be displayed when there is only one document <see cref="WeifenLuo.WinFormsUI.DockContent"/> form.</summary>
<value><b>False</b>, if the tab strip of document <see cref="WeifenLuo.WinFormsUI.DockPane"/> will be displayed when there is only one document <see cref="WeifenLuo.WinFormsUI.DockContent"/> form, otherwise, <b>true</b>.</value>
<Property name="ShowDocumentIcon">
<summary>Gets or sets a value indicating whether the document tab will display the icon.</summary>
<value><b>True</b> to display the document icon, otherwise, <b>false</b>.</value>
</Property>
<Method name="OnActiveContentChanged(EventArgs)">
<summary>Raises the <see cref="WeifenLuo.WinFormsUI.DockPanel.ActiveContentChanged" /> event.</summary>
@ -181,6 +182,19 @@ @@ -181,6 +182,19 @@
<include file='DockPanel.xml' path='//CodeDoc/Delegate[@name="DeserializeDockContent"]/remarks/*'/>
</remarks>
</Method>
<Method name="SaveAsXml(Stream, Encoding, bool)">
<summary>Save the layout to XML data, using the specified stream and encoding, optinally specify if
the data will be contained inside another XML element.
</summary>
<param name="stream">The stream to which you want to write.</param>
<param name="encoding">The encoding to generate.</param>
<param name="upstream">Specifies if the data will be contained inside another XML element. If <b>True</b>, the
stream will be flushed instead of closed; and the start and end element will not be written to the stream.
</param>
<remarks>
<include file='DockPanel.xml' path='//CodeDoc/Delegate[@name="DeserializeDockContent"]/remarks/*'/>
</remarks>
</Method>
<Method name="LoadFromXml">
<overloads>
<summary>Load the layout from XML data. Overloaded</summary>
@ -193,7 +207,7 @@ @@ -193,7 +207,7 @@
<summary>Load the layout from XML file.</summary>
<param name="filename">The file name to read XML data from.</param>
<param name="deserializeContent">The callback function to get the
<see cref="WeifenLuo.WinFormsUI.DockContent"/> instance from the persistent string.</param>
<see cref="WeifenLuo.WinFormsUI.IDockContent"/> instance from the persistent string.</param>
<remarks>
<include file='DockPanel.xml' path='//CodeDoc/Delegate[@name="DeserializeDockContent"]/remarks/*'/>
</remarks>
@ -202,7 +216,17 @@ @@ -202,7 +216,17 @@
<summary>Load the layout from XML stream.</summary>
<param name="stream">The stream to read XML data from.</param>
<param name="deserializeContent">The callback function to get the
<see cref="WeifenLuo.WinFormsUI.DockContent"/> instance from the persistent string.</param>
<see cref="WeifenLuo.WinFormsUI.IDockContent"/> instance from the persistent string.</param>
<remarks>
<include file='DockPanel.xml' path='//CodeDoc/Delegate[@name="DeserializeDockContent"]/remarks/*'/>
</remarks>
</Method>
<Method name="LoadFromXml(Stream, DeserializeDockContent, bool)">
<summary>Load the layout from XML stream, optionally specifies if the provided stream will be closed after loading.</summary>
<param name="stream">The stream to read XML data from.</param>
<param name="deserializeContent">The callback function to get the
<see cref="WeifenLuo.WinFormsUI.IDockContent"/> instance from the persistent string.</param>
<param name="closeStream">Specifies if the provided stream will be closed after loading.</param>
<remarks>
<include file='DockPanel.xml' path='//CodeDoc/Delegate[@name="DeserializeDockContent"]/remarks/*'/>
</remarks>
@ -213,6 +237,16 @@ @@ -213,6 +237,16 @@
<param name="pane">The specified <see cref="WeifenLuo.WinFormsUI.DockPane" /> window.</param>
<param name="index">The zero-based index represents the new position in the auto-hide tab strip.</param>
</Method>
<Method name="SuspendLayout(bool)">
<summary>Temporarily suspends the layout logic, optionally suspends the child windows.</summary>
<param name="allWindows"><b>True</b> to suspend the layout logic of child windows, otherwise, <b>false</b>.</param>
</Method>
<Method name="ResumeLayout(bool, bool)">
<summary>Resumes normal layout logic. Optionally forces an immediate layout of pending
layout requests, and resumes normal layout logic for child windows.</summary>
<param name="performLayout"><b>true</b> to execute pending layout requests; otherwise, <b>false</b>.</param>
<param name="allWindows"><b>True</b> to suspend the layout logic of child windows, otherwise, <b>false</b>.</param>
</Method>
<Event name="ActiveContentChanged">
<summary>Occurs when the <see cref="WeifenLuo.WinFormsUI.DockPanel.ActiveContent"/> property changed.</summary>
</Event>
@ -223,10 +257,10 @@ @@ -223,10 +257,10 @@
<summary>Occurs when the <see cref="WeifenLuo.WinFormsUI.DockPanel.ActivePane"/> property changed.</summary>
</Event>
<Event name="ContentAdded">
<summary>Occurs when a <see cref="WeifenLuo.WinFormsUI.DockContent"/> form added to <see cref="WeifenLuo.WinFormsUI.DockPanel.Contents"/> collection.</summary>
<summary>Occurs when a <see cref="WeifenLuo.WinFormsUI.IDockContent"/> form added to <see cref="WeifenLuo.WinFormsUI.DockPanel.Contents"/> collection.</summary>
</Event>
<Event name="ContentRemoved">
<summary>Occurs when a <see cref="WeifenLuo.WinFormsUI.DockContent"/> form removed from <see cref="WeifenLuo.WinFormsUI.DockPanel.Contents"/> collection.</summary>
<summary>Occurs when a <see cref="WeifenLuo.WinFormsUI.IDockContent"/> form removed from <see cref="WeifenLuo.WinFormsUI.DockPanel.Contents"/> collection.</summary>
</Event>
</Class>
</CodeDoc>

24
src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/DockPanelExtender.xml

@ -11,17 +11,17 @@ @@ -11,17 +11,17 @@
<Method name="CreateDockPane">
<include file='DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="Overloads"]/*' />
</Method>
<Method name="CreateDockPane(DockContent, DockState, bool)">
<include file='DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="(DockContent, DockState, bool)"]/*' />
<Method name="CreateDockPane(IDockContent, DockState, bool)">
<include file='DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="(IDockContent, DockState, bool)"]/*' />
</Method>
<Method name="CreateDockPane(DockContent, FloatWindow, bool)">
<include file='DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="(DockContent, FloatWindow, bool)"]/*' />
<Method name="CreateDockPane(IDockContent, FloatWindow, bool)">
<include file='DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="(IDockContent, FloatWindow, bool)"]/*' />
</Method>
<Method name="CreateDockPane(DockContent, DockPane, DockAlignment, double, bool)">
<include file='DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="(DockContent, DockPane, DockAlignment, double, bool)"]/*' />
<Method name="CreateDockPane(IDockContent, DockPane, DockAlignment, double, bool)">
<include file='DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="(IDockContent, DockPane, DockAlignment, double, bool)"]/*' />
</Method>
<Method name="CreateDockPane(DockContent, Rectangle, bool)">
<include file='DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="(DockContent, Rectangle, bool)"]/*' />
<Method name="CreateDockPane(IDockContent, Rectangle, bool)">
<include file='DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="(IDockContent, Rectangle, bool)"]/*' />
</Method>
</Interface>
<Interface name="IFloatWindowFactory">
@ -87,9 +87,9 @@ @@ -87,9 +87,9 @@
set the <see cref="DockPanelExtender.AutoHideTabFactory"/> property to create instance
of the derived class.</remarks>
</InterfaceDef>
<Method name="CreateAutoHideTab(DockContent)">
<Method name="CreateAutoHideTab(IDockContent)">
<summary>Creates a instance of <see cref="AutoHideTab"/>.</summary>
<param name="content">The <see cref="DockContent"/> to associate with.</param>
<param name="content">The <see cref="IDockContent"/> to associate with.</param>
<returns>A instance of <see cref="AutoHideTab"/>.</returns>
</Method>
</Interface>
@ -113,9 +113,9 @@ @@ -113,9 +113,9 @@
set the <see cref="DockPanelExtender.DockPaneTabFactory"/> property to create instance
of the derived class.</remarks>
</InterfaceDef>
<Method name="CreateDockPaneTab(DockContent)">
<Method name="CreateDockPaneTab(IDockContent)">
<summary>Creates a instance of <see cref="DockPaneTab"/>.</summary>
<param name="content">The <see cref="DockContent"/> to associate with.</param>
<param name="content">The <see cref="IDockContent"/> to associate with.</param>
<returns>A instance of <see cref="DockPaneTab"/>.</returns>
</Method>
</Interface>

18
src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/Enums.xml

@ -85,4 +85,22 @@ @@ -85,4 +85,22 @@
<summary>The window is hidden.</summary>
</Member>
</Enum>
<Enum name="DocumentStyles">
<EnumDef>
<summary>Specifies the style for document windows.</summary>
</EnumDef>
<Member name="DockingMdi">
<summary>Docked in a tabbed manner, MDI integration with the main form.</summary>
</Member>
<Member name="DockingWindow">
<summary>Docked in a tabbed manner, no MDI integration with the main form.</summary>
</Member>
<Member name="DockingSdi">
<summary>Docked in a tabbed manner, no MDI integration with the main form.
Hide the tab when there is only one document in the <see cref="WeifenLuo.WinFormsUI.DockPane"/>.</summary>
</Member>
<Member name="SystemMdi">
<summary>System style MDI form.</summary>
</Member>
</Enum>
</CodeDoc>

8
src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/EventArgs.xml

@ -6,13 +6,13 @@ @@ -6,13 +6,13 @@
<summary>Provides data for <see cref="WeifenLuo.WinFormsUI.DockPanel.ContentAdded"/> and
<see cref="WeifenLuo.WinFormsUI.DockPanel.ContentRemoved"/> events.</summary>
</ClassDef>
<Constructor name="(DockContent)">
<Constructor name="(IDockContent)">
<summary>Initializes a new instance of <see cref="WeifenLuo.WinFormsUI.DockContentEventArgs"/> class.</summary>
<param name="content">The <see cref="WeifenLuo.WinFormsUI.DockContent"/> object.</param>
<param name="content">The <see cref="WeifenLuo.WinFormsUI.IDockContent"/> object.</param>
</Constructor>
<Property name="Content">
<summary>Gets the <see cref="WeifenLuo.WinFormsUI.DockContent"/> object.</summary>
<value>The <see cref="WeifenLuo.WinFormsUI.DockContent"/> object.</value>
<summary>Gets the <see cref="WeifenLuo.WinFormsUI.IDockContent"/> object.</summary>
<value>The <see cref="WeifenLuo.WinFormsUI.IDockContent"/> object.</value>
</Property>
</Class>
</CodeDoc>

11
src/Libraries/DockPanel_Src/WinFormsUI/Docking/CodeDoc/Interfaces.xml

@ -1,5 +1,16 @@ @@ -1,5 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<CodeDoc>
<Interface name="IDockContent">
<InterfaceDef>
<summary>Represents dockable form.</summary>
<remarks>Form implements this interface to be dockable. Docking is handled by DockPanel library
through its <see cref="WeifenLuo.WinFormsUI.IDockContent.DockHandler" /> object.</remarks>
</InterfaceDef>
<Property name="DockHandler">
<summary>Gets the <see cref="WeifenLuo.WinFormsUI.DockHandler"/> object to handle the docking behaviors.</summary>
<value>The <see cref="WeifenLuo.WinFormsUI.DockHandler"/> object to handle the docking behaviors.</value>
</Property>
</Interface>
<Interface name="IDockListContainer">
<InterfaceDef>
<summary>Container for nested docking <see cref='WeifenLuo.WinFormsUI.DockPane' /> objects.</summary>

16
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DisplayingDockList.cs

@ -154,33 +154,33 @@ namespace WeifenLuo.WinFormsUI @@ -154,33 +154,33 @@ namespace WeifenLuo.WinFormsUI
Rectangle rectSplitter = rect;
if (status.DisplayingAlignment == DockAlignment.Left)
{
rectThis.Width = (int)((double)rect.Width * status.DisplayingProportion) - (MeasurePaneSplitter.SplitterSize / 2);
rectThis.Width = (int)((double)rect.Width * status.DisplayingProportion) - (Measures.SplitterSize / 2);
rectSplitter.X = rectThis.X + rectThis.Width;
rectSplitter.Width = MeasurePaneSplitter.SplitterSize;
rectSplitter.Width = Measures.SplitterSize;
rectPrev.X = rectSplitter.X + rectSplitter.Width;
rectPrev.Width = rect.Width - rectThis.Width - rectSplitter.Width;
}
else if (status.DisplayingAlignment == DockAlignment.Right)
{
rectPrev.Width = (rect.Width - (int)((double)rect.Width * status.DisplayingProportion)) - (MeasurePaneSplitter.SplitterSize / 2);
rectPrev.Width = (rect.Width - (int)((double)rect.Width * status.DisplayingProportion)) - (Measures.SplitterSize / 2);
rectSplitter.X = rectPrev.X + rectPrev.Width;
rectSplitter.Width = MeasurePaneSplitter.SplitterSize;
rectSplitter.Width = Measures.SplitterSize;
rectThis.X = rectSplitter.X + rectSplitter.Width;
rectThis.Width = rect.Width - rectPrev.Width - rectSplitter.Width;
}
else if (status.DisplayingAlignment == DockAlignment.Top)
{
rectThis.Height = (int)((double)rect.Height * status.DisplayingProportion) - (MeasurePaneSplitter.SplitterSize / 2);
rectThis.Height = (int)((double)rect.Height * status.DisplayingProportion) - (Measures.SplitterSize / 2);
rectSplitter.Y = rectThis.Y + rectThis.Height;
rectSplitter.Height = MeasurePaneSplitter.SplitterSize;
rectSplitter.Height = Measures.SplitterSize;
rectPrev.Y = rectSplitter.Y + rectSplitter.Height;
rectPrev.Height = rect.Height - rectThis.Height - rectSplitter.Height;
}
else if (status.DisplayingAlignment == DockAlignment.Bottom)
{
rectPrev.Height = (rect.Height - (int)((double)rect.Height * status.DisplayingProportion)) - (MeasurePaneSplitter.SplitterSize / 2);
rectPrev.Height = (rect.Height - (int)((double)rect.Height * status.DisplayingProportion)) - (Measures.SplitterSize / 2);
rectSplitter.Y = rectPrev.Y + rectPrev.Height;
rectSplitter.Height = MeasurePaneSplitter.SplitterSize;
rectSplitter.Height = Measures.SplitterSize;
rectThis.Y = rectSplitter.Y + rectSplitter.Height;
rectThis.Height = rect.Height - rectPrev.Height - rectSplitter.Height;
}

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

@ -108,7 +108,7 @@ namespace WeifenLuo.WinFormsUI @@ -108,7 +108,7 @@ namespace WeifenLuo.WinFormsUI
Size = new System.Drawing.Size(160, 144);
BackColor = SystemColors.Control;
ResumeLayout(false);
ResumeLayout();
}
public void SetStates(IWindowsFormsEditorService edSvc, DockAreas dockAreas)

739
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockContent.cs

@ -17,835 +17,270 @@ using System.Runtime.InteropServices; @@ -17,835 +17,270 @@ using System.Runtime.InteropServices;
namespace WeifenLuo.WinFormsUI
{
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/ClassDef/*'/>
public class DockContent : Form
public class DockContent : Form, IDockContent
{
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Constructor[@name="()"]/*'/>
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockHContent"]/Constructor[@name="()"]/*'/>
public DockContent()
{
RefreshMdiIntegration();
m_dockHandler = new DockContentHandler(this, new GetPersistStringDelegate(GetPersistString));
m_dockHandler.DockStateChanged += new EventHandler(DockHandler_DockStateChanged);
}
/// <exclude/>
protected override void Dispose(bool disposing)
private DockContentHandler m_dockHandler = null;
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Property[@name="DockHandler"]/*'/>
[Browsable(false)]
public DockContentHandler DockHandler
{
if (disposing)
{
if (m_hiddenMdiChild != null)
{
m_hiddenMdiChild.Close();
m_hiddenMdiChild = null;
}
DockPanel = null;
if (AutoHideTab != null)
AutoHideTab.Dispose();
if (DockPaneTab != null)
DockPaneTab.Dispose();
}
base.Dispose(disposing);
get { return m_dockHandler; }
}
private bool m_allowRedocking = true;
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Property[@name="AllowRedocking"]/*'/>
[LocalizedCategory("Category.Docking")]
[LocalizedDescription("DockContent.AllowRedocking.Description")]
[LocalizedDescription("DockHandler.AllowRedocking.Description")]
[DefaultValue(true)]
public bool AllowRedocking
{
get { return m_allowRedocking; }
set { m_allowRedocking = value; }
get { return DockHandler.AllowRedocking; }
set { DockHandler.AllowRedocking = value; }
}
private DockAreas m_allowedAreas = DockAreas.DockLeft | DockAreas.DockRight | DockAreas.DockTop | DockAreas.DockBottom | DockAreas.Document | DockAreas.Float;
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Property[@name="DockableAreas"]/*'/>
[LocalizedCategory("Category.Docking")]
[LocalizedDescription("DockContent.DockableAreas.Description")]
[LocalizedDescription("DockHandler.DockableAreas.Description")]
[DefaultValue(DockAreas.DockLeft|DockAreas.DockRight|DockAreas.DockTop|DockAreas.DockBottom|DockAreas.Document|DockAreas.Float)]
public DockAreas DockableAreas
{
get { return m_allowedAreas; }
set
{
if (m_allowedAreas == value)
return;
if (!DockHelper.IsDockStateValid(DockState, value))
throw(new InvalidOperationException(ResourceHelper.GetString("DockContent.DockableAreas.InvalidValue")));
m_allowedAreas = value;
if (!DockHelper.IsDockStateValid(ShowHint, m_allowedAreas))
ShowHint = DockState.Unknown;
}
get { return DockHandler.DockableAreas; }
set { DockHandler.DockableAreas = value; }
}
private double m_autoHidePortion = 0.25;
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Property[@name="AutoHidePortion"]/*'/>
[LocalizedCategory("Category.Docking")]
[LocalizedDescription("DockContent.AutoHidePortion.Description")]
[LocalizedDescription("DockHandler.AutoHidePortion.Description")]
[DefaultValue(0.25)]
public double AutoHidePortion
{
get { return m_autoHidePortion; }
set
{
if (value <= 0 || value > 1)
throw(new ArgumentOutOfRangeException(ResourceHelper.GetString("DockContent.AutoHidePortion.OutOfRange")));
if (m_autoHidePortion == value)
return;
m_autoHidePortion = value;
if (DockPanel == null)
return;
if (DockPanel.ActiveAutoHideContent == this)
DockPanel.PerformLayout();
}
get { return DockHandler.AutoHidePortion; }
set { DockHandler.AutoHidePortion = value; }
}
private string m_tabText = null;
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Property[@name="TabText"]/*'/>
[Localizable(true)]
[LocalizedCategory("Category.Docking")]
[LocalizedDescription("DockContent.TabText.Description")]
[LocalizedDescription("DockHandler.TabText.Description")]
[DefaultValue(null)]
public string TabText
{
get { return DesignMode ? m_tabText : (m_tabText==null ? this.Text : m_tabText); }
set
{
if (m_tabText == value)
return;
m_tabText = value;
if (Pane != null)
Pane.RefreshChanges();
}
get { return DockHandler.TabText; }
set { DockHandler.TabText = value; }
}
private bool ShouldSerializeTabText()
{
return (m_tabText != null);
return (DockHandler.TabText != null);
}
private bool m_closeButton = true;
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Property[@name="CloseButton"]/*'/>
[LocalizedCategory("Category.Docking")]
[LocalizedDescription("DockContent.CloseButton.Description")]
[LocalizedDescription("DockHandler.CloseButton.Description")]
[DefaultValue(true)]
public bool CloseButton
{
get { return m_closeButton; }
set
{
if (m_closeButton == value)
return;
m_closeButton = value;
if (Pane != null)
if (Pane.ActiveContent == this)
Pane.RefreshChanges();
}
get { return DockHandler.CloseButton; }
set { DockHandler.CloseButton = value; }
}
private DockPanel m_dockPanel = null;
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Property[@name="DockPanel"]/*'/>
[Browsable(false)]
public DockPanel DockPanel
{
get { return m_dockPanel; }
set
{
if (m_dockPanel == value)
return;
Pane = null;
if (m_dockPanel != null)
m_dockPanel.RemoveContent(this);
if (m_dockPaneTab != null)
{
m_dockPaneTab.Dispose();
m_dockPaneTab = null;
}
if (m_autoHideTab != null)
{
m_autoHideTab.Dispose();
m_autoHideTab = null;
}
m_dockPanel = value;
if (m_dockPanel != null)
{
Size = Size.Empty; // To reduce the screen flicker
m_dockPanel.AddContent(this);
TopLevel = false;
FormBorderStyle = FormBorderStyle.None;
ShowInTaskbar = false;
Visible = true;
m_dockPaneTab = DockPanel.DockPaneTabFactory.CreateDockPaneTab(this);
m_autoHideTab = DockPanel.AutoHideTabFactory.CreateAutoHideTab(this);
}
RefreshMdiIntegration();
}
}
private DockState DefaultShowState
{
get
{
if (ShowHint != DockState.Unknown)
return ShowHint;
if ((DockableAreas & DockAreas.Document) != 0)
return DockState.Document;
if ((DockableAreas & DockAreas.DockRight) != 0)
return DockState.DockRight;
if ((DockableAreas & DockAreas.DockLeft) != 0)
return DockState.DockLeft;
if ((DockableAreas & DockAreas.DockBottom) != 0)
return DockState.DockBottom;
if ((DockableAreas & DockAreas.DockTop) != 0)
return DockState.DockTop;
if ((DockableAreas & DockAreas.Float) != 0)
return DockState.Float;
return DockState.Unknown;
}
}
private DockState DefaultDockState
{
get
{
if (ShowHint != DockState.Unknown && ShowHint != DockState.Hidden && ShowHint != DockState.Float)
return ShowHint;
if ((DockableAreas & DockAreas.Document) != 0)
return DockState.Document;
if ((DockableAreas & DockAreas.DockRight) != 0)
return DockState.DockRight;
if ((DockableAreas & DockAreas.DockLeft) != 0)
return DockState.DockLeft;
if ((DockableAreas & DockAreas.DockBottom) != 0)
return DockState.DockBottom;
if ((DockableAreas & DockAreas.DockTop) != 0)
return DockState.DockTop;
return DockState.Unknown;
}
}
private DockState m_dockState = DockState.Unknown;
get { return DockHandler.DockPanel; }
set { DockHandler.DockPanel = value; }
}
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Property[@name="DockState"]/*'/>
[Browsable(false)]
public DockState DockState
{
get { return m_dockState; }
set
{
if (m_dockState == value)
return;
if (value == DockState.Hidden)
IsHidden = true;
else
SetDockState(false, value, Pane);
}
get { return DockHandler.DockState; }
set { DockHandler.DockState = value; }
}
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Property[@name="Pane"]/*'/>
[Browsable(false)]
public DockPane Pane
{
get { return IsFloat ? FloatPane : PanelPane; }
set
{
if (Pane == value)
return;
DockPane oldPane = Pane;
SuspendSetDockState();
FloatPane = (value == null ? null : (value.IsFloat ? value : FloatPane));
PanelPane = (value == null ? null : (value.IsFloat ? PanelPane : value));
ResumeSetDockState(IsHidden, value != null ? value.DockState : DockState.Unknown, oldPane);
}
get { return DockHandler.Pane; }
set { DockHandler.Pane = value; }
}
private bool m_isHidden = false;
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Property[@name="IsHidden"]/*'/>
[Browsable(false)]
public bool IsHidden
{
get { return m_isHidden; }
set
{
if (m_isHidden == value)
return;
SetDockState(value, VisibleState, Pane);
}
get { return DockHandler.IsHidden; }
set { DockHandler.IsHidden = value; }
}
private DockState m_visibleState = DockState.Unknown;
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Property[@name="VisibleState"]/*'/>
[Browsable(false)]
public DockState VisibleState
{
get { return m_visibleState; }
set
{
if (m_visibleState == value)
return;
SetDockState(IsHidden, value, Pane);
}
get { return DockHandler.VisibleState; }
set { DockHandler.VisibleState = value; }
}
private bool m_isFloat = false;
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Property[@name="IsFloat"]/*'/>
[Browsable(false)]
public bool IsFloat
{
get { return m_isFloat; }
set
{
DockState visibleState;
if (m_isFloat == value)
return;
DockPane oldPane = Pane;
if (value)
{
if (!IsDockStateValid(DockState.Float))
throw new InvalidOperationException(ResourceHelper.GetString("DockContent.IsFloat.InvalidValue"));
visibleState = DockState.Float;
}
else
visibleState = (PanelPane != null) ? PanelPane.DockState : DefaultDockState;
if (visibleState == DockState.Unknown)
throw new InvalidOperationException(ResourceHelper.GetString("DockContent.IsFloat.InvalidValue"));
SetDockState(IsHidden, visibleState, oldPane);
}
get { return DockHandler.IsFloat; }
set { DockHandler.IsFloat = value; }
}
private DockPane m_panelPane = null;
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Property[@name="PanelPane"]/*'/>
[Browsable(false)]
public DockPane PanelPane
{
get { return m_panelPane; }
set
{
if (m_panelPane == value)
return;
if (value != null)
{
if (value.IsFloat || value.DockPanel != DockPanel)
throw new InvalidOperationException(ResourceHelper.GetString("DockContent.DockPane.InvalidValue"));
}
DockPane oldPane = Pane;
if (m_panelPane != null)
m_panelPane.RemoveContent(this);
m_panelPane = value;
if (m_panelPane != null)
{
m_panelPane.AddContent(this);
SetDockState(IsHidden, IsFloat ? DockState.Float : m_panelPane.DockState, oldPane);
}
else
SetDockState(IsHidden, DockState.Unknown, oldPane);
}
get { return DockHandler.PanelPane; }
set { DockHandler.PanelPane = value; }
}
private DockPane m_floatPane = null;
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Property[@name="FloatPane"]/*'/>
[Browsable(false)]
public DockPane FloatPane
{
get { return m_floatPane; }
set
{
if (m_floatPane == value)
return;
if (value != null)
{
if (!value.IsFloat || value.DockPanel != DockPanel)
throw new InvalidOperationException(ResourceHelper.GetString("DockContent.FloatPane.InvalidValue"));
}
DockPane oldPane = Pane;
if (m_floatPane != null)
m_floatPane.RemoveContent(this);
m_floatPane = value;
if (m_floatPane != null)
{
m_floatPane.AddContent(this);
SetDockState(IsHidden, IsFloat ? DockState.Float : VisibleState, oldPane);
}
else
SetDockState(IsHidden, DockState.Unknown, oldPane);
}
}
private int m_countSetDockState = 0;
private void SuspendSetDockState()
{
m_countSetDockState ++;
}
private void ResumeSetDockState()
{
m_countSetDockState --;
if (m_countSetDockState < 0)
m_countSetDockState = 0;
}
private void ResumeSetDockState(bool isHidden, DockState visibleState, DockPane oldPane)
{
ResumeSetDockState();
SetDockState(isHidden, visibleState, oldPane);
}
internal void SetDockState(bool isHidden, DockState visibleState, DockPane oldPane)
{
if (m_countSetDockState != 0)
return;
if (DockPanel == null && visibleState != DockState.Unknown)
throw new InvalidOperationException(ResourceHelper.GetString("DockContent.SetDockState.NullPanel"));
if (visibleState == DockState.Hidden || (visibleState != DockState.Unknown && !IsDockStateValid(visibleState)))
throw new InvalidOperationException(ResourceHelper.GetString("DockContent.SetDockState.InvalidState"));
SuspendSetDockState();
DockState oldDockState = DockState;
if (m_isHidden != isHidden)
{
m_isHidden = isHidden;
Visible = !isHidden;
if (HiddenMdiChild != null)
HiddenMdiChild.Visible = (!IsHidden);
}
m_visibleState = visibleState;
m_dockState = isHidden ? DockState.Hidden : visibleState;
if (visibleState != DockState.Unknown)
{
m_isFloat = (m_visibleState == DockState.Float);
if (Pane == null)
Pane = DockPanel.DockPaneFactory.CreateDockPane(this, visibleState, true);
else if (Pane.DockState != visibleState)
{
if (Pane.Contents.Count == 1)
Pane.SetDockState(visibleState);
else
Pane = DockPanel.DockPaneFactory.CreateDockPane(this, visibleState, true);
}
}
else
Pane = null;
SetParent(Pane);
if (oldPane != null && !oldPane.IsDisposed && oldDockState == oldPane.DockState)
RefreshDockPane(oldPane);
if (Pane != null && DockState == Pane.DockState)
{
if ((Pane != oldPane) ||
(Pane == oldPane && oldDockState != oldPane.DockState))
RefreshDockPane(Pane);
}
if (oldDockState != DockState)
{
RefreshMdiIntegration();
OnDockStateChanged(EventArgs.Empty);
}
ResumeSetDockState();
}
private void RefreshDockPane(DockPane pane)
{
pane.RefreshChanges();
pane.ValidateActiveContent();
get { return DockHandler.FloatPane; }
set { DockHandler.FloatPane = value; }
}
internal string PersistString
{
get { return GetPersistString(); }
}
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Method[@name="GetPersistString()"]/*'/>
protected virtual string GetPersistString()
{
return GetType().ToString();
}
private HiddenMdiChild m_hiddenMdiChild = null;
internal HiddenMdiChild HiddenMdiChild
{
get { return m_hiddenMdiChild; }
}
private bool m_hideOnClose = false;
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Property[@name="HideOnClose"]/*'/>
[LocalizedCategory("Category.Docking")]
[LocalizedDescription("DockContent.HideOnClose.Description")]
[LocalizedDescription("DockHandler.HideOnClose.Description")]
[DefaultValue(false)]
public bool HideOnClose
{
get { return m_hideOnClose; }
set { m_hideOnClose = value; }
get { return DockHandler.HideOnClose; }
set { DockHandler.HideOnClose = value; }
}
/// <exclude/>
public new MainMenu Menu
{
get { return HiddenMdiChild == null ? base.Menu : HiddenMdiChild.Menu; }
set
{
if (HiddenMdiChild == null)
base.Menu = value;
else
HiddenMdiChild.Menu = value;
}
}
private DockState m_showHint = DockState.Unknown;
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Property[@name="ShowHint"]/*'/>
[LocalizedCategory("Category.Docking")]
[LocalizedDescription("DockContent.ShowHint.Description")]
[LocalizedDescription("DockHandler.ShowHint.Description")]
[DefaultValue(DockState.Unknown)]
public DockState ShowHint
{
get { return m_showHint; }
set
{
if (!DockHelper.IsDockStateValid(value, DockableAreas))
throw (new InvalidOperationException(ResourceHelper.GetString("DockContent.ShowHint.InvalidValue")));
if (m_showHint == value)
return;
m_showHint = value;
}
get { return DockHandler.ShowHint; }
set { DockHandler.ShowHint = value; }
}
private bool m_isActivated = false;
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Property[@name="IsActivated"]/*'/>
[Browsable(false)]
public bool IsActivated
{
get { return m_isActivated; }
}
internal void SetIsActivated(bool value)
{
if (m_isActivated == value)
return;
m_isActivated = value;
get { return DockHandler.IsActivated; }
}
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Method[@name="IsDockStateValid(DockState)"]/*'/>
public bool IsDockStateValid(DockState dockState)
{
return DockHelper.IsDockStateValid(dockState, DockableAreas);
return DockHandler.IsDockStateValid(dockState);
}
private ContextMenuStrip m_tabPageContextMenu = null;
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Property[@name="TabPageContextMenu"]/*'/>
[LocalizedCategory("Category.Docking")]
[LocalizedDescription("DockContent.TabPageContextMenu.Description")]
[LocalizedDescription("DockHandler.TabPageContextMenu.Description")]
[DefaultValue(null)]
public ContextMenuStrip TabPageContextMenu
public ContextMenu TabPageContextMenu
{
get { return m_tabPageContextMenu; }
set { m_tabPageContextMenu = value; }
get { return DockHandler.TabPageContextMenu; }
set { DockHandler.TabPageContextMenu = value; }
}
private string m_toolTipText = null;
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Property[@name="ToolTipText"]/*'/>
#if FRAMEWORK_VER_2x
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Property[@name="TabPageContextMenuStrip"]/*'/>
[LocalizedCategory("Category.Docking")]
[LocalizedDescription("DockHandler.TabPageContextMenuStrip.Description")]
[DefaultValue(null)]
public ContextMenuStrip TabPageContextMenuStrip
{
get { return DockHandler.TabPageContextMenuStrip; }
set { DockHandler.TabPageContextMenuStrip = value; }
}
#endif
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Property[@name="ToolTipText"]/*'/>
[Localizable(true)]
[Category("Appearance")]
[LocalizedDescription("DockContent.ToolTipText.Description")]
[LocalizedDescription("DockHandler.ToolTipText.Description")]
[DefaultValue(null)]
public string ToolTipText
{
get { return m_toolTipText; }
set { m_toolTipText = value; }
get { return DockHandler.ToolTipText; }
set { DockHandler.ToolTipText = value; }
}
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Method[@name="Activate()"]/*'/>
public new void Activate()
{
if (DockPanel == null)
base.Activate();
else if (Pane == null)
Show(DockPanel);
else
{
IsHidden = false;
Pane.ActiveContent = this;
Pane.Activate();
}
DockHandler.Activate();
}
/// <exclude/>
public new void Hide()
{
IsHidden = true;
DockHandler.Hide();
}
internal void SetParent(Control value)
{
if (Parent == value)
return;
Control oldParent = Parent;
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Workaround for .Net Framework bug: removing control from Form may cause form
// unclosable. Set focus to another dummy control.
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Form form = null;
if (Parent is DockPane)
form = ((DockPane)Parent).FindForm();
if (ContainsFocus)
{
if (form is FloatWindow)
{
((FloatWindow)form).DummyControl.Focus();
form.ActiveControl = ((FloatWindow)form).DummyControl;
}
else if (DockPanel != null)
{
DockPanel.DummyControl.Focus();
if (form != null)
form.ActiveControl = DockPanel.DummyControl;
}
}
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Size = Size.Empty; // To reduce screen flicker
Parent = value;
}
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Method[@name="Show"]/*'/>
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Method[@name="Show()"]/*'/>
public new void Show()
{
if (DockPanel == null)
base.Show();
else
Show(DockPanel);
DockHandler.Show();
}
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Method[@name="Show(DockPanel)"]/*'/>
public void Show(DockPanel dockPanel)
{
if (dockPanel == null)
throw(new ArgumentNullException(ResourceHelper.GetString("DockContent.Show.NullDockPanel")));
if (DockState == DockState.Unknown || Pane == null)
Show(dockPanel, DefaultShowState);
else
Activate();
DockHandler.Show(dockPanel);
}
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Method[@name="Show(DockPanel, DockState)"]/*'/>
public void Show(DockPanel dockPanel, DockState dockState)
{
if (dockPanel == null)
throw(new ArgumentNullException(ResourceHelper.GetString("DockContent.Show.NullDockPanel")));
if (dockState == DockState.Unknown || dockState == DockState.Hidden)
throw(new ArgumentException(ResourceHelper.GetString("DockContent.Show.InvalidDockState")));
DockPanel = dockPanel;
if (dockState == DockState.Float && FloatPane == null)
Pane = DockPanel.DockPaneFactory.CreateDockPane(this, DockState.Float, true);
else if (PanelPane == null)
{
DockPane paneExisting = null;
foreach (DockPane pane in DockPanel.Panes)
if (pane.DockState == dockState)
{
paneExisting = pane;
break;
}
if (paneExisting == null)
Pane = DockPanel.DockPaneFactory.CreateDockPane(this, dockState, true);
else
Pane = paneExisting;
}
DockState = dockState;
Activate();
DockHandler.Show(dockPanel, dockState);
}
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Method[@name="Show(DockPanel, Rectangle)"]/*'/>
public void Show(DockPanel dockPanel, Rectangle floatWindowBounds)
{
if (dockPanel == null)
throw(new ArgumentNullException(ResourceHelper.GetString("DockContent.Show.NullDockPanel")));
DockPanel = dockPanel;
if (FloatPane == null)
{
IsHidden = true; // to reduce the screen flicker
FloatPane = DockPanel.DockPaneFactory.CreateDockPane(this, DockState.Float, false);
FloatPane.FloatWindow.StartPosition = FormStartPosition.Manual;
}
FloatPane.FloatWindow.Bounds = floatWindowBounds;
Show(dockPanel, DockState.Float);
Activate();
DockHandler.Show(dockPanel, floatWindowBounds);
}
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Method[@name="Show(DockPane, DockContent)"]/*'/>
public void Show(DockPane pane, DockContent beforeContent)
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Method[@name="Show(DockPane, DockHandler)"]/*'/>
public void Show(DockPane pane, IDockContent beforeContent)
{
if (pane == null)
throw(new ArgumentNullException(ResourceHelper.GetString("DockContent.Show.NullPane")));
if (beforeContent != null && pane.Contents.IndexOf(beforeContent) == -1)
throw(new ArgumentException(ResourceHelper.GetString("DockContent.Show.InvalidBeforeContent")));
DockPanel = pane.DockPanel;
Pane = pane;
pane.SetContentIndex(this, pane.Contents.IndexOf(beforeContent));
Show();
DockHandler.Show(pane, beforeContent);
}
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Method[@name="Show(DockPane, DockAlignment, double)"]/*'/>
public void Show(DockPane prevPane, DockAlignment alignment, double proportion)
{
if (prevPane == null)
throw(new ArgumentException(ResourceHelper.GetString("DockContent.Show.InvalidPrevPane")));
if (DockHelper.IsDockStateAutoHide(prevPane.DockState))
throw(new ArgumentException(ResourceHelper.GetString("DockContent.Show.InvalidPrevPane")));
DockPanel = prevPane.DockPanel;
DockPanel.DockPaneFactory.CreateDockPane(this, prevPane, alignment, proportion, true);
Show();
}
/// <exclude/>
protected override void OnClosed(EventArgs e)
{
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Workaround of .Net Framework bug to avoid main form unclosable
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
if (Environment.Version.Major == 1)
{
if (DockPanel != null)
DockPanel = null;
}
base.OnClosed (e);
DockHandler.Show(prevPane, alignment, proportion);
}
/// <exclude/>
protected override void OnTextChanged(EventArgs e)
{
if (m_hiddenMdiChild != null)
m_hiddenMdiChild.Text = this.Text;
if (DockHelper.IsDockStateAutoHide(DockState))
DockPanel.RefreshAutoHideStrip();
else if (Pane != null)
{
if (Pane.FloatWindow != null)
Pane.FloatWindow.SetText();
Pane.RefreshChanges();
}
base.OnTextChanged(e);
}
internal void RefreshMdiIntegration()
{
Form mdiParent = GetMdiParentForm();
if (mdiParent == null)
{
if (HiddenMdiChild != null)
{
m_hiddenMdiChild.Close();
m_hiddenMdiChild = null;
}
}
else
{
if (HiddenMdiChild == null)
m_hiddenMdiChild = new HiddenMdiChild(this);
m_hiddenMdiChild.SetMdiParent(mdiParent);
}
if (DockPanel != null)
if (DockPanel.ActiveDocument != null)
if (DockPanel.ActiveDocument.HiddenMdiChild != null)
DockPanel.ActiveDocument.HiddenMdiChild.Activate();
}
private Form GetMdiParentForm()
{
if (DockPanel == null)
return null;
if (!DockPanel.MdiIntegration)
return null;
if (DockState != DockState.Document)
return null;
Form parentMdi = DockPanel.FindForm();
if (parentMdi != null)
if (!parentMdi.IsMdiContainer)
parentMdi = null;
return parentMdi;
}
private DockPaneTab m_dockPaneTab = null;
internal DockPaneTab DockPaneTab
{
get { return m_dockPaneTab; }
}
private AutoHideTab m_autoHideTab = null;
internal AutoHideTab AutoHideTab
#region Events
private void DockHandler_DockStateChanged(object sender, EventArgs e)
{
get { return m_autoHideTab; }
OnDockStateChanged(e);
}
#region Events
private static readonly object DockStateChangedEvent = new object();
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Event[@name="DockStateChanged"]/*'/>
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="IDockContent"]/Event[@name="DockStateChanged"]/*'/>
[LocalizedCategory("Category.PropertyChanged")]
[LocalizedDescription("Pane.DockStateChanged.Description")]
public event EventHandler DockStateChanged
@ -853,7 +288,7 @@ namespace WeifenLuo.WinFormsUI @@ -853,7 +288,7 @@ namespace WeifenLuo.WinFormsUI
add { Events.AddHandler(DockStateChangedEvent, value); }
remove { Events.RemoveHandler(DockStateChangedEvent, value); }
}
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Method[@name="OnDockStateChanged(EventArgs)"]/*'/>
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="IDockContent"]/Method[@name="OnDockStateChanged(EventArgs)"]/*'/>
protected virtual void OnDockStateChanged(EventArgs e)
{
EventHandler handler = (EventHandler)Events[DockStateChangedEvent];

48
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockContentCollection.cs

@ -32,18 +32,18 @@ namespace WeifenLuo.WinFormsUI @@ -32,18 +32,18 @@ namespace WeifenLuo.WinFormsUI
}
/// <include file='CodeDoc\DockContentCollection.xml' path='//CodeDoc/Class[@name="DockContentCollection"]/Property[@name="Item"]/*'/>>
public DockContent this[int index]
public IDockContent this[int index]
{
get
{
if (DockPane == null)
return InnerList[index] as DockContent;
return InnerList[index] as IDockContent;
else
return GetVisibleContent(index);
}
}
internal int Add(DockContent content)
internal int Add(IDockContent content)
{
#if DEBUG
if (DockPane != null)
@ -56,7 +56,7 @@ namespace WeifenLuo.WinFormsUI @@ -56,7 +56,7 @@ namespace WeifenLuo.WinFormsUI
return InnerList.Add(content);
}
internal void AddAt(DockContent content, int index)
internal void AddAt(IDockContent content, int index)
{
#if DEBUG
if (DockPane != null)
@ -72,7 +72,7 @@ namespace WeifenLuo.WinFormsUI @@ -72,7 +72,7 @@ namespace WeifenLuo.WinFormsUI
InnerList.Insert(index, content);
}
internal void AddAt(DockContent content, DockContent before)
internal void AddAt(IDockContent content, IDockContent before)
{
#if DEBUG
if (DockPane != null)
@ -98,8 +98,8 @@ namespace WeifenLuo.WinFormsUI @@ -98,8 +98,8 @@ namespace WeifenLuo.WinFormsUI
InnerList.Clear();
}
/// <include file='CodeDoc\DockContentCollection.xml' path='//CodeDoc/Class[@name="DockContentCollection"]/Method[@name="Contains(DockContent)"]/*'/>
public bool Contains(DockContent content)
/// <include file='CodeDoc\DockContentCollection.xml' path='//CodeDoc/Class[@name="DockContentCollection"]/Method[@name="Contains(IDockContent)"]/*'/>
public bool Contains(IDockContent content)
{
if (DockPane == null)
return InnerList.Contains(content);
@ -119,8 +119,8 @@ namespace WeifenLuo.WinFormsUI @@ -119,8 +119,8 @@ namespace WeifenLuo.WinFormsUI
}
}
/// <include file='CodeDoc\DockContentCollection.xml' path='//CodeDoc/Class[@name="DockContentCollection"]/Method[@name="IndexOf(DockContent)"]/*'/>
public int IndexOf(DockContent content)
/// <include file='CodeDoc\DockContentCollection.xml' path='//CodeDoc/Class[@name="DockContentCollection"]/Method[@name="IndexOf(IDockContent)"]/*'/>
public int IndexOf(IDockContent content)
{
if (DockPane == null)
{
@ -133,7 +133,7 @@ namespace WeifenLuo.WinFormsUI @@ -133,7 +133,7 @@ namespace WeifenLuo.WinFormsUI
return GetIndexOfVisibleContents(content);
}
internal void Remove(DockContent content)
internal void Remove(IDockContent content)
{
if (DockPane != null)
throw new InvalidOperationException();
@ -144,21 +144,21 @@ namespace WeifenLuo.WinFormsUI @@ -144,21 +144,21 @@ namespace WeifenLuo.WinFormsUI
InnerList.Remove(content);
}
internal DockContent[] Select(DockAreas stateFilter)
internal IDockContent[] Select(DockAreas stateFilter)
{
if (DockPane != null)
throw new InvalidOperationException();
int count = 0;
foreach (DockContent c in this)
if (DockHelper.IsDockStateValid(c.DockState, stateFilter))
foreach (IDockContent c in this)
if (DockHelper.IsDockStateValid(c.DockHandler.DockState, stateFilter))
count ++;
DockContent[] contents = new DockContent[count];
IDockContent[] contents = new IDockContent[count];
count = 0;
foreach (DockContent c in this)
if (DockHelper.IsDockStateValid(c.DockState, stateFilter))
foreach (IDockContent c in this)
if (DockHelper.IsDockStateValid(c.DockHandler.DockState, stateFilter))
contents[count++] = c;
return contents;
@ -174,16 +174,16 @@ namespace WeifenLuo.WinFormsUI @@ -174,16 +174,16 @@ namespace WeifenLuo.WinFormsUI
#endif
int count = 0;
foreach (DockContent content in DockPane.Contents)
foreach (IDockContent content in DockPane.Contents)
{
if (content.DockState == DockPane.DockState)
if (content.DockHandler.DockState == DockPane.DockState)
count ++;
}
return count;
}
}
private DockContent GetVisibleContent(int index)
private IDockContent GetVisibleContent(int index)
{
#if DEBUG
if (DockPane == null)
@ -191,9 +191,9 @@ namespace WeifenLuo.WinFormsUI @@ -191,9 +191,9 @@ namespace WeifenLuo.WinFormsUI
#endif
int currentIndex = -1;
foreach (DockContent content in DockPane.Contents)
foreach (IDockContent content in DockPane.Contents)
{
if (content.DockState == DockPane.DockState)
if (content.DockHandler.DockState == DockPane.DockState)
currentIndex ++;
if (currentIndex == index)
@ -202,7 +202,7 @@ namespace WeifenLuo.WinFormsUI @@ -202,7 +202,7 @@ namespace WeifenLuo.WinFormsUI
throw(new ArgumentOutOfRangeException());
}
private int GetIndexOfVisibleContents(DockContent content)
private int GetIndexOfVisibleContents(IDockContent content)
{
#if DEBUG
if (DockPane == null)
@ -213,9 +213,9 @@ namespace WeifenLuo.WinFormsUI @@ -213,9 +213,9 @@ namespace WeifenLuo.WinFormsUI
return -1;
int index = -1;
foreach (DockContent c in DockPane.Contents)
foreach (IDockContent c in DockPane.Contents)
{
if (c.DockState == DockPane.DockState)
if (c.DockHandler.DockState == DockPane.DockState)
{
index++;

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

@ -0,0 +1,919 @@ @@ -0,0 +1,919 @@
// *****************************************************************************
//
// Copyright 2004, Weifen Luo
// All rights reserved. The software and associated documentation
// supplied hereunder are the proprietary information of Weifen Luo
// and are supplied subject to licence terms.
//
// WinFormsUI Library Version 1.0
// *****************************************************************************
using System;
using System.Windows.Forms;
using System.Drawing;
using System.ComponentModel;
namespace WeifenLuo.WinFormsUI
{
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Delegate[@name="GetPersistStringDelegate"]/*'/>
public delegate string GetPersistStringDelegate();
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/ClassDef/*'/>
public class DockContentHandler : IDisposable
{
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Constructor[@name="Overloads"]/*'/>
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Constructor[@name="(Form)"]/*'/>
public DockContentHandler(Form form) : this(form, null)
{
}
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Constructor[@name="(Form, GetPersistStringDelegate)"]/*'/>
public DockContentHandler(Form form, GetPersistStringDelegate getPersistStringDelegate)
{
if (!(form is IDockContent))
throw new ArgumentException();
m_form = form;
m_getPersistStringDelegate = getPersistStringDelegate;
m_events = new EventHandlerList();
Form.Disposed +=new EventHandler(Form_Disposed);
Form.TextChanged += new EventHandler(Form_TextChanged);
}
/// <exclude />
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
/// <exclude />
protected virtual void Dispose(bool disposing)
{
if(disposing)
{
lock(this)
{
DockPanel = null;
if (AutoHideTab != null)
AutoHideTab.Dispose();
if (DockPaneTab != null)
DockPaneTab.Dispose();
Form.Disposed -= new EventHandler(Form_Disposed);
Form.TextChanged -= new EventHandler(Form_TextChanged);
Events.Dispose();
}
}
}
private Form m_form;
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Property[@name="Form"]/*'/>
public Form Form
{
get { return m_form; }
}
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Property[@name="Form"]/*'/>
public IDockContent Content
{
get { return Form as IDockContent; }
}
private EventHandlerList m_events;
private EventHandlerList Events
{
get { return m_events; }
}
private bool m_allowRedocking = true;
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Property[@name="AllowRedocking"]/*'/>
public bool AllowRedocking
{
get { return m_allowRedocking; }
set { m_allowRedocking = value; }
}
private double m_autoHidePortion = 0.25;
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Property[@name="AutoHidePortion"]/*'/>
public double AutoHidePortion
{
get { return m_autoHidePortion; }
set
{
if (value <= 0 || value > 1)
throw(new ArgumentOutOfRangeException(ResourceHelper.GetString("IDockContent.AutoHidePortion.OutOfRange")));
if (m_autoHidePortion == value)
return;
m_autoHidePortion = value;
if (DockPanel == null)
return;
if (DockPanel.ActiveAutoHideContent == this.Form as IDockContent)
DockPanel.PerformLayout();
}
}
private bool m_closeButton = true;
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Property[@name="CloseButton"]/*'/>
public bool CloseButton
{
get { return m_closeButton; }
set
{
if (m_closeButton == value)
return;
m_closeButton = value;
if (Pane != null)
if (Pane.ActiveContent == this)
Pane.RefreshChanges();
}
}
private DockState DefaultDockState
{
get
{
if (ShowHint != DockState.Unknown && ShowHint != DockState.Hidden)
return ShowHint;
if ((DockableAreas & DockAreas.Document) != 0)
return DockState.Document;
if ((DockableAreas & DockAreas.DockRight) != 0)
return DockState.DockRight;
if ((DockableAreas & DockAreas.DockLeft) != 0)
return DockState.DockLeft;
if ((DockableAreas & DockAreas.DockBottom) != 0)
return DockState.DockBottom;
if ((DockableAreas & DockAreas.DockTop) != 0)
return DockState.DockTop;
return DockState.Unknown;
}
}
private DockState DefaultShowState
{
get
{
if (ShowHint != DockState.Unknown)
return ShowHint;
if ((DockableAreas & DockAreas.Document) != 0)
return DockState.Document;
if ((DockableAreas & DockAreas.DockRight) != 0)
return DockState.DockRight;
if ((DockableAreas & DockAreas.DockLeft) != 0)
return DockState.DockLeft;
if ((DockableAreas & DockAreas.DockBottom) != 0)
return DockState.DockBottom;
if ((DockableAreas & DockAreas.DockTop) != 0)
return DockState.DockTop;
if ((DockableAreas & DockAreas.Float) != 0)
return DockState.Float;
return DockState.Unknown;
}
}
private DockAreas m_allowedAreas = DockAreas.DockLeft | DockAreas.DockRight | DockAreas.DockTop | DockAreas.DockBottom | DockAreas.Document | DockAreas.Float;
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Property[@name="DockableAreas"]/*'/>
public DockAreas DockableAreas
{
get { return m_allowedAreas; }
set
{
if (m_allowedAreas == value)
return;
if (!DockHelper.IsDockStateValid(DockState, value))
throw(new InvalidOperationException(ResourceHelper.GetString("IDockContent.DockableAreas.InvalidValue")));
m_allowedAreas = value;
if (!DockHelper.IsDockStateValid(ShowHint, m_allowedAreas))
ShowHint = DockState.Unknown;
}
}
private DockState m_dockState = DockState.Unknown;
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Property[@name="DockState"]/*'/>
public DockState DockState
{
get { return m_dockState; }
set
{
if (m_dockState == value)
return;
if (value == DockState.Hidden)
IsHidden = true;
else
SetDockState(false, value, Pane);
}
}
private DockPanel m_dockPanel = null;
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Property[@name="DockPanel"]/*'/>
public DockPanel DockPanel
{
get { return m_dockPanel; }
set
{
if (m_dockPanel == value)
return;
Pane = null;
if (m_dockPanel != null)
m_dockPanel.RemoveContent(Content);
if (m_dockPaneTab != null)
{
m_dockPaneTab.Dispose();
m_dockPaneTab = null;
}
if (m_autoHideTab != null)
{
m_autoHideTab.Dispose();
m_autoHideTab = null;
}
m_dockPanel = value;
if (m_dockPanel != null)
{
m_dockPanel.AddContent(Content);
Form.TopLevel = false;
Form.FormBorderStyle = FormBorderStyle.None;
Form.ShowInTaskbar = false;
User32.SetWindowPos(Form.Handle, IntPtr.Zero, 0, 0, 0, 0,
Win32.FlagsSetWindowPos.SWP_NOACTIVATE |
Win32.FlagsSetWindowPos.SWP_NOMOVE |
Win32.FlagsSetWindowPos.SWP_NOSIZE |
Win32.FlagsSetWindowPos.SWP_NOZORDER |
Win32.FlagsSetWindowPos.SWP_NOOWNERZORDER |
Win32.FlagsSetWindowPos.SWP_FRAMECHANGED);
m_dockPaneTab = DockPanel.DockPaneTabFactory.CreateDockPaneTab(Content);
m_autoHideTab = DockPanel.AutoHideTabFactory.CreateAutoHideTab(Content);
}
}
}
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Property[@name="Icon"]/*'/>
public Icon Icon
{
get { return Form.Icon; }
}
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Property[@name="Pane"]/*'/>
public DockPane Pane
{
get { return IsFloat ? FloatPane : PanelPane; }
set
{
if (Pane == value)
return;
DockPane oldPane = Pane;
SuspendSetDockState();
FloatPane = (value == null ? null : (value.IsFloat ? value : FloatPane));
PanelPane = (value == null ? null : (value.IsFloat ? PanelPane : value));
ResumeSetDockState(IsHidden, value != null ? value.DockState : DockState.Unknown, oldPane);
}
}
private bool m_isHidden = true;
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Property[@name="IsHidden"]/*'/>
public bool IsHidden
{
get { return m_isHidden; }
set
{
if (m_isHidden == value)
return;
SetDockState(value, VisibleState, Pane);
}
}
private string m_tabText = null;
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Property[@name="TabText"]/*'/>
public string TabText
{
get { return m_tabText==null ? Form.Text : m_tabText; }
set
{
if (m_tabText == value)
return;
m_tabText = value;
if (Pane != null)
Pane.RefreshChanges();
}
}
private DockState m_visibleState = DockState.Unknown;
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Property[@name="VisibleState"]/*'/>
public DockState VisibleState
{
get { return m_visibleState; }
set
{
if (m_visibleState == value)
return;
SetDockState(IsHidden, value, Pane);
}
}
private bool m_isFloat = false;
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Property[@name="IsFloat"]/*'/>
public bool IsFloat
{
get { return m_isFloat; }
set
{
DockState visibleState;
if (m_isFloat == value)
return;
DockPane oldPane = Pane;
if (value)
{
if (!IsDockStateValid(DockState.Float))
throw new InvalidOperationException(ResourceHelper.GetString("IDockContent.IsFloat.InvalidValue"));
visibleState = DockState.Float;
}
else
visibleState = (PanelPane != null) ? PanelPane.DockState : DefaultDockState;
if (visibleState == DockState.Unknown)
throw new InvalidOperationException(ResourceHelper.GetString("IDockContent.IsFloat.InvalidValue"));
SetDockState(IsHidden, visibleState, oldPane);
}
}
private DockPane m_panelPane = null;
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Property[@name="PanelPane"]/*'/>
public DockPane PanelPane
{
get { return m_panelPane; }
set
{
if (m_panelPane == value)
return;
if (value != null)
{
if (value.IsFloat || value.DockPanel != DockPanel)
throw new InvalidOperationException(ResourceHelper.GetString("IDockContent.DockPane.InvalidValue"));
}
DockPane oldPane = Pane;
if (m_panelPane != null)
m_panelPane.RemoveContent(Content);
m_panelPane = value;
if (m_panelPane != null)
{
m_panelPane.AddContent(Content);
SetDockState(IsHidden, IsFloat ? DockState.Float : m_panelPane.DockState, oldPane);
}
else
SetDockState(IsHidden, DockState.Unknown, oldPane);
}
}
private DockPane m_floatPane = null;
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Property[@name="FloatPane"]/*'/>
public DockPane FloatPane
{
get { return m_floatPane; }
set
{
if (m_floatPane == value)
return;
if (value != null)
{
if (!value.IsFloat || value.DockPanel != DockPanel)
throw new InvalidOperationException(ResourceHelper.GetString("IDockContent.FloatPane.InvalidValue"));
}
DockPane oldPane = Pane;
if (m_floatPane != null)
m_floatPane.RemoveContent(Content);
m_floatPane = value;
if (m_floatPane != null)
{
m_floatPane.AddContent(Content);
SetDockState(IsHidden, IsFloat ? DockState.Float : VisibleState, oldPane);
}
else
SetDockState(IsHidden, DockState.Unknown, oldPane);
}
}
private int m_countSetDockState = 0;
private void SuspendSetDockState()
{
m_countSetDockState ++;
}
private void ResumeSetDockState()
{
m_countSetDockState --;
if (m_countSetDockState < 0)
m_countSetDockState = 0;
}
internal bool IsSuspendSetDockState
{
get { return m_countSetDockState != 0; }
}
private void ResumeSetDockState(bool isHidden, DockState visibleState, DockPane oldPane)
{
ResumeSetDockState();
SetDockState(isHidden, visibleState, oldPane);
}
internal void SetDockState(bool isHidden, DockState visibleState, DockPane oldPane)
{
if (IsSuspendSetDockState)
return;
if (DockPanel == null && visibleState != DockState.Unknown)
throw new InvalidOperationException(ResourceHelper.GetString("IDockContent.SetDockState.NullPanel"));
if (visibleState == DockState.Hidden || (visibleState != DockState.Unknown && !IsDockStateValid(visibleState)))
throw new InvalidOperationException(ResourceHelper.GetString("IDockContent.SetDockState.InvalidState"));
SuspendSetDockState();
DockState oldDockState = DockState;
if (m_isHidden != isHidden || oldDockState == DockState.Unknown)
{
m_isHidden = isHidden;
}
m_visibleState = visibleState;
m_dockState = isHidden ? DockState.Hidden : visibleState;
if (visibleState == DockState.Unknown)
Pane = null;
else
{
m_isFloat = (m_visibleState == DockState.Float);
if (Pane == null)
Pane = DockPanel.DockPaneFactory.CreateDockPane(Content, visibleState, true);
else if (Pane.DockState != visibleState)
{
if (Pane.Contents.Count == 1)
Pane.SetDockState(visibleState);
else
Pane = DockPanel.DockPaneFactory.CreateDockPane(Content, visibleState, true);
}
}
SetPane(Pane);
SetVisible();
if (oldPane != null && !oldPane.IsDisposed && oldDockState == oldPane.DockState)
RefreshDockPane(oldPane);
if (Pane != null && DockState == Pane.DockState)
{
if ((Pane != oldPane) ||
(Pane == oldPane && oldDockState != oldPane.DockState))
RefreshDockPane(Pane);
}
if (oldDockState != DockState)
OnDockStateChanged(EventArgs.Empty);
ResumeSetDockState();
}
private void RefreshDockPane(DockPane pane)
{
pane.RefreshChanges();
pane.ValidateActiveContent();
}
internal string PersistString
{
get { return GetPersistStringDelegate == null ? Form.GetType().ToString() : GetPersistStringDelegate(); }
}
private GetPersistStringDelegate m_getPersistStringDelegate = null;
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Property[@name="GetPersistStringDelegate"]/*'/>
public GetPersistStringDelegate GetPersistStringDelegate
{
get { return m_getPersistStringDelegate; }
set { m_getPersistStringDelegate = value; }
}
private bool m_hideOnClose = false;
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Property[@name="HideOnClose"]/*'/>
public bool HideOnClose
{
get { return m_hideOnClose; }
set { m_hideOnClose = value; }
}
private DockState m_showHint = DockState.Unknown;
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Property[@name="ShowHint"]/*'/>
public DockState ShowHint
{
get { return m_showHint; }
set
{
if (!DockHelper.IsDockStateValid(value, DockableAreas))
throw (new InvalidOperationException(ResourceHelper.GetString("IDockContent.ShowHint.InvalidValue")));
if (m_showHint == value)
return;
m_showHint = value;
}
}
private bool m_isActivated = false;
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Property[@name="IsActivated"]/*'/>
public bool IsActivated
{
get { return m_isActivated; }
}
internal void SetIsActivated(bool value)
{
if (m_isActivated == value)
return;
m_isActivated = value;
}
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Method[@name="IsDockStateValid(DockState)"]/*'/>
public bool IsDockStateValid(DockState dockState)
{
if (DockPanel != null && dockState == DockState.Document && DockPanel.DocumentStyle == DocumentStyles.SystemMdi)
return false;
else
return DockHelper.IsDockStateValid(dockState, DockableAreas);
}
private ContextMenu m_tabPageContextMenu = null;
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Property[@name="TabPageContextMenu"]/*'/>
public ContextMenu TabPageContextMenu
{
get { return m_tabPageContextMenu; }
set { m_tabPageContextMenu = value; }
}
private string m_toolTipText = null;
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Property[@name="ToolTipText"]/*'/>
public string ToolTipText
{
get { return m_toolTipText; }
set { m_toolTipText = value; }
}
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Method[@name="Activate()"]/*'/>
public void Activate()
{
if (DockPanel == null)
Form.Activate();
else if (Pane == null)
Show(DockPanel);
else
{
IsHidden = false;
Pane.ActiveContent = Content;
if (DockState == DockState.Document && DockPanel.DocumentStyle == DocumentStyles.DockingMdi)
Form.Activate();
else if (!Form.ContainsFocus)
{
if (Contains(ActiveWindowHandle))
User32.SetFocus(ActiveWindowHandle);
if (!Form.ContainsFocus)
{
if (!Form.SelectNextControl(Form.ActiveControl, true, true, true, true))
// Since DockContent Form is not selectalbe, use Win32 SetFocus instead
User32.SetFocus(Form.Handle);
}
}
}
}
private bool Contains(IntPtr hWnd)
{
Control control = Control.FromChildHandle(hWnd);
for (Control parent=control; parent!=null; parent=parent.Parent)
if (parent == Form)
return true;
return false;
}
private IntPtr m_activeWindowHandle = IntPtr.Zero;
internal IntPtr ActiveWindowHandle
{
get { return m_activeWindowHandle; }
set { m_activeWindowHandle = value; }
}
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Method[@name="Hide()"]/*'/>
public void Hide()
{
IsHidden = true;
}
internal void SetPane(DockPane pane)
{
if (pane != null && pane.DockState == DockState.Document && DockPanel.DocumentStyle == DocumentStyles.DockingMdi)
{
if (Form.Parent is DockPane)
SetParent(null);
if (Form.MdiParent != DockPanel.ParentForm)
{
FlagClipWindow = true;
Form.MdiParent = DockPanel.ParentForm;
}
}
else
{
FlagClipWindow = true;
if (Form.MdiParent != null)
Form.MdiParent = null;
if (Form.TopLevel)
Form.TopLevel = false;
SetParent(pane);
}
}
internal void SetVisible()
{
bool visible;
if (IsHidden)
visible = false;
else if (Pane != null && Pane.DockState == DockState.Document && DockPanel.DocumentStyle == DocumentStyles.DockingMdi)
visible = true;
else if (Pane != null && Pane.ActiveContent == Form as IDockContent)
visible = true;
else if (Pane != null && Pane.ActiveContent != Form as IDockContent)
visible = false;
else
visible = Form.Visible;
Form.Visible = visible;
}
private void SetParent(Control value)
{
if (Form.Parent == value)
return;
if (Environment.Version.Major > 1)
{
Form.Parent = value;
return;
}
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Workaround for .Net Framework bug: removing control from Form may cause form
// unclosable. Set focus to another dummy control.
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Control oldParent = Form.Parent;
Form form = null;
if (Form.Parent is DockPane)
form = ((DockPane)Form.Parent).FindForm();
if (Form.ContainsFocus)
{
if (form is FloatWindow)
{
((FloatWindow)form).DummyControl.Focus();
form.ActiveControl = ((FloatWindow)form).DummyControl;
}
else if (DockPanel != null)
{
DockPanel.DummyControl.Focus();
if (form != null)
form.ActiveControl = DockPanel.DummyControl;
}
}
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Form.Parent = value;
}
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Method[@name="Show"]/*'/>
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Method[@name="Show()"]/*'/>
public void Show()
{
if (DockPanel == null)
Form.Show();
else
Show(DockPanel);
}
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Method[@name="Show(DockPanel)"]/*'/>
public void Show(DockPanel dockPanel)
{
if (dockPanel == null)
throw(new ArgumentNullException(ResourceHelper.GetString("IDockContent.Show.NullDockPanel")));
if (DockState == DockState.Unknown)
Show(dockPanel, DefaultShowState);
else
Activate();
}
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Method[@name="Show(DockPanel, DockState)"]/*'/>
public void Show(DockPanel dockPanel, DockState dockState)
{
if (dockPanel == null)
throw(new ArgumentNullException(ResourceHelper.GetString("IDockContent.Show.NullDockPanel")));
if (dockState == DockState.Unknown || dockState == DockState.Hidden)
throw(new ArgumentException(ResourceHelper.GetString("IDockContent.Show.InvalidDockState")));
DockPanel = dockPanel;
if (dockState == DockState.Float && FloatPane == null)
Pane = DockPanel.DockPaneFactory.CreateDockPane(Content, DockState.Float, true);
else if (PanelPane == null)
{
DockPane paneExisting = null;
foreach (DockPane pane in DockPanel.Panes)
if (pane.DockState == dockState)
{
paneExisting = pane;
break;
}
if (paneExisting == null)
Pane = DockPanel.DockPaneFactory.CreateDockPane(Content, dockState, true);
else
Pane = paneExisting;
}
DockState = dockState;
Activate();
}
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Method[@name="Show(DockPanel, Rectangle)"]/*'/>
public void Show(DockPanel dockPanel, Rectangle floatWindowBounds)
{
if (dockPanel == null)
throw(new ArgumentNullException(ResourceHelper.GetString("IDockContent.Show.NullDockPanel")));
DockPanel = dockPanel;
if (FloatPane == null)
{
IsHidden = true; // to reduce the screen flicker
FloatPane = DockPanel.DockPaneFactory.CreateDockPane(Content, DockState.Float, false);
FloatPane.FloatWindow.StartPosition = FormStartPosition.Manual;
}
FloatPane.FloatWindow.Bounds = floatWindowBounds;
Show(dockPanel, DockState.Float);
Activate();
}
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Method[@name="Show(DockPane, IDockContent)"]/*'/>
public void Show(DockPane pane, IDockContent beforeContent)
{
if (pane == null)
throw(new ArgumentNullException(ResourceHelper.GetString("IDockContent.Show.NullPane")));
if (beforeContent != null && pane.Contents.IndexOf(beforeContent) == -1)
throw(new ArgumentException(ResourceHelper.GetString("IDockContent.Show.InvalidBeforeContent")));
DockPanel = pane.DockPanel;
Pane = pane;
pane.SetContentIndex(Content, pane.Contents.IndexOf(beforeContent));
Show();
}
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Method[@name="Show(DockPane, DockAlignment, double)"]/*'/>
public void Show(DockPane prevPane, DockAlignment alignment, double proportion)
{
if (prevPane == null)
throw(new ArgumentException(ResourceHelper.GetString("IDockContent.Show.InvalidPrevPane")));
if (DockHelper.IsDockStateAutoHide(prevPane.DockState))
throw(new ArgumentException(ResourceHelper.GetString("IDockContent.Show.InvalidPrevPane")));
DockPanel = prevPane.DockPanel;
DockPanel.DockPaneFactory.CreateDockPane(Content, prevPane, alignment, proportion, true);
Show();
}
internal void SetBounds(Rectangle bounds)
{
Form.Bounds = bounds;
}
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Method[@name="Close()"]/*'/>
public void Close()
{
DockPanel dockPanel = DockPanel;
if (dockPanel != null)
dockPanel.SuspendLayout(true);
Form.Close();
if (dockPanel != null)
dockPanel.ResumeLayout(true, true);
}
private DockPaneTab m_dockPaneTab = null;
internal DockPaneTab DockPaneTab
{
get { return m_dockPaneTab; }
}
private AutoHideTab m_autoHideTab = null;
internal AutoHideTab AutoHideTab
{
get { return m_autoHideTab; }
}
#region Events
private static readonly object DockStateChangedEvent = new object();
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Event[@name="DockStateChanged"]/*'/>
public event EventHandler DockStateChanged
{
add { Events.AddHandler(DockStateChangedEvent, value); }
remove { Events.RemoveHandler(DockStateChangedEvent, value); }
}
/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Method[@name="OnDockStateChanged(EventArgs)"]/*'/>
protected virtual void OnDockStateChanged(EventArgs e)
{
EventHandler handler = (EventHandler)Events[DockStateChangedEvent];
if (handler != null)
handler(this, e);
}
#endregion
private void Form_Disposed(object sender, EventArgs e)
{
Dispose();
}
private void Form_TextChanged(object sender, EventArgs e)
{
if (DockHelper.IsDockStateAutoHide(DockState))
DockPanel.RefreshAutoHideStrip();
else if (Pane != null)
{
if (Pane.FloatWindow != null)
Pane.FloatWindow.SetText();
Pane.RefreshChanges();
}
}
private bool m_flagClipWindow = false;
internal bool FlagClipWindow
{
get { return m_flagClipWindow; }
set
{
if (m_flagClipWindow == value)
return;
m_flagClipWindow = value;
if (m_flagClipWindow)
Form.Region = new Region(Rectangle.Empty);
else
Form.Region = null;
}
}
#if FRAMEWORK_VER_2x
private ContextMenuStrip m_tabPageContextMenuStrip = null;
public ContextMenuStrip TabPageContextMenuStrip
{
get { return m_tabPageContextMenuStrip; }
set { m_tabPageContextMenuStrip = value; }
}
#endif
}
}

30
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockHelper.cs

@ -9,6 +9,8 @@ @@ -9,6 +9,8 @@
// *****************************************************************************
using System;
using System.Drawing;
using System.Windows.Forms;
namespace WeifenLuo.WinFormsUI
{
@ -116,5 +118,33 @@ namespace WeifenLuo.WinFormsUI @@ -116,5 +118,33 @@ namespace WeifenLuo.WinFormsUI
else
return state;
}
public static DockPane PaneAtPoint(Point pt, DockPanel dockPanel)
{
for (Control control = Win32Helper.ControlAtPoint(pt); control != null; control = control.Parent)
{
IDockContent content = control as IDockContent;
if (content != null && content.DockHandler.DockPanel == dockPanel)
return content.DockHandler.Pane;
DockPane pane = control as DockPane;
if (pane != null && pane.DockPanel == dockPanel)
return control as DockPane;
}
return null;
}
public static FloatWindow FloatWindowAtPoint(Point pt, DockPanel dockPanel)
{
for (Control control = Win32Helper.ControlAtPoint(pt); control != null; control = control.Parent)
{
FloatWindow floatWindow = control as FloatWindow;
if (floatWindow != null && floatWindow.DockPanel == dockPanel)
return control as FloatWindow;
}
return null;
}
}
}

595
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockIndicator.cs

@ -0,0 +1,595 @@ @@ -0,0 +1,595 @@
using System;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.ComponentModel;
namespace WeifenLuo.WinFormsUI
{
internal class DockIndicator : DragForm
{
#region IHitTest
private interface IHitTest
{
DockStyle HitTest(Point pt);
DockStyle Status { get; set; }
}
#endregion
#region PanelIndicator
private class PanelIndicator : PictureBox, IHitTest
{
private const string _ResourceImagePanelLeft = "DockIndicator.PanelLeft.bmp";
private const string _ResourceImagePanelLeftActive = "DockIndicator.PanelLeft.Active.bmp";
private const string _ResourceImagePanelRight = "DockIndicator.PanelRight.bmp";
private const string _ResourceImagePanelRightActive = "DockIndicator.PanelRight.Active.bmp";
private const string _ResourceImagePanelTop = "DockIndicator.PanelTop.bmp";
private const string _ResourceImagePanelTopActive = "DockIndicator.PanelTop.Active.bmp";
private const string _ResourceImagePanelBottom = "DockIndicator.PanelBottom.bmp";
private const string _ResourceImagePanelBottomActive = "DockIndicator.PanelBottom.Active.bmp";
private const string _ResourceImagePanelFill = "DockIndicator.PanelFill.bmp";
private const string _ResourceImagePanelFillActive = "DockIndicator.PanelFill.Active.bmp";
private static Image _imagePanelLeft;
private static Image _imagePanelRight;
private static Image _imagePanelTop;
private static Image _imagePanelBottom;
private static Image _imagePanelFill;
private static Image _imagePanelLeftActive = null;
private static Image _imagePanelRightActive = null;
private static Image _imagePanelTopActive = null;
private static Image _imagePanelBottomActive = null;
private static Image _imagePanelFillActive = null;
static PanelIndicator()
{
_imagePanelLeft = ResourceHelper.LoadBitmap(_ResourceImagePanelLeft);
_imagePanelRight = ResourceHelper.LoadBitmap(_ResourceImagePanelRight);
_imagePanelTop = ResourceHelper.LoadBitmap(_ResourceImagePanelTop);
_imagePanelBottom = ResourceHelper.LoadBitmap(_ResourceImagePanelBottom);
_imagePanelFill= ResourceHelper.LoadBitmap(_ResourceImagePanelFill);
_imagePanelLeftActive = ResourceHelper.LoadBitmap(_ResourceImagePanelLeftActive);
_imagePanelRightActive = ResourceHelper.LoadBitmap(_ResourceImagePanelRightActive);
_imagePanelTopActive = ResourceHelper.LoadBitmap(_ResourceImagePanelTopActive);
_imagePanelBottomActive = ResourceHelper.LoadBitmap(_ResourceImagePanelBottomActive);
_imagePanelFillActive = ResourceHelper.LoadBitmap(_ResourceImagePanelFillActive);
}
public PanelIndicator(DockStyle dockStyle)
{
m_dockStyle = dockStyle;
SizeMode = PictureBoxSizeMode.AutoSize;
Image = ImageInactive;
}
private DockStyle m_dockStyle;
private DockStyle DockStyle
{
get { return m_dockStyle; }
}
private DockStyle m_status;
public DockStyle Status
{
get { return m_status; }
set
{
if (value != DockStyle && value != DockStyle.None)
throw new InvalidEnumArgumentException();
if (m_status == value)
return;
m_status = value;
IsActivated = (m_status != DockStyle.None);
}
}
private Image ImageInactive
{
get
{
if (DockStyle == DockStyle.Left)
return _imagePanelLeft;
else if (DockStyle == DockStyle.Right)
return _imagePanelRight;
else if (DockStyle == DockStyle.Top)
return _imagePanelTop;
else if (DockStyle == DockStyle.Bottom)
return _imagePanelBottom;
else if (DockStyle == DockStyle.Fill)
return _imagePanelFill;
else
return null;
}
}
private Image ImageActive
{
get
{
if (DockStyle == DockStyle.Left)
return _imagePanelLeftActive;
else if (DockStyle == DockStyle.Right)
return _imagePanelRightActive;
else if (DockStyle == DockStyle.Top)
return _imagePanelTopActive;
else if (DockStyle == DockStyle.Bottom)
return _imagePanelBottomActive;
else if (DockStyle == DockStyle.Fill)
return _imagePanelFillActive;
else
return null;
}
}
private bool m_isActivated = false;
private bool IsActivated
{
get { return m_isActivated; }
set
{
m_isActivated = value;
Image = IsActivated ? ImageActive : ImageInactive;
}
}
public DockStyle HitTest(Point pt)
{
return ClientRectangle.Contains(PointToClient(pt)) ? DockStyle : DockStyle.None;
}
}
#endregion PanelIndicator
#region PaneIndicator
private class PaneIndicator : PictureBox, IHitTest
{
private struct HotSpotIndex
{
public HotSpotIndex(int x, int y, DockStyle dockStyle)
{
m_x = x;
m_y = y;
m_dockStyle = dockStyle;
}
private int m_x;
public int X
{
get { return m_x; }
}
private int m_y;
public int Y
{
get { return m_y; }
}
private DockStyle m_dockStyle;
public DockStyle DockStyle
{
get { return m_dockStyle; }
}
}
private const string _ResourceBitmapPaneDiamond = "DockIndicator.PaneDiamond.bmp";
private const string _ResourceBitmapPaneDiamondLeft = "DockIndicator.PaneDiamond.Left.bmp";
private const string _ResourceBitmapPaneDiamondRight = "DockIndicator.PaneDiamond.Right.bmp";
private const string _ResourceBitmapPaneDiamondTop = "DockIndicator.PaneDiamond.Top.bmp";
private const string _ResourceBitmapPaneDiamondBottom = "DockIndicator.PaneDiamond.Bottom.bmp";
private const string _ResourceBitmapPaneDiamondFill = "DockIndicator.PaneDiamond.Fill.bmp";
private const string _ResourceBitmapPaneDiamondHotSpot = "DockIndicator.PaneDiamond.HotSpot.bmp";
private const string _ResourceBitmapPaneDiamondHotSpotIndex = "DockIndicator.PaneDiamond.HotSpotIndex.bmp";
private static Bitmap _bitmapPaneDiamond;
private static Bitmap _bitmapPaneDiamondLeft;
private static Bitmap _bitmapPaneDiamondRight;
private static Bitmap _bitmapPaneDiamondTop;
private static Bitmap _bitmapPaneDiamondBottom;
private static Bitmap _bitmapPaneDiamondFill;
private static Bitmap _bitmapPaneDiamondHotSpot;
private static Bitmap _bitmapPaneDiamondHotSpotIndex;
private static HotSpotIndex[] _hotSpots;
private static GraphicsPath _displayingGraphicsPath;
static PaneIndicator()
{
_bitmapPaneDiamond = ResourceHelper.LoadBitmap(_ResourceBitmapPaneDiamond);
_bitmapPaneDiamondLeft = ResourceHelper.LoadBitmap(_ResourceBitmapPaneDiamondLeft);
_bitmapPaneDiamondRight = ResourceHelper.LoadBitmap(_ResourceBitmapPaneDiamondRight);
_bitmapPaneDiamondTop = ResourceHelper.LoadBitmap(_ResourceBitmapPaneDiamondTop);
_bitmapPaneDiamondBottom = ResourceHelper.LoadBitmap(_ResourceBitmapPaneDiamondBottom);
_bitmapPaneDiamondFill = ResourceHelper.LoadBitmap(_ResourceBitmapPaneDiamondFill);
_bitmapPaneDiamondHotSpot = ResourceHelper.LoadBitmap(_ResourceBitmapPaneDiamondHotSpot);
_bitmapPaneDiamondHotSpotIndex = ResourceHelper.LoadBitmap(_ResourceBitmapPaneDiamondHotSpotIndex);
_hotSpots = new HotSpotIndex[]
{
new HotSpotIndex(1, 0, DockStyle.Top),
new HotSpotIndex(0, 1, DockStyle.Left),
new HotSpotIndex(1, 1, DockStyle.Fill),
new HotSpotIndex(2, 1, DockStyle.Right),
new HotSpotIndex(1, 2, DockStyle.Bottom)
};
_displayingGraphicsPath = DrawHelper.CalculateGraphicsPathFromBitmap(_bitmapPaneDiamond);
}
public PaneIndicator()
{
SizeMode = PictureBoxSizeMode.AutoSize;
Image = _bitmapPaneDiamond;
Region = new Region(DisplayingGraphicsPath);
}
public GraphicsPath DisplayingGraphicsPath
{
get { return _displayingGraphicsPath; }
}
public DockStyle HitTest(Point pt)
{
pt = PointToClient(pt);
if (!ClientRectangle.Contains(pt))
return DockStyle.None;
for (int i=_hotSpots.GetLowerBound(0); i<=_hotSpots.GetUpperBound(0); i++)
{
if (_bitmapPaneDiamondHotSpot.GetPixel(pt.X, pt.Y) == _bitmapPaneDiamondHotSpotIndex.GetPixel(_hotSpots[i].X, _hotSpots[i].Y))
return _hotSpots[i].DockStyle;
}
return DockStyle.None;
}
private DockStyle m_status = DockStyle.None;
public DockStyle Status
{
get { return m_status; }
set
{
m_status = value;
if (m_status == DockStyle.None)
Image = _bitmapPaneDiamond;
else if (m_status == DockStyle.Left)
Image = _bitmapPaneDiamondLeft;
else if (m_status == DockStyle.Right)
Image = _bitmapPaneDiamondRight;
else if (m_status == DockStyle.Top)
Image = _bitmapPaneDiamondTop;
else if (m_status == DockStyle.Bottom)
Image = _bitmapPaneDiamondBottom;
else if (m_status == DockStyle.Fill)
Image = _bitmapPaneDiamondFill;
}
}
}
#endregion PaneIndicator
#region consts
private int _PanelIndicatorMargin = 10;
#endregion
public DockIndicator(DragHandler dragHandler)
{
m_dragHandler = dragHandler;
Controls.AddRange(new Control[]
{
PaneDiamond,
PanelLeft,
PanelRight,
PanelTop,
PanelBottom,
PanelFill
});
Bounds = GetAllScreenBounds();
Region = new Region(Rectangle.Empty);
}
private PaneIndicator m_paneDiamond = null;
private PaneIndicator PaneDiamond
{
get
{
if (m_paneDiamond == null)
m_paneDiamond = new PaneIndicator();
return m_paneDiamond;
}
}
private PanelIndicator m_panelLeft = null;
private PanelIndicator PanelLeft
{
get
{
if (m_panelLeft == null)
m_panelLeft = new PanelIndicator(DockStyle.Left);
return m_panelLeft;
}
}
private PanelIndicator m_panelRight = null;
private PanelIndicator PanelRight
{
get
{
if (m_panelRight == null)
m_panelRight = new PanelIndicator(DockStyle.Right);
return m_panelRight;
}
}
private PanelIndicator m_panelTop = null;
private PanelIndicator PanelTop
{
get
{
if (m_panelTop == null)
m_panelTop = new PanelIndicator(DockStyle.Top);
return m_panelTop;
}
}
private PanelIndicator m_panelBottom = null;
private PanelIndicator PanelBottom
{
get
{
if (m_panelBottom == null)
m_panelBottom = new PanelIndicator(DockStyle.Bottom);
return m_panelBottom;
}
}
private PanelIndicator m_panelFill = null;
private PanelIndicator PanelFill
{
get
{
if (m_panelFill == null)
m_panelFill = new PanelIndicator(DockStyle.Fill);
return m_panelFill;
}
}
private bool m_fullPanelEdge = false;
public bool FullPanelEdge
{
get { return m_fullPanelEdge; }
set
{
if (m_fullPanelEdge == value)
return;
m_fullPanelEdge = value;
RefreshChanges();
}
}
private DragHandler m_dragHandler;
public DragHandler DragHandler
{
get { return m_dragHandler; }
}
public DockPanel DockPanel
{
get { return DragHandler.DockPanel; }
}
private DockPane m_dockPane = null;
public DockPane DockPane
{
get { return m_dockPane; }
set
{
if (m_dockPane == value)
return;
DockPane oldDisplayingPane = DisplayingPane;
m_dockPane = value;
if (oldDisplayingPane != DisplayingPane)
RefreshChanges();
}
}
private IHitTest m_hitTest = null;
private IHitTest HitTestResult
{
get { return m_hitTest; }
set
{
if (m_hitTest == value)
return;
if (m_hitTest != null)
m_hitTest.Status = DockStyle.None;
m_hitTest = value;
}
}
private DockPane DisplayingPane
{
get { return ShouldPaneDiamondVisible() ? DockPane : null; }
}
private void RefreshChanges()
{
Region region = new Region(Rectangle.Empty);
Rectangle rectDockArea = FullPanelEdge ? DockPanel.DockArea : DockPanel.DocumentWindowBounds;
rectDockArea.Location = DockPanel.PointToScreen(rectDockArea.Location);
if (ShouldPanelIndicatorVisible(DockState.DockLeft))
{
PanelLeft.Location = new Point(rectDockArea.X + _PanelIndicatorMargin, rectDockArea.Y + (rectDockArea.Height - PanelRight.Height) / 2);
PanelLeft.Visible = true;
region.Union(PanelLeft.Bounds);
}
else
PanelLeft.Visible = false;
if (ShouldPanelIndicatorVisible(DockState.DockRight))
{
PanelRight.Location = new Point(rectDockArea.X + rectDockArea.Width - PanelRight.Width - _PanelIndicatorMargin, rectDockArea.Y + (rectDockArea.Height - PanelRight.Height) / 2);
PanelRight.Visible = true;
region.Union(PanelRight.Bounds);
}
else
PanelRight.Visible = false;
if (ShouldPanelIndicatorVisible(DockState.DockTop))
{
PanelTop.Location = new Point(rectDockArea.X + (rectDockArea.Width - PanelTop.Width) / 2, rectDockArea.Y + _PanelIndicatorMargin);
PanelTop.Visible = true;
region.Union(PanelTop.Bounds);
}
else
PanelTop.Visible = false;
if (ShouldPanelIndicatorVisible(DockState.DockBottom))
{
PanelBottom.Location = new Point(rectDockArea.X + (rectDockArea.Width - PanelBottom.Width) / 2, rectDockArea.Y + rectDockArea.Height - PanelBottom.Height - _PanelIndicatorMargin);
PanelBottom.Visible = true;
region.Union(PanelBottom.Bounds);
}
else
PanelBottom.Visible = false;
if (ShouldPanelIndicatorVisible(DockState.Document))
{
Rectangle rectDocumentWindow = DockPanel.DocumentWindowBounds;
rectDocumentWindow.Location = DockPanel.PointToScreen(rectDocumentWindow.Location);
PanelFill.Location = new Point(rectDocumentWindow.X + (rectDocumentWindow.Width - PanelFill.Width) / 2, rectDocumentWindow.Y + (rectDocumentWindow.Height - PanelFill.Height) / 2);
PanelFill.Visible = true;
region.Union(PanelFill.Bounds);
}
else
PanelFill.Visible = false;
if (ShouldPaneDiamondVisible())
{
Rectangle rect = DockPane.ClientRectangle;
rect.Location = DockPane.PointToScreen(rect.Location);
PaneDiamond.Location = new Point(rect.Left + (rect.Width - PaneDiamond.Width) / 2, rect.Top + (rect.Height - PaneDiamond.Height) / 2);
PaneDiamond.Visible = true;
using (GraphicsPath graphicsPath = PaneDiamond.DisplayingGraphicsPath.Clone() as GraphicsPath)
{
Point[] pts = new Point[]
{
new Point(PaneDiamond.Left, PaneDiamond.Top),
new Point(PaneDiamond.Right, PaneDiamond.Top),
new Point(PaneDiamond.Left, PaneDiamond.Bottom)
};
using (Matrix matrix = new Matrix(PaneDiamond.ClientRectangle, pts))
{
graphicsPath.Transform(matrix);
}
region.Union(graphicsPath);
}
}
else
PaneDiamond.Visible = false;
Region = region;
}
private bool ShouldPanelIndicatorVisible(DockState dockState)
{
if (!Visible)
return false;
if (DockPanel.DockWindows[dockState].Visible)
return false;
return DragHandler.IsDockStateValid(dockState);
}
private bool ShouldPaneDiamondVisible()
{
if (DockPane == null)
return false;
if (DragHandler.DragControl == DockPane)
return false;
if (DragHandler.DragControl == DockPane.DockListContainer)
return false;
IDockContent content = DragHandler.DragControl as IDockContent;
if (content != null && DockPane.Contents.Contains(content) && DockPane.DisplayingContents.Count == 1)
return false;
return DragHandler.IsDockStateValid(DockPane.DockState);
}
public override void Show(bool bActivate)
{
base.Show (bActivate);
RefreshChanges();
}
public void TestDrop()
{
Point pt = Control.MousePosition;
DockPane = DockHelper.PaneAtPoint(pt, DockPanel);
if (TestDrop(PanelLeft, pt) != DockStyle.None)
HitTestResult = PanelLeft;
else if (TestDrop(PanelRight, pt) != DockStyle.None)
HitTestResult = PanelRight;
else if (TestDrop(PanelTop, pt) != DockStyle.None)
HitTestResult = PanelTop;
else if (TestDrop(PanelBottom, pt) != DockStyle.None)
HitTestResult = PanelBottom;
else if (TestDrop(PanelFill, pt) != DockStyle.None)
HitTestResult = PanelFill;
else if (TestDrop(PaneDiamond, pt) != DockStyle.None)
HitTestResult = PaneDiamond;
else
HitTestResult = null;
if (HitTestResult != null)
{
if (HitTestResult is PaneIndicator)
DragHandler.DockOutline.Show(DockPane, HitTestResult.Status);
else
DragHandler.DockOutline.Show(DockPanel, HitTestResult.Status, FullPanelEdge);
}
}
private DockStyle TestDrop(IHitTest hitTest, Point pt)
{
return hitTest.Status = hitTest.HitTest(pt);
}
private 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;
}
}
}

157
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockOutline.cs

@ -0,0 +1,157 @@ @@ -0,0 +1,157 @@
// *****************************************************************************
//
// Copyright 2004, Weifen Luo
// All rights reserved. The software and associated documentation
// supplied hereunder are the proprietary information of Weifen Luo
// and are supplied subject to licence terms.
//
// WinFormsUI Library Version 1.0
// *****************************************************************************
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
namespace WeifenLuo.WinFormsUI
{
internal class DockOutline : DockOutlineBase
{
public DockOutline()
{
m_dragForm = new DragForm();
SetDragForm(Rectangle.Empty);
DragForm.BackColor = Color.Blue;
DragForm.Opacity = 0.5;
DragForm.Show(false);
}
DragForm m_dragForm;
private DragForm DragForm
{
get { return m_dragForm; }
}
protected override void OnShow()
{
CalculateRegion();
}
protected override void OnClose()
{
DragForm.Close();
}
private void CalculateRegion()
{
if (SameAsOldValue)
return;
if (!FloatWindowBounds.IsEmpty)
SetOutline(FloatWindowBounds);
else if (DockTo is DockPanel)
SetOutline(DockTo as DockPanel, Dock, (ContentIndex != 0));
else if (DockTo is DockPane)
SetOutline(DockTo as DockPane, Dock, ContentIndex);
else
SetOutline();
}
private void SetOutline()
{
SetDragForm(Rectangle.Empty);
}
private void SetOutline(Rectangle floatWindowBounds)
{
SetDragForm(floatWindowBounds);
}
private void SetOutline(DockPanel dockPanel, DockStyle dock, bool fullPanelEdge)
{
Rectangle rect = fullPanelEdge ? dockPanel.DockArea : dockPanel.DocumentWindowBounds;
rect.Location = dockPanel.PointToScreen(rect.Location);
if (dock == DockStyle.Top)
{
int height = (int)(rect.Height * dockPanel.DockBottomPortion);
rect = new Rectangle(rect.X, rect.Y, rect.Width, height);
}
else if (dock == DockStyle.Bottom)
{
int height = (int)(rect.Height * dockPanel.DockBottomPortion);
rect = new Rectangle(rect.X, rect.Bottom - height, rect.Width, height);
}
else if (dock == DockStyle.Left)
{
int width = (int)(rect.Width * dockPanel.DockLeftPortion);
rect = new Rectangle(rect.X, rect.Y, width, rect.Height);
}
else if (dock == DockStyle.Right)
{
int width = (int)(rect.Width * dockPanel.DockRightPortion);
rect = new Rectangle(rect.Right - width, rect.Y, width, rect.Height);
}
else if (dock == DockStyle.Fill)
{
rect = dockPanel.DocumentWindowBounds;
rect.Location = dockPanel.PointToScreen(rect.Location);
}
SetDragForm(rect);
}
private void SetOutline(DockPane pane, DockStyle dock, int contentIndex)
{
if (dock != DockStyle.Fill)
{
Rectangle rect = pane.DisplayingRectangle;
if (dock == DockStyle.Right)
rect.X += rect.Width / 2;
if (dock == DockStyle.Bottom)
rect.Y += rect.Height / 2;
if (dock == DockStyle.Left || dock == DockStyle.Right)
rect.Width -= rect.Width / 2;
if (dock == DockStyle.Top || dock == DockStyle.Bottom)
rect.Height -= rect.Height / 2;
rect.Location = pane.PointToScreen(rect.Location);
SetDragForm(rect);
}
else if (contentIndex == -1)
{
Rectangle rect = pane.DisplayingRectangle;
rect.Location = pane.PointToScreen(rect.Location);
SetDragForm(rect);
}
else
{
using (GraphicsPath path = pane.TabStripControl.GetOutlinePath(contentIndex))
{
RectangleF rectF = path.GetBounds();
Rectangle rect = new Rectangle((int)rectF.X, (int)rectF.Y, (int)rectF.Width, (int)rectF.Height);
using (Matrix matrix = new Matrix(rect, new Point[] { new Point(0, 0), new Point(rect.Width, 0), new Point(0, rect.Height) }))
{
path.Transform(matrix);
}
Region region = new Region(path);
SetDragForm(rect, region);
}
}
}
private void SetDragForm(Rectangle rect)
{
DragForm.Bounds = rect;
if (rect == Rectangle.Empty)
DragForm.Region = new Region(Rectangle.Empty);
else if (DragForm.Region != null)
DragForm.Region = null;
}
private void SetDragForm(Rectangle rect, Region region)
{
DragForm.Bounds = rect;
DragForm.Region = region;
}
}
}

166
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockOutlineBase.cs

@ -0,0 +1,166 @@ @@ -0,0 +1,166 @@
// *****************************************************************************
//
// Copyright 2004, Weifen Luo
// All rights reserved. The software and associated documentation
// supplied hereunder are the proprietary information of Weifen Luo
// and are supplied subject to licence terms.
//
// WinFormsUI Library Version 1.0
// *****************************************************************************
using System;
using System.Drawing;
using System.Windows.Forms;
namespace WeifenLuo.WinFormsUI
{
internal abstract class DockOutlineBase
{
public DockOutlineBase()
{
Init();
}
private void Init()
{
SetValues(Rectangle.Empty, null, DockStyle.None, -1);
SaveOldValues();
}
private Rectangle m_oldFloatWindowBounds;
protected Rectangle OldFloatWindowBounds
{
get { return m_oldFloatWindowBounds; }
}
private Control m_oldDockTo;
protected Control OldDockTo
{
get { return m_oldDockTo; }
}
private DockStyle m_oldDock;
protected DockStyle OldDock
{
get { return m_oldDock; }
}
private int m_oldContentIndex;
protected int OldContentIndex
{
get { return m_oldContentIndex; }
}
protected bool SameAsOldValue
{
get
{
return FloatWindowBounds == OldFloatWindowBounds &&
DockTo == OldDockTo &&
Dock == OldDock &&
ContentIndex == OldContentIndex;
}
}
private Rectangle m_floatWindowBounds;
public Rectangle FloatWindowBounds
{
get { return m_floatWindowBounds; }
}
private Control m_dockTo;
public Control DockTo
{
get { return m_dockTo; }
}
private DockStyle m_dock;
public DockStyle Dock
{
get { return m_dock; }
}
private int m_contentIndex;
public int ContentIndex
{
get { return m_contentIndex; }
}
private bool m_flagTestDrop = false;
public bool FlagTestDrop
{
get { return m_flagTestDrop; }
set { m_flagTestDrop = value; }
}
private void SaveOldValues()
{
m_oldDockTo = m_dockTo;
m_oldDock = m_dock;
m_oldContentIndex = m_contentIndex;
m_oldFloatWindowBounds = m_floatWindowBounds;
}
protected abstract void OnShow();
protected abstract void OnClose();
private void SetValues(Rectangle floatWindowBounds, Control dockTo, DockStyle dock, int contentIndex)
{
m_floatWindowBounds = floatWindowBounds;
m_dockTo = dockTo;
m_dock = dock;
m_contentIndex = contentIndex;
FlagTestDrop = true;
}
private void TestChange()
{
if (m_floatWindowBounds != m_oldFloatWindowBounds ||
m_dockTo != m_oldDockTo ||
m_dock != m_oldDock ||
m_contentIndex != m_oldContentIndex)
OnShow();
}
public void Show()
{
SaveOldValues();
SetValues(Rectangle.Empty, null, DockStyle.None, -1);
TestChange();
}
public void Show(DockPane pane, DockStyle dock)
{
SaveOldValues();
SetValues(Rectangle.Empty, pane, dock, -1);
TestChange();
}
public void Show(DockPane pane, int contentIndex)
{
SaveOldValues();
SetValues(Rectangle.Empty, pane, DockStyle.Fill, contentIndex);
TestChange();
}
public void Show(DockPanel dockPanel, DockStyle dock, bool fullPanelEdge)
{
SaveOldValues();
SetValues(Rectangle.Empty, dockPanel, dock, fullPanelEdge ? -1 : 0);
TestChange();
}
public void Show(Rectangle floatWindowBounds)
{
SaveOldValues();
SetValues(floatWindowBounds, null, DockStyle.None, -1);
TestChange();
}
public void Close()
{
OnClose();
}
}
}

428
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPane.cs

@ -9,7 +9,6 @@ @@ -9,7 +9,6 @@
// *****************************************************************************
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
@ -19,6 +18,7 @@ using System.Runtime.InteropServices; @@ -19,6 +18,7 @@ using System.Runtime.InteropServices;
namespace WeifenLuo.WinFormsUI
{
/// <include file='CodeDoc\DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/ClassDef/*'/>
[ToolboxItem(false)]
public class DockPane : UserControl
{
/// <include file='CodeDoc\DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Enum[@name="AppearanceStyle"]/EnumDef/*'/>
@ -63,39 +63,39 @@ namespace WeifenLuo.WinFormsUI @@ -63,39 +63,39 @@ namespace WeifenLuo.WinFormsUI
}
private DockPaneStripBase m_tabStripControl;
private DockPaneStripBase TabStripControl
internal DockPaneStripBase TabStripControl
{
get { return m_tabStripControl; }
}
/// <include file='CodeDoc\DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="Overloads"]/*'/>
/// <include file='CodeDoc\DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="(DockContent, DockState, bool)"]/*'/>
public DockPane(DockContent content, DockState visibleState, bool show)
/// <include file='CodeDoc\DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="(IDockContent, DockState, bool)"]/*'/>
public DockPane(IDockContent content, DockState visibleState, bool show)
{
InternalConstruct(content, visibleState, false, Rectangle.Empty, null, DockAlignment.Right, 0.5, show);
}
/// <include file='CodeDoc\DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="(DockContent, FloatWindow, bool)"]/*'/>
public DockPane(DockContent content, FloatWindow floatWindow, bool show)
/// <include file='CodeDoc\DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="(IDockContent, FloatWindow, bool)"]/*'/>
public DockPane(IDockContent content, FloatWindow floatWindow, bool show)
{
InternalConstruct(content, DockState.Float, false, Rectangle.Empty, floatWindow.DockList.GetDefaultPrevPane(this), DockAlignment.Right, 0.5, show);
}
/// <include file='CodeDoc\DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="(DockContent, DockPane, DockAlignment, double, bool)"]/*'/>
public DockPane(DockContent content, DockPane prevPane, DockAlignment alignment, double proportion, bool show)
/// <include file='CodeDoc\DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="(IDockContent, DockPane, DockAlignment, double, bool)"]/*'/>
public DockPane(IDockContent content, DockPane prevPane, DockAlignment alignment, double proportion, bool show)
{
if (prevPane == null)
throw(new ArgumentNullException());
InternalConstruct(content, prevPane.DockState, false, Rectangle.Empty, prevPane, alignment, proportion, show);
}
/// <include file='CodeDoc\DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="(DockContent, Rectangle, bool)"]/*'/>
public DockPane(DockContent content, Rectangle floatWindowBounds, bool show)
/// <include file='CodeDoc\DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="(IDockContent, Rectangle, bool)"]/*'/>
public DockPane(IDockContent content, Rectangle floatWindowBounds, bool show)
{
InternalConstruct(content, DockState.Float, true, floatWindowBounds, null, DockAlignment.Right, 0.5, show);
}
private void InternalConstruct(DockContent content, DockState dockState, bool flagBounds, Rectangle floatWindowBounds, DockPane prevPane, DockAlignment alignment, double proportion, bool show)
private void InternalConstruct(IDockContent content, DockState dockState, bool flagBounds, Rectangle floatWindowBounds, DockPane prevPane, DockAlignment alignment, double proportion, bool show)
{
if (dockState == DockState.Hidden || dockState == DockState.Unknown)
throw new ArgumentException(ResourceHelper.GetString("DockPane.DockState.InvalidState"));
@ -103,22 +103,19 @@ namespace WeifenLuo.WinFormsUI @@ -103,22 +103,19 @@ namespace WeifenLuo.WinFormsUI
if (content == null)
throw new ArgumentNullException(ResourceHelper.GetString("DockPane.Constructor.NullContent"));
if (content.DockPanel == null)
if (content.DockHandler.DockPanel == null)
throw new ArgumentException(ResourceHelper.GetString("DockPane.Constructor.NullDockPanel"));
SuspendLayout();
SetStyle(ControlStyles.ResizeRedraw, true);
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
SetStyle(ControlStyles.Selectable, true);
SetStyle(ControlStyles.Selectable, false);
m_isFloat = (dockState == DockState.Float);
m_contents = new DockContentCollection();
m_displayingContents = new DockContentCollection(this);
m_tabs = new DockPaneTabCollection(this);
m_dockPanel = content.DockPanel;
m_dockPanel = content.DockHandler.DockPanel;
m_dockPanel.AddPane(this);
m_splitter = new DockPaneSplitter(this);
@ -130,6 +127,7 @@ namespace WeifenLuo.WinFormsUI @@ -130,6 +127,7 @@ namespace WeifenLuo.WinFormsUI
m_tabStripControl = DockPanel.DockPaneStripFactory.CreateDockPaneStrip(this);
Controls.AddRange(new Control[] { m_captionControl, m_tabStripControl });
DockPanel.SuspendLayout(true);
if (flagBounds)
FloatWindow = DockPanel.FloatWindowFactory.CreateFloatWindow(DockPanel, this, floatWindowBounds);
else if (prevPane != null)
@ -137,20 +135,21 @@ namespace WeifenLuo.WinFormsUI @@ -137,20 +135,21 @@ namespace WeifenLuo.WinFormsUI
SetDockState(dockState);
if (show)
content.Pane = this;
content.DockHandler.Pane = this;
else if (this.IsFloat)
content.FloatPane = this;
content.DockHandler.FloatPane = this;
else
content.PanelPane = this;
content.DockHandler.PanelPane = this;
ResumeLayout();
DockPanel.ResumeLayout(true, true);
}
private void Close_Click(object sender, EventArgs e)
{
CloseActiveContent();
if (!DockHelper.IsDockStateAutoHide(DockState) && ActiveContent != null)
ActiveContent.Activate();
ActiveContent.DockHandler.Activate();
}
/// <exclude/>
@ -175,10 +174,9 @@ namespace WeifenLuo.WinFormsUI @@ -175,10 +174,9 @@ namespace WeifenLuo.WinFormsUI
base.Dispose(disposing);
}
private Stack<DockContent> m_visitedTabs = new Stack<DockContent>();
private DockContent m_activeContent = null;
private IDockContent m_activeContent = null;
/// <include file='CodeDoc\DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Property[@name="ActiveContent"]/*'/>
public virtual DockContent ActiveContent
public virtual IDockContent ActiveContent
{
get { return m_activeContent; }
set
@ -197,27 +195,30 @@ namespace WeifenLuo.WinFormsUI @@ -197,27 +195,30 @@ namespace WeifenLuo.WinFormsUI
throw(new InvalidOperationException(ResourceHelper.GetString("DockPane.ActiveContent.InvalidValue")));
}
DockContent oldValue = m_activeContent;
IDockContent oldValue = m_activeContent;
if (DockPanel.ActiveAutoHideContent == oldValue)
DockPanel.ActiveAutoHideContent = null;
m_activeContent = value;
if (m_activeContent != null && m_activeContent.DockState == DockState.Document)
if (DockPanel.DocumentStyle == DocumentStyles.DockingMdi && DockState == DockState.Document)
{
if (!(m_visitedTabs.Count > 0 && m_visitedTabs.Peek() == m_activeContent))
{
m_visitedTabs.Push(m_activeContent);
}
if (m_activeContent != null)
m_activeContent.DockHandler.Form.BringToFront();
}
else
{
if (m_activeContent != null)
m_activeContent.DockHandler.SetVisible();
if (oldValue != null && DisplayingContents.Contains(oldValue))
oldValue.DockHandler.SetVisible();
}
if (FloatWindow != null)
FloatWindow.SetText();
RefreshChanges();
PerformLayout();
DockPanel.RefreshActiveWindow();
RefreshChanges(false);
if (m_activeContent != null)
TabStripControl.EnsureTabVisible(m_activeContent);
@ -256,7 +257,7 @@ namespace WeifenLuo.WinFormsUI @@ -256,7 +257,7 @@ namespace WeifenLuo.WinFormsUI
}
}
private Rectangle ContentRectangle
internal Rectangle ContentRectangle
{
get
{
@ -274,7 +275,7 @@ namespace WeifenLuo.WinFormsUI @@ -274,7 +275,7 @@ namespace WeifenLuo.WinFormsUI
}
}
private Rectangle TabStripRectangle
internal Rectangle TabStripRectangle
{
get
{
@ -313,7 +314,7 @@ namespace WeifenLuo.WinFormsUI @@ -313,7 +314,7 @@ namespace WeifenLuo.WinFormsUI
if (DisplayingContents.Count == 0)
return Rectangle.Empty;
if (DisplayingContents.Count == 1 && DockPanel.SdiDocument)
if (DisplayingContents.Count == 1 && DockPanel.DocumentStyle == DocumentStyles.DockingSdi)
return Rectangle.Empty;
Rectangle rectWindow = DisplayingRectangle;
@ -329,7 +330,7 @@ namespace WeifenLuo.WinFormsUI @@ -329,7 +330,7 @@ namespace WeifenLuo.WinFormsUI
/// <include file='CodeDoc\DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Property[@name="CaptionText"]/*'/>
public virtual string CaptionText
{
get { return ActiveContent == null ? string.Empty : ActiveContent.Text; }
get { return ActiveContent == null ? string.Empty : ActiveContent.DockHandler.TabText; }
}
private DockContentCollection m_contents;
@ -346,13 +347,6 @@ namespace WeifenLuo.WinFormsUI @@ -346,13 +347,6 @@ namespace WeifenLuo.WinFormsUI
get { return m_displayingContents; }
}
/// <exclude/>
protected override Size DefaultSize
{
// set the default size to empty to reduce screen flickers
get { return Size.Empty; }
}
private DockPanel m_dockPanel;
/// <include file='CodeDoc\DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Property[@name="DockPanel"]/*'/>
public DockPanel DockPanel
@ -387,7 +381,7 @@ namespace WeifenLuo.WinFormsUI @@ -387,7 +381,7 @@ namespace WeifenLuo.WinFormsUI
m_isActivated = value;
if (DockState != DockState.Document)
RefreshChanges();
RefreshChanges(false);
OnIsActivatedChanged(EventArgs.Empty);
}
@ -411,8 +405,8 @@ namespace WeifenLuo.WinFormsUI @@ -411,8 +405,8 @@ namespace WeifenLuo.WinFormsUI
/// <include file='CodeDoc\DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Method[@name="IsDockStateValid(DockState)"]/*'/>
public bool IsDockStateValid(DockState dockState)
{
foreach (DockContent content in Contents)
if (!content.IsDockStateValid(dockState))
foreach (IDockContent content in Contents)
if (!content.DockHandler.IsDockStateValid(dockState))
return false;
return true;
@ -436,7 +430,7 @@ namespace WeifenLuo.WinFormsUI @@ -436,7 +430,7 @@ namespace WeifenLuo.WinFormsUI
get { return (DockState == DockState.Document) ? AppearanceStyle.Document : AppearanceStyle.ToolWindow; }
}
private Rectangle DisplayingRectangle
internal Rectangle DisplayingRectangle
{
get { return ClientRectangle; }
}
@ -447,11 +441,11 @@ namespace WeifenLuo.WinFormsUI @@ -447,11 +441,11 @@ namespace WeifenLuo.WinFormsUI
if (DockHelper.IsDockStateAutoHide(DockState) && DockPanel.ActiveAutoHideContent != ActiveContent)
DockPanel.ActiveAutoHideContent = ActiveContent;
if (!IsActivated)
Focus();
if (!IsActivated && ActiveContent != null)
ActiveContent.DockHandler.Activate();
}
internal void AddContent(DockContent content)
internal void AddContent(IDockContent content)
{
if (Contents.Contains(content))
return;
@ -470,25 +464,25 @@ namespace WeifenLuo.WinFormsUI @@ -470,25 +464,25 @@ namespace WeifenLuo.WinFormsUI
CloseContent(ActiveContent);
}
internal void CloseContent(DockContent content)
internal void CloseContent(IDockContent content)
{
if (content == null)
return;
if (!content.CloseButton)
if (!content.DockHandler.CloseButton)
return;
if (content.HideOnClose)
content.Hide();
if (content.DockHandler.HideOnClose)
content.DockHandler.Hide();
else
{
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Workaround for .Net Framework bug: removing control from Form may cause form
// unclosable.
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Form form = FindForm();
if (ContainsFocus)
if (Environment.Version.Major == 1 && ContainsFocus)
{
Form form = FindForm();
if (form is FloatWindow)
{
((FloatWindow)form).DummyControl.Focus();
@ -503,7 +497,7 @@ namespace WeifenLuo.WinFormsUI @@ -503,7 +497,7 @@ namespace WeifenLuo.WinFormsUI
}
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
content.Close();
content.DockHandler.Close();
}
}
@ -533,45 +527,6 @@ namespace WeifenLuo.WinFormsUI @@ -533,45 +527,6 @@ namespace WeifenLuo.WinFormsUI
return new HitTestResult(HitTestArea.None, -1);
}
private Region GetTestDropOutline(DockStyle dockStyle, int contentIndex)
{
int dragSize = MeasureOutline.Width;
if (dockStyle != DockStyle.Fill)
{
Rectangle rect = DisplayingRectangle;
if (dockStyle == DockStyle.Right)
rect.X += rect.Width / 2;
if (dockStyle == DockStyle.Bottom)
rect.Y += rect.Height / 2;
if (dockStyle == DockStyle.Left || dockStyle == DockStyle.Right)
rect.Width -= rect.Width / 2;
if (dockStyle == DockStyle.Top || dockStyle == DockStyle.Bottom)
rect.Height -= rect.Height / 2;
rect.Location = PointToScreen(rect.Location);
return DrawHelper.CreateDragOutline(rect, dragSize);
}
else if (contentIndex == -1)
{
Rectangle rect = DisplayingRectangle;
rect.Location = PointToScreen(rect.Location);
return DrawHelper.CreateDragOutline(rect, dragSize);
}
else
{
Rectangle rect = DisplayingRectangle;
rect.Location = PointToScreen(rect.Location);
Region region = DrawHelper.CreateDragOutline(rect, dragSize);
Rectangle rectTabStrip = TabStripRectangle;
rectTabStrip.Location = PointToScreen(rectTabStrip.Location);
region.Union(rectTabStrip);
region.Xor(TabStripControl.GetOutlineXorPath(contentIndex));
return region;
}
}
private bool m_isHidden = true;
/// <include file='CodeDoc\DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Property[@name="IsHidden"]/*'/>
public bool IsHidden
@ -602,31 +557,36 @@ namespace WeifenLuo.WinFormsUI @@ -602,31 +557,36 @@ namespace WeifenLuo.WinFormsUI
CaptionControl.Bounds = CaptionRectangle;
TabStripControl.Bounds = TabStripRectangle;
Rectangle rectContent = ContentRectangle;
SetContentBounds();
// Need to set the visible content first, otherwise keyboard focus will be lost
if (ActiveContent != null)
foreach (IDockContent content in Contents)
{
ActiveContent.Bounds = rectContent;
ActiveContent.BringToFront();
ActiveContent.Visible = true;
}
// Hide all inactive contents
foreach (DockContent content in Contents)
{
if (content.Pane == this && content != ActiveContent)
{
content.Visible = false;
content.Bounds = Rectangle.Empty;
}
if (DisplayingContents.Contains(content))
if (content.DockHandler.FlagClipWindow && content.DockHandler.Form.Visible)
content.DockHandler.FlagClipWindow = false;
}
}
base.OnLayout(e);
}
internal void SetContentBounds()
{
Rectangle rectContent = ContentRectangle;
if (DockState == DockState.Document && DockPanel.DocumentStyle == DocumentStyles.DockingMdi)
rectContent = new Rectangle(DockPanel.PointToMdiClient(PointToScreen(rectContent.Location)), rectContent.Size);
foreach (IDockContent content in Contents)
if (content.DockHandler.Pane == this)
content.DockHandler.SetBounds(rectContent);
}
internal void RefreshChanges()
{
RefreshChanges(true);
}
private void RefreshChanges(bool bPerformLayout)
{
CaptionControl.RefreshChanges();
TabStripControl.RefreshChanges();
@ -638,23 +598,24 @@ namespace WeifenLuo.WinFormsUI @@ -638,23 +598,24 @@ namespace WeifenLuo.WinFormsUI
DockPanel.PerformLayout();
}
PerformLayout();
if (bPerformLayout)
PerformLayout();
}
internal void RemoveContent(DockContent content)
internal void RemoveContent(IDockContent content)
{
if (!Contents.Contains(content))
return;
Contents.Remove(content);
if (content.Parent == this)
content.SetParent(null);
if (content.DockHandler.Pane == this)
content.DockHandler.SetPane(null);
if (Contents.Count == 0)
Dispose();
}
/// <include file='CodeDoc\DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Method[@name="SetContentIndex(DockContent, int)"]/*'/>
public void SetContentIndex(DockContent content, int index)
/// <include file='CodeDoc\DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Method[@name="SetContentIndex(IDockContent, int)"]/*'/>
public void SetContentIndex(IDockContent content, int index)
{
int oldIndex = Contents.IndexOf(content);
if (oldIndex == -1)
@ -709,12 +670,18 @@ namespace WeifenLuo.WinFormsUI @@ -709,12 +670,18 @@ namespace WeifenLuo.WinFormsUI
if (Parent == value)
return;
Control oldParent = Parent;
if (Environment.Version.Major > 1)
{
Parent = value;
return;
}
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Workaround for .Net Framework bug: removing control from Form may cause form
// unclosable. Set focus to another dummy control.
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Control oldParent = Parent;
Form form = FindForm();
if (ContainsFocus)
{
@ -742,69 +709,18 @@ namespace WeifenLuo.WinFormsUI @@ -742,69 +709,18 @@ namespace WeifenLuo.WinFormsUI
Activate();
}
internal void TestDrop(DragHandler dragHandler, Point pt)
internal void TestDrop(DragHandler dragHandler)
{
if (DockState == DockState.Document)
DockPanel.TestDrop(dragHandler, pt);
if (dragHandler.DropTarget.DropTo != null)
return;
if (DockHelper.IsDockStateAutoHide(DockState))
return;
if (!dragHandler.IsDockStateValid(DockState))
return;
if (dragHandler.DragSource == DragSource.FloatWindow &&
FloatWindow == dragHandler.DragControl)
return;
if (dragHandler.DragSource == DragSource.Pane &&
dragHandler.DragControl == this)
return;
if (dragHandler.DragSource == DragSource.Content &&
dragHandler.DragControl == this &&
DockState == DockState.Document &&
DisplayingContents.Count == 1)
return;
Point ptMouse = Control.MousePosition;
Point ptClient = PointToClient(pt);
Rectangle rectPane = DisplayingRectangle;
int dragSize = MeasurePane.DragSize;
if (ptClient.Y - rectPane.Top >= 0 && ptClient.Y - rectPane.Top < dragSize)
dragHandler.DropTarget.SetDropTarget(this, DockStyle.Top);
else if (rectPane.Bottom - ptClient.Y >= 0 && rectPane.Bottom - ptClient.Y < dragSize)
dragHandler.DropTarget.SetDropTarget(this, DockStyle.Bottom);
else if (rectPane.Right - ptClient.X >= 0 && rectPane.Right - ptClient.X < dragSize)
dragHandler.DropTarget.SetDropTarget(this, DockStyle.Right);
else if (ptClient.X - rectPane.Left >= 0 && ptClient.X - rectPane.Left < dragSize)
dragHandler.DropTarget.SetDropTarget(this, DockStyle.Left);
else
{
if (rectPane.Height <= TabStripRectangle.Height)
return;
HitTestResult hitTestResult = GetHitTest(pt);
if (hitTestResult.HitArea == HitTestArea.Caption)
dragHandler.DropTarget.SetDropTarget(this, -1);
else if (hitTestResult.HitArea == HitTestArea.TabStrip && hitTestResult.Index != -1)
dragHandler.DropTarget.SetDropTarget(this, hitTestResult.Index);
else if (DockState == DockState.Float && !HasCaption &&
((ptClient.Y - rectPane.Top >= dragSize && ptClient.Y - rectPane.Top < 2 * dragSize) ||
(rectPane.Bottom - ptClient.Y >= dragSize && rectPane.Bottom - ptClient.Y < 2 * dragSize) ||
(rectPane.Right - ptClient.X >= dragSize && rectPane.Right - ptClient.X < 2 * dragSize) ||
(ptClient.X - rectPane.Left >= dragSize && ptClient.X - rectPane.Left < 2 * dragSize)))
dragHandler.DropTarget.SetDropTarget(this, -1);
else
return;
}
if (dragHandler.DropTarget.SameAsOldValue)
return;
dragHandler.DragOutline = GetTestDropOutline(dragHandler.DropTarget.Dock, dragHandler.DropTarget.ContentIndex);
HitTestResult hitTestResult = GetHitTest(ptMouse);
if (hitTestResult.HitArea == HitTestArea.Caption)
dragHandler.DockOutline.Show(this, -1);
else if (hitTestResult.HitArea == HitTestArea.TabStrip && hitTestResult.Index != -1)
dragHandler.DockOutline.Show(this, hitTestResult.Index);
}
internal void ValidateActiveContent()
@ -819,47 +735,28 @@ namespace WeifenLuo.WinFormsUI @@ -819,47 +735,28 @@ namespace WeifenLuo.WinFormsUI
if (DisplayingContents.IndexOf(ActiveContent) >= 0)
return;
DockContent prevVisible = null;
if (ActiveContent.DockState == DockState.Unknown)
{
while(m_visitedTabs.Count > 0)
IDockContent prevVisible = null;
for (int i=Contents.IndexOf(ActiveContent)-1; i>=0; i--)
if (Contents[i].DockHandler.DockState == DockState)
{
prevVisible = m_visitedTabs.Pop();
if (prevVisible != null && !prevVisible.IsDisposed && prevVisible != ActiveContent)
break;
prevVisible = Contents[i];
break;
}
}
IDockContent nextVisible = null;
for (int i=Contents.IndexOf(ActiveContent)+1; i<Contents.Count; i++)
if (Contents[i].DockHandler.DockState == DockState)
{
nextVisible = Contents[i];
break;
}
if (prevVisible != null)
{
ActiveContent = prevVisible;
}
else if (nextVisible != null)
ActiveContent = nextVisible;
else
{
for (int i=Contents.IndexOf(ActiveContent)-1; i>=0; i--)
if (Contents[i].DockState == DockState)
{
prevVisible = Contents[i];
break;
}
DockContent nextVisible = null;
for (int i=Contents.IndexOf(ActiveContent)+1; i<Contents.Count; i++)
if (Contents[i].DockState == DockState)
{
nextVisible = Contents[i];
break;
}
if (prevVisible != null)
ActiveContent = prevVisible;
else if (nextVisible != null)
ActiveContent = nextVisible;
else
ActiveContent = null;
}
ActiveContent = null;
}
private static readonly object DockStateChangedEvent = new object();
@ -987,11 +884,11 @@ namespace WeifenLuo.WinFormsUI @@ -987,11 +884,11 @@ namespace WeifenLuo.WinFormsUI
if (DisplayingContents.Count == 0)
return null;
DockContent firstContent = null;
IDockContent firstContent = null;
for (int i=0; i<DisplayingContents.Count; i++)
{
DockContent content = DisplayingContents[i];
if (content.IsDockStateValid(value))
IDockContent content = DisplayingContents[i];
if (content.DockHandler.IsDockStateValid(value))
{
firstContent = content;
break;
@ -1000,14 +897,16 @@ namespace WeifenLuo.WinFormsUI @@ -1000,14 +897,16 @@ namespace WeifenLuo.WinFormsUI
if (firstContent == null)
return null;
firstContent.DockState = value;
DockPane pane = firstContent.Pane;
firstContent.DockHandler.DockState = value;
DockPane pane = firstContent.DockHandler.Pane;
DockPanel.SuspendLayout(true);
for (int i=0; i<DisplayingContents.Count; i++)
{
DockContent content = DisplayingContents[i];
if (content.IsDockStateValid(value))
content.Pane = pane;
IDockContent content = DisplayingContents[i];
if (content.DockHandler.IsDockStateValid(value))
content.DockHandler.Pane = pane;
}
DockPanel.ResumeLayout(true, true);
return pane;
}
@ -1034,13 +933,24 @@ namespace WeifenLuo.WinFormsUI @@ -1034,13 +933,24 @@ namespace WeifenLuo.WinFormsUI
private void SuspendRefreshStateChange()
{
m_countRefreshStateChange ++;
DockPanel.SuspendLayout(true);
}
private void ResumeRefreshStateChange()
{
m_countRefreshStateChange --;
#if DEBUG
if (m_countRefreshStateChange < 0)
throw new InvalidOperationException();
#endif
if (m_countRefreshStateChange < 0)
m_countRefreshStateChange = 0;
DockPanel.ResumeLayout(true, true);
}
private bool IsRefreshStateChangeSuspended
{
get { return m_countRefreshStateChange != 0; }
}
private void ResumeRefreshStateChange(IDockListContainer oldContainer, DockState oldDockState)
@ -1051,19 +961,22 @@ namespace WeifenLuo.WinFormsUI @@ -1051,19 +961,22 @@ namespace WeifenLuo.WinFormsUI
private void RefreshStateChange(IDockListContainer oldContainer, DockState oldDockState)
{
if (m_countRefreshStateChange != 0)
return;
lock (this)
{
if (IsRefreshStateChangeSuspended)
return;
SuspendRefreshStateChange();
SuspendRefreshStateChange();
}
SetParent();
if (ActiveContent != null)
ActiveContent.SetDockState(ActiveContent.IsHidden, DockState, ActiveContent.Pane);
foreach (DockContent content in Contents)
ActiveContent.DockHandler.SetDockState(ActiveContent.DockHandler.IsHidden, DockState, ActiveContent.DockHandler.Pane);
foreach (IDockContent content in Contents)
{
if (content.Pane == this)
content.SetDockState(content.IsHidden, DockState, content.Pane);
if (content.DockHandler.Pane == this)
content.DockHandler.SetDockState(content.DockHandler.IsHidden, DockState, content.DockHandler.Pane);
}
if (oldContainer != null)
@ -1121,7 +1034,7 @@ namespace WeifenLuo.WinFormsUI @@ -1121,7 +1034,7 @@ namespace WeifenLuo.WinFormsUI
return this;
}
DockContent firstContent = GetFirstContent(container.DockState);
IDockContent firstContent = GetFirstContent(container.DockState);
if (firstContent == null)
return null;
@ -1144,14 +1057,14 @@ namespace WeifenLuo.WinFormsUI @@ -1144,14 +1057,14 @@ namespace WeifenLuo.WinFormsUI
SetVisibleContentsToPane(pane, ActiveContent);
}
private void SetVisibleContentsToPane(DockPane pane, DockContent activeContent)
private void SetVisibleContentsToPane(DockPane pane, IDockContent activeContent)
{
for (int i=0; i<DisplayingContents.Count; i++)
{
DockContent content = DisplayingContents[i];
if (content.IsDockStateValid(pane.DockState))
IDockContent content = DisplayingContents[i];
if (content.DockHandler.IsDockStateValid(pane.DockState))
{
content.Pane = pane;
content.DockHandler.Pane = pane;
i--;
}
}
@ -1199,12 +1112,12 @@ namespace WeifenLuo.WinFormsUI @@ -1199,12 +1112,12 @@ namespace WeifenLuo.WinFormsUI
/// <include file='CodeDoc\DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Method[@name="Float()"]/*'/>
public DockPane Float()
{
DockContent activeContent = ActiveContent;
IDockContent activeContent = ActiveContent;
DockPane floatPane = GetFloatPaneFromContents();
if (floatPane == null)
{
DockContent firstContent = GetFirstContent(DockState.Float);
IDockContent firstContent = GetFirstContent(DockState.Float);
if (firstContent == null)
return null;
floatPane = DockPanel.DockPaneFactory.CreateDockPane(firstContent,DockState.Float, true);
@ -1220,25 +1133,25 @@ namespace WeifenLuo.WinFormsUI @@ -1220,25 +1133,25 @@ namespace WeifenLuo.WinFormsUI
DockPane floatPane = null;
for (int i=0; i<DisplayingContents.Count; i++)
{
DockContent content = DisplayingContents[i];
if (!content.IsDockStateValid(DockState.Float))
IDockContent content = DisplayingContents[i];
if (!content.DockHandler.IsDockStateValid(DockState.Float))
continue;
if (floatPane != null && content.FloatPane != floatPane)
if (floatPane != null && content.DockHandler.FloatPane != floatPane)
return null;
else
floatPane = content.FloatPane;
floatPane = content.DockHandler.FloatPane;
}
return floatPane;
}
private DockContent GetFirstContent(DockState dockState)
private IDockContent GetFirstContent(DockState dockState)
{
for (int i=0; i<DisplayingContents.Count; i++)
{
DockContent content = DisplayingContents[i];
if (content.IsDockStateValid(content.DockState))
IDockContent content = DisplayingContents[i];
if (content.DockHandler.IsDockStateValid(dockState))
return content;
}
return null;
@ -1247,16 +1160,16 @@ namespace WeifenLuo.WinFormsUI @@ -1247,16 +1160,16 @@ namespace WeifenLuo.WinFormsUI
/// <include file='CodeDoc\DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Method[@name="RestoreToPanel()"]/*'/>
public void RestoreToPanel()
{
DockContent activeContent = DockPanel.ActiveContent;
IDockContent activeContent = DockPanel.ActiveContent;
for (int i=DisplayingContents.Count-1; i>=0; i--)
{
DockContent content = DisplayingContents[i];
try { content.IsFloat = false; } catch { }
IDockContent content = DisplayingContents[i];
try { content.DockHandler.IsFloat = false; } catch { }
}
if (activeContent != null)
activeContent.Activate();
activeContent.DockHandler.Activate();
}
private AutoHidePane m_autoHidePane;
@ -1264,5 +1177,20 @@ namespace WeifenLuo.WinFormsUI @@ -1264,5 +1177,20 @@ namespace WeifenLuo.WinFormsUI
{
get { return m_autoHidePane; }
}
/// <exclude />
protected override void WndProc(ref Message m)
{
if (m.Msg == (int)Win32.Msgs.WM_MOUSEACTIVATE)
Activate();
else if (m.Msg == (int)Win32.Msgs.WM_WINDOWPOSCHANGING)
{
int offset = (int)Marshal.OffsetOf(typeof(Win32.WINDOWPOS), "flags");
int flags = Marshal.ReadInt32(m.LParam, offset);
Marshal.WriteInt32(m.LParam, offset, flags | (int)Win32.FlagsSetWindowPos.SWP_NOCOPYBITS);
}
base.WndProc (ref m);
}
}
}

29
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneCaptionBase.cs

@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
using System;
using System.Windows.Forms;
using System.Drawing;
using System.Runtime.InteropServices;
namespace WeifenLuo.WinFormsUI
{
@ -21,10 +22,14 @@ namespace WeifenLuo.WinFormsUI @@ -21,10 +22,14 @@ namespace WeifenLuo.WinFormsUI
{
m_dockPane = pane;
#if FRAMEWORK_VER_2x
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
#else
SetStyle(ControlStyles.DoubleBuffer, true);
#endif
SetStyle(ControlStyles.ResizeRedraw, true);
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
SetStyle(ControlStyles.Selectable, false);
}
@ -56,17 +61,11 @@ namespace WeifenLuo.WinFormsUI @@ -56,17 +61,11 @@ namespace WeifenLuo.WinFormsUI
/// <exclude />
protected override void WndProc(ref Message m)
{
if (m.Msg == (int)Win32.Msgs.WM_MOUSEACTIVATE)
{
DockPane.Activate();
base.WndProc(ref m);
return;
}
else if (m.Msg == (int)Win32.Msgs.WM_LBUTTONDOWN)
if (m.Msg == (int)Win32.Msgs.WM_LBUTTONDOWN)
{
if (DockPane.DockPanel.AllowRedocking && DockPane.AllowRedocking &&
!DockHelper.IsDockStateAutoHide(DockPane.DockState))
DockPane.DockPanel.DragHandler.BeginDragPane(DockPane, ClientRectangle.Location);
DockPane.DockPanel.DragHandler.BeginDragPane(DockPane);
else
base.WndProc(ref m);
return;
@ -81,19 +80,25 @@ namespace WeifenLuo.WinFormsUI @@ -81,19 +80,25 @@ namespace WeifenLuo.WinFormsUI
return;
}
DockContent activeContent = DockPane.DockPanel.ActiveContent;
IDockContent activeContent = DockPane.DockPanel.ActiveContent;
for (int i=0; i<DockPane.Tabs.Count; i++)
{
DockContent content = DockPane.Tabs[i].Content;
IDockContent content = DockPane.Tabs[i].Content;
if (DockPane.IsFloat)
DockPane.RestoreToPanel();
else
DockPane.Float();
if (activeContent != null)
activeContent.Activate();
activeContent.DockHandler.Activate();
}
return;
}
else if (m.Msg == (int)Win32.Msgs.WM_WINDOWPOSCHANGING)
{
int offset = (int)Marshal.OffsetOf(typeof(Win32.WINDOWPOS), "flags");
int flags = Marshal.ReadInt32(m.LParam, offset);
Marshal.WriteInt32(m.LParam, offset, flags | (int)Win32.FlagsSetWindowPos.SWP_NOCOPYBITS);
}
base.WndProc(ref m);
}

24
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneCaptionVS2003.cs

@ -10,10 +10,12 @@ @@ -10,10 +10,12 @@
using System;
using System.Drawing;
using System.Windows.Forms;
using System.ComponentModel;
namespace WeifenLuo.WinFormsUI
{
/// <include file='CodeDoc/DockPaneCaptionVS2003.xml' path='//CodeDoc/Class[@name="DockPaneCaptionVS2003"]/ClassDef/*'/>
[ToolboxItem(false)]
public class DockPaneCaptionVS2003 : DockPaneCaptionBase
{
#region consts
@ -288,10 +290,15 @@ namespace WeifenLuo.WinFormsUI @@ -288,10 +290,15 @@ namespace WeifenLuo.WinFormsUI
Rectangle rectCaptionText = rectCaption;
rectCaptionText.X += TextGapLeft;
rectCaptionText.Width = rectCaption.Width - ButtonGapRight
- ButtonGapLeft
- ButtonGapBetween - 2 * m_buttonClose.Width
- TextGapLeft - TextGapRight;
if (ShouldShowCloseButton && ShouldShowAutoHideButton)
rectCaptionText.Width = rectCaption.Width - ButtonGapRight
- ButtonGapLeft - TextGapLeft - TextGapRight -
(m_buttonAutoHide.Width + ButtonGapBetween + m_buttonClose.Width);
else if (ShouldShowCloseButton || ShouldShowAutoHideButton)
rectCaptionText.Width = rectCaption.Width - ButtonGapRight
- ButtonGapLeft - TextGapLeft - TextGapRight - m_buttonClose.Width;
else
rectCaptionText.Width = rectCaption.Width - TextGapLeft - TextGapRight;
rectCaptionText.Y += TextGapTop;
rectCaptionText.Height -= TextGapTop + TextGapBottom;
using (Brush brush = new SolidBrush(DockPane.IsActivated ? ActiveTextColor : InactiveTextColor))
@ -316,13 +323,18 @@ namespace WeifenLuo.WinFormsUI @@ -316,13 +323,18 @@ namespace WeifenLuo.WinFormsUI
private bool ShouldShowCloseButton
{
get { return (DockPane.ActiveContent != null)? DockPane.ActiveContent.CloseButton : false; }
get { return (DockPane.ActiveContent != null)? DockPane.ActiveContent.DockHandler.CloseButton : false; }
}
private bool ShouldShowAutoHideButton
{
get { return !DockPane.IsFloat; }
}
private void SetButtons()
{
m_buttonClose.Visible = ShouldShowCloseButton;
m_buttonAutoHide.Visible = !DockPane.IsFloat;
m_buttonAutoHide.Visible = ShouldShowAutoHideButton;
m_buttonAutoHide.ImageEnabled = DockPane.IsAutoHide ? ImageAutoHideYes : ImageAutoHideNo;
SetButtonsPosition();

64
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneStripBase.cs

@ -22,6 +22,12 @@ namespace WeifenLuo.WinFormsUI @@ -22,6 +22,12 @@ namespace WeifenLuo.WinFormsUI
{
m_dockPane = pane;
#if FRAMEWORK_VER_2x
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
#else
SetStyle(ControlStyles.DoubleBuffer, true);
#endif
SetStyle(ControlStyles.Selectable, false);
}
@ -38,12 +44,6 @@ namespace WeifenLuo.WinFormsUI @@ -38,12 +44,6 @@ namespace WeifenLuo.WinFormsUI
get { return DockPane.Appearance; }
}
/// <include file='CodeDoc/DockPaneStripBase.xml' path='//CodeDoc/Class[@name="DockPaneStripBase"]/Property[@name="OutlineSize"]/*'/>
protected int OutlineSize
{
get { return MeasureOutline.Width; }
}
/// <include file='CodeDoc/DockPaneStripBase.xml' path='//CodeDoc/Class[@name="DockPaneStripBase"]/Property[@name="Tabs"]/*'/>
protected DockPaneTabCollection Tabs
{
@ -63,8 +63,8 @@ namespace WeifenLuo.WinFormsUI @@ -63,8 +63,8 @@ namespace WeifenLuo.WinFormsUI
/// <include file='CodeDoc/DockPaneStripBase.xml' path='//CodeDoc/Class[@name="DockPaneStripBase"]/Method[@name="MeasureHeight()"]/*'/>
protected internal abstract int MeasureHeight();
/// <include file='CodeDoc/DockPaneStripBase.xml' path='//CodeDoc/Class[@name="DockPaneStripBase"]/Method[@name="EnsureTabVisible(DockContent)"]/*'/>
protected internal abstract void EnsureTabVisible(DockContent content);
/// <include file='CodeDoc/DockPaneStripBase.xml' path='//CodeDoc/Class[@name="DockPaneStripBase"]/Method[@name="EnsureTabVisible(IDockContent)"]/*'/>
protected internal abstract void EnsureTabVisible(IDockContent content);
/// <include file='CodeDoc/DockPaneStripBase.xml' path='//CodeDoc/Class[@name="DockPaneStripBase"]/Method[@name="GetHitTest"]/*'/>
/// <include file='CodeDoc/DockPaneStripBase.xml' path='//CodeDoc/Class[@name="DockPaneStripBase"]/Method[@name="GetHitTest()"]/*'/>
@ -77,7 +77,7 @@ namespace WeifenLuo.WinFormsUI @@ -77,7 +77,7 @@ namespace WeifenLuo.WinFormsUI
protected internal abstract int GetHitTest(Point point);
/// <include file='CodeDoc/DockPaneStripBase.xml' path='//CodeDoc/Class[@name="DockPaneStripBase"]/Method[@name="GetOutlineXorPath(int)"]/*'/>
protected internal abstract GraphicsPath GetOutlineXorPath(int index);
protected internal abstract GraphicsPath GetOutlinePath(int index);
/// <exclude/>
protected override Size DefaultSize
@ -88,46 +88,31 @@ namespace WeifenLuo.WinFormsUI @@ -88,46 +88,31 @@ namespace WeifenLuo.WinFormsUI
/// <exclude/>
protected override void WndProc(ref Message m)
{
if (m.Msg == (int)Win32.Msgs.WM_MOUSEACTIVATE)
{
DockPane.Activate();
base.WndProc(ref m);
return;
}
else if (m.Msg == (int)Win32.Msgs.WM_LBUTTONDOWN)
if (m.Msg == (int)Win32.Msgs.WM_LBUTTONDOWN)
{
int index = GetHitTest();
if (index != -1)
{
DockContent content = Tabs[index].Content;
IDockContent content = Tabs[index].Content;
if (DockPane.ActiveContent != content)
{
DockPane.ActiveContent = content;
DockPane.Activate();
Update();
}
if (DockPane.DockPanel.AllowRedocking && DockPane.AllowRedocking && DockPane.ActiveContent.AllowRedocking)
DockPane.DockPanel.DragHandler.BeginDragContent(DockPane, DockPane.ClientRectangle); //DockPane.DisplayingRectangle);
if (DockPane.DockPanel.AllowRedocking && DockPane.AllowRedocking && DockPane.ActiveContent.DockHandler.AllowRedocking)
DockPane.DockPanel.DragHandler.BeginDragContent(DockPane.ActiveContent);
}
else
base.WndProc(ref m);
return;
}
else if (m.Msg == (int)Win32.Msgs.WM_MBUTTONUP)
{
base.WndProc(ref m);
int index = GetHitTest();
if (index != -1)
{
DockPane.CloseContent(Tabs[index].Content);
}
return;
}
else if (m.Msg == (int)Win32.Msgs.WM_RBUTTONDOWN)
{
int index = GetHitTest();
if (index != -1)
{
DockContent content = Tabs[index].Content;
IDockContent content = Tabs[index].Content;
if (DockPane.ActiveContent != content)
DockPane.ActiveContent = content;
}
@ -139,10 +124,17 @@ namespace WeifenLuo.WinFormsUI @@ -139,10 +124,17 @@ namespace WeifenLuo.WinFormsUI
int index = GetHitTest();
if (index != -1)
{
DockContent content = Tabs[index].Content;
if (content.TabPageContextMenu != null)
content.TabPageContextMenu.Show(this, this.PointToClient(Control.MousePosition));
}
IDockContent content = Tabs[index].Content;
#if FRAMEWORK_VER_2x
if (content.DockHandler.TabPageContextMenuStrip != null)
content.DockHandler.TabPageContextMenuStrip.Show(this, this.PointToClient(Control.MousePosition));
else if (content.DockHandler.TabPageContextMenu != null)
content.DockHandler.TabPageContextMenu.Show(this, this.PointToClient(Control.MousePosition));
#else
if (content.DockHandler.TabPageContextMenu != null)
content.DockHandler.TabPageContextMenu.Show(this, this.PointToClient(Control.MousePosition));
#endif
}
base.WndProc(ref m);
return;
}
@ -153,8 +145,8 @@ namespace WeifenLuo.WinFormsUI @@ -153,8 +145,8 @@ namespace WeifenLuo.WinFormsUI
int index = GetHitTest();
if (DockPane.DockPanel.AllowRedocking && index != -1)
{
DockContent content = Tabs[index].Content;
try { content.IsFloat = !content.IsFloat; }
IDockContent content = Tabs[index].Content;
try { content.DockHandler.IsFloat = !content.DockHandler.IsFloat; }
catch { }
}

196
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneStripVS2003.cs

@ -16,6 +16,7 @@ using System.ComponentModel; @@ -16,6 +16,7 @@ using System.ComponentModel;
namespace WeifenLuo.WinFormsUI
{
/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/ClassDef/*'/>
[ToolboxItem(false)]
public class DockPaneStripVS2003 : DockPaneStripBase
{
#region consts
@ -41,6 +42,9 @@ namespace WeifenLuo.WinFormsUI @@ -41,6 +42,9 @@ namespace WeifenLuo.WinFormsUI
private const int _DocumentTabGapRight = 10;
private const int _DocumentTextExtraHeight = 6;
private const int _DocumentTextExtraWidth = 10;
private const int _DocumentIconGapLeft = 6;
private const int _DocumentIconHeight = 16;
private const int _DocumentIconWidth = 16;
private const string _ResourceImageCloseEnabled = "DockPaneStrip.CloseEnabled.bmp";
private const string _ResourceImageCloseDisabled = "DockPaneStrip.CloseDisabled.bmp";
@ -67,7 +71,14 @@ namespace WeifenLuo.WinFormsUI @@ -67,7 +71,14 @@ namespace WeifenLuo.WinFormsUI
private int OffsetX
{
get { return m_offsetX; }
set { m_offsetX = value; }
set
{
m_offsetX = value;
#if DEBUG
if (m_offsetX > 0)
throw new InvalidOperationException();
#endif
}
}
#region Customizable Properties
@ -340,6 +351,24 @@ namespace WeifenLuo.WinFormsUI @@ -340,6 +351,24 @@ namespace WeifenLuo.WinFormsUI
get { return _DocumentTextExtraWidth; }
}
/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentIconGapLeft"]/*'/>
protected virtual int DocumentIconGapLeft
{
get { return _DocumentIconGapLeft; }
}
/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentIconWidth"]/*'/>
protected virtual int DocumentIconWidth
{
get { return _DocumentIconWidth; }
}
/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="DocumentIconHeight"]/*'/>
protected virtual int DocumentIconHeight
{
get { return _DocumentIconHeight; }
}
/// <include file='CodeDoc/DockPaneStripVS2003.xml' path='//CodeDoc/Class[@name="DockPaneStripVS2003"]/Property[@name="OutlineInnerPen"]/*'/>
protected virtual Pen OutlineInnerPen
{
@ -383,7 +412,6 @@ namespace WeifenLuo.WinFormsUI @@ -383,7 +412,6 @@ namespace WeifenLuo.WinFormsUI
SetStyle(ControlStyles.ResizeRedraw, true);
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
SuspendLayout();
@ -402,11 +430,13 @@ namespace WeifenLuo.WinFormsUI @@ -402,11 +430,13 @@ namespace WeifenLuo.WinFormsUI
m_buttonClose.Click += new EventHandler(Close_Click);
m_buttonScrollLeft.Enabled = false;
m_buttonScrollLeft.RepeatClick = true;
m_buttonScrollLeft.ToolTipText = ToolTipScrollLeft;
m_buttonScrollLeft.Anchor = AnchorStyles.Top | AnchorStyles.Right;
m_buttonScrollLeft.Click += new EventHandler(ScrollLeft_Click);
m_buttonScrollRight.Enabled = false;
m_buttonScrollRight.RepeatClick = true;
m_buttonScrollRight.ToolTipText = ToolTipScrollRight;
m_buttonScrollRight.Anchor = AnchorStyles.Top | AnchorStyles.Right;
m_buttonScrollRight.Click += new EventHandler(ScrollRight_Click);
@ -460,6 +490,7 @@ namespace WeifenLuo.WinFormsUI @@ -460,6 +490,7 @@ namespace WeifenLuo.WinFormsUI
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint (e);
CalculateTabs();
DrawTabStrip(e.Graphics);
}
@ -472,30 +503,43 @@ namespace WeifenLuo.WinFormsUI @@ -472,30 +503,43 @@ namespace WeifenLuo.WinFormsUI
}
/// <exclude />
protected internal override GraphicsPath GetOutlineXorPath(int index)
protected internal override GraphicsPath GetOutlinePath(int index)
{
Rectangle rectXorStrip, rectXorTab, rectXorInnerTab;
rectXorStrip = ClientRectangle;
rectXorStrip = ClientRectangle;
rectXorStrip.Height -= OutlineSize;
if (Appearance == DockPane.AppearanceStyle.ToolWindow)
rectXorStrip.Y += OutlineSize;
Point[] pts = new Point[8];
rectXorTab = GetTabRectangle(index);
rectXorInnerTab = Rectangle.Inflate(rectXorTab, -OutlineSize, -OutlineSize);
rectXorTab.Intersect(rectXorStrip);
rectXorInnerTab.Height += OutlineSize;
if (Appearance == DockPane.AppearanceStyle.ToolWindow)
rectXorInnerTab.Y -= OutlineSize;
if (Appearance == DockPane.AppearanceStyle.Document)
{
Rectangle rectTab = GetTabRectangle(index);
rectTab.Intersect(TabsRectangle);
int y = DockPane.PointToClient(PointToScreen(new Point(0, rectTab.Bottom))).Y;
Rectangle rectPaneClient = DockPane.ClientRectangle;
pts[0] = DockPane.PointToScreen(new Point(rectPaneClient.Left, y));
pts[1] = PointToScreen(new Point(rectTab.Left, rectTab.Bottom));
pts[2] = PointToScreen(new Point(rectTab.Left, rectTab.Top));
pts[3] = PointToScreen(new Point(rectTab.Right, rectTab.Top));
pts[4] = PointToScreen(new Point(rectTab.Right, rectTab.Bottom));
pts[5] = DockPane.PointToScreen(new Point(rectPaneClient.Right, y));
pts[6] = DockPane.PointToScreen(new Point(rectPaneClient.Right, rectPaneClient.Bottom));
pts[7] = DockPane.PointToScreen(new Point(rectPaneClient.Left, rectPaneClient.Bottom));
}
else
{
Rectangle rectTab = GetTabRectangle(index);
rectTab.Intersect(TabsRectangle);
int y = DockPane.PointToClient(PointToScreen(new Point(0, rectTab.Top))).Y;
Rectangle rectPaneClient = DockPane.ClientRectangle;
pts[0] = DockPane.PointToScreen(new Point(rectPaneClient.Left, rectPaneClient.Top));
pts[1] = DockPane.PointToScreen(new Point(rectPaneClient.Right, rectPaneClient.Top));
pts[2] = DockPane.PointToScreen(new Point(rectPaneClient.Right, y));
pts[3] = PointToScreen(new Point(rectTab.Right, rectTab.Top));
pts[4] = PointToScreen(new Point(rectTab.Right, rectTab.Bottom));
pts[5] = PointToScreen(new Point(rectTab.Left, rectTab.Bottom));
pts[6] = PointToScreen(new Point(rectTab.Left, rectTab.Top));
pts[7] = DockPane.PointToScreen(new Point(rectPaneClient.Left, y));
}
rectXorStrip.Location = PointToScreen(rectXorStrip.Location);
rectXorTab.Location = PointToScreen(rectXorTab.Location);
rectXorInnerTab.Location = PointToScreen(rectXorInnerTab.Location);
GraphicsPath path = new GraphicsPath();
path.AddRectangle(rectXorStrip);
path.AddRectangle(rectXorTab);
path.AddRectangle(rectXorInnerTab);
path.AddLines(pts);
return path;
}
@ -580,22 +624,28 @@ namespace WeifenLuo.WinFormsUI @@ -580,22 +624,28 @@ namespace WeifenLuo.WinFormsUI
private void CalculateTabs_Document()
{
int countTabs = Tabs.Count;
if (countTabs == 0)
return;
Rectangle rectTabStrip = TabsRectangle;
Rectangle rectTabStrip = ClientRectangle;
int x = rectTabStrip.X + DocumentTabGapLeft + OffsetX;
int totalWidth = 0;
foreach (DockPaneTabVS2003 tab in Tabs)
{
tab.TabX = x;
tab.TabWidth = Math.Min(GetTabOriginalWidth(Tabs.IndexOf(tab)), DocumentTabMaxWidth);
totalWidth += tab.TabWidth;
}
if (totalWidth + OffsetX < rectTabStrip.Width && OffsetX < 0)
OffsetX = Math.Min(0, rectTabStrip.Width - totalWidth);
int x = rectTabStrip.X + OffsetX;
foreach (DockPaneTabVS2003 tab in Tabs)
{
tab.TabX = x;
x += tab.TabWidth;
}
}
/// <exclude />
protected internal override void EnsureTabVisible(DockContent content)
protected internal override void EnsureTabVisible(IDockContent content)
{
if (Appearance != DockPane.AppearanceStyle.Document || !Tabs.Contains(content))
return;
@ -625,10 +675,10 @@ namespace WeifenLuo.WinFormsUI @@ -625,10 +675,10 @@ namespace WeifenLuo.WinFormsUI
private int GetTabOriginalWidth_ToolWindow(int index)
{
DockContent content = Tabs[index].Content;
IDockContent content = Tabs[index].Content;
using (Graphics g = CreateGraphics())
{
SizeF sizeString = g.MeasureString(content.TabText, Font);
SizeF sizeString = g.MeasureString(content.DockHandler.TabText, Font);
return ToolWindowImageWidth + (int)sizeString.Width + 1 + ToolWindowImageGapLeft
+ ToolWindowImageGapRight + ToolWindowTextGapRight;
}
@ -636,7 +686,7 @@ namespace WeifenLuo.WinFormsUI @@ -636,7 +686,7 @@ namespace WeifenLuo.WinFormsUI
private int GetTabOriginalWidth_Document(int index)
{
DockContent content = Tabs[index].Content;
IDockContent content = Tabs[index].Content;
using (Graphics g = CreateGraphics())
{
@ -645,13 +695,16 @@ namespace WeifenLuo.WinFormsUI @@ -645,13 +695,16 @@ namespace WeifenLuo.WinFormsUI
{
using (Font boldFont = new Font(this.Font, FontStyle.Bold))
{
sizeText = g.MeasureString(content.Text, boldFont, DocumentTabMaxWidth, DocumentTextStringFormat);
sizeText = g.MeasureString(content.DockHandler.TabText, boldFont, DocumentTabMaxWidth, DocumentTextStringFormat);
}
}
else
sizeText = g.MeasureString(content.Text, Font, DocumentTabMaxWidth, DocumentTextStringFormat);
sizeText = g.MeasureString(content.DockHandler.TabText, Font, DocumentTabMaxWidth, DocumentTextStringFormat);
return (int)sizeText.Width + 1 + DocumentTextExtraWidth;
if (DockPane.DockPanel.ShowDocumentIcon)
return (int)sizeText.Width + 1 + DocumentTextExtraWidth + DocumentIconWidth + DocumentIconGapLeft;
else
return (int)sizeText.Width + 1 + DocumentTextExtraWidth;
}
}
@ -680,7 +733,7 @@ namespace WeifenLuo.WinFormsUI @@ -680,7 +733,7 @@ namespace WeifenLuo.WinFormsUI
// Draw the tabs
Rectangle rectTabOnly = TabsRectangle;
Rectangle rectTab = Rectangle.Empty;
g.SetClip(rectTabOnly, CombineMode.Replace);
g.SetClip(rectTabOnly);
for (int i=0; i<count; i++)
{
rectTab = GetTabRectangle(i);
@ -724,19 +777,19 @@ namespace WeifenLuo.WinFormsUI @@ -724,19 +777,19 @@ namespace WeifenLuo.WinFormsUI
return new Rectangle(tab.TabX, rectTabStrip.Y + DocumentTabGapTop, tab.TabWidth, rectTabStrip.Height - DocumentTabGapTop);
}
private void DrawTab(Graphics g, DockContent content, Rectangle rect)
private void DrawTab(Graphics g, IDockContent content, Rectangle rect)
{
OnBeginDrawTab(content.DockPaneTab);
OnBeginDrawTab(content.DockHandler.DockPaneTab);
if (Appearance == DockPane.AppearanceStyle.ToolWindow)
DrawTab_ToolWindow(g, content, rect);
else
DrawTab_Document(g, content, rect);
OnEndDrawTab(content.DockPaneTab);
OnEndDrawTab(content.DockHandler.DockPaneTab);
}
private void DrawTab_ToolWindow(Graphics g, DockContent content, Rectangle rect)
private void DrawTab_ToolWindow(Graphics g, IDockContent content, Rectangle rect)
{
Rectangle rectIcon = new Rectangle(
rect.X + ToolWindowImageGapLeft,
@ -756,7 +809,7 @@ namespace WeifenLuo.WinFormsUI @@ -756,7 +809,7 @@ namespace WeifenLuo.WinFormsUI
rect.X, rect.Y + rect.Height - 1, rect.X + rect.Width - 1, rect.Y + rect.Height - 1);
g.DrawLine(OutlineInnerPen,
rect.X + rect.Width - 1, rect.Y, rect.X + rect.Width - 1, rect.Y + rect.Height - 1);
g.DrawString(content.TabText, Font, ActiveTextBrush, rectText, ToolWindowTextStringFormat);
g.DrawString(content.DockHandler.TabText, Font, ActiveTextBrush, rectText, ToolWindowTextStringFormat);
}
else
{
@ -766,18 +819,26 @@ namespace WeifenLuo.WinFormsUI @@ -766,18 +819,26 @@ namespace WeifenLuo.WinFormsUI
rect.Y + ToolWindowTabSeperatorGapTop,
rect.X + rect.Width - 1,
rect.Y + rect.Height - 1 - ToolWindowTabSeperatorGapBottom);
g.DrawString(content.TabText, Font, InactiveTextBrush, rectText, ToolWindowTextStringFormat);
g.DrawString(content.DockHandler.TabText, Font, InactiveTextBrush, rectText, ToolWindowTextStringFormat);
}
if (rect.Contains(rectIcon))
g.DrawIcon(content.Icon, rectIcon);
g.DrawIcon(content.DockHandler.Icon, rectIcon);
}
private void DrawTab_Document(Graphics g, DockContent content, Rectangle rect)
private void DrawTab_Document(Graphics g, IDockContent content, Rectangle rect)
{
Rectangle rectText = rect;
rectText.X += DocumentTextExtraWidth / 2;
rectText.Width -= DocumentTextExtraWidth;
if (DockPane.DockPanel.ShowDocumentIcon)
{
rectText.X += DocumentTextExtraWidth / 2 + DocumentIconWidth + DocumentIconGapLeft;
rectText.Width -= DocumentTextExtraWidth + DocumentIconWidth + DocumentIconGapLeft;
}
else
{
rectText.X += DocumentTextExtraWidth / 2;
rectText.Width -= DocumentTextExtraWidth;
}
if (DockPane.ActiveContent == content)
{
g.FillRectangle(ActiveBackBrush, rect);
@ -786,15 +847,27 @@ namespace WeifenLuo.WinFormsUI @@ -786,15 +847,27 @@ namespace WeifenLuo.WinFormsUI
g.DrawLine(OutlineInnerPen,
rect.X + rect.Width - 1, rect.Y,
rect.X + rect.Width - 1, rect.Y + rect.Height - 1);
if (DockPane.DockPanel.ShowDocumentIcon)
{
Icon icon = (content as Form).Icon;
Rectangle rectIcon = new Rectangle(
rect.X + DocumentIconGapLeft,
rect.Y + (rect.Height - DocumentIconHeight) / 2,
DocumentIconWidth, DocumentIconHeight);
g.DrawIcon((content as Form).Icon, rectIcon);
}
if (DockPane.IsActiveDocumentPane)
{
using (Font boldFont = new Font(this.Font, FontStyle.Bold))
{
g.DrawString(content.Text, boldFont, ActiveTextBrush, rectText, DocumentTextStringFormat);
g.DrawString(content.DockHandler.TabText, boldFont, ActiveTextBrush, rectText, DocumentTextStringFormat);
}
}
else
g.DrawString(content.Text, Font, InactiveTextBrush, rectText, DocumentTextStringFormat);
g.DrawString(content.DockHandler.TabText, Font, InactiveTextBrush, rectText, DocumentTextStringFormat);
}
else
{
@ -803,7 +876,18 @@ namespace WeifenLuo.WinFormsUI @@ -803,7 +876,18 @@ namespace WeifenLuo.WinFormsUI
rect.X + rect.Width - 1, rect.Y,
rect.X + rect.Width - 1, rect.Y + rect.Height - 1 - DocumentTabGapTop);
g.DrawString(content.Text, Font, InactiveTextBrush, rectText, DocumentTextStringFormat);
if (DockPane.DockPanel.ShowDocumentIcon)
{
Icon icon = (content as Form).Icon;
Rectangle rectIcon = new Rectangle(
rect.X + DocumentIconGapLeft,
rect.Y + (rect.Height - DocumentIconHeight) / 2,
DocumentIconWidth, DocumentIconHeight);
g.DrawIcon((content as Form).Icon, rectIcon);
}
g.DrawString(content.DockHandler.TabText, Font, InactiveTextBrush, rectText, DocumentTextStringFormat);
}
}
@ -838,10 +922,10 @@ namespace WeifenLuo.WinFormsUI @@ -838,10 +922,10 @@ namespace WeifenLuo.WinFormsUI
Rectangle rectTabStrip = TabsRectangle;
int index;
for (index=0; index<Tabs.Count - 1; index++)
for (index=0; index<Tabs.Count; index++)
if (GetTabRectangle(index).IntersectsWith(rectTabStrip))
break;
Rectangle rectTab = GetTabRectangle(index);
if (rectTab.Left < rectTabStrip.Left)
OffsetX += rectTabStrip.Left - rectTab.Left;
@ -897,7 +981,7 @@ namespace WeifenLuo.WinFormsUI @@ -897,7 +981,7 @@ namespace WeifenLuo.WinFormsUI
m_buttonClose.Visible = false;
else
{
bool showCloseButton = DockPane.ActiveContent == null ? true : DockPane.ActiveContent.CloseButton;
bool showCloseButton = DockPane.ActiveContent == null ? true : DockPane.ActiveContent.DockHandler.CloseButton;
if (m_buttonClose.Visible != showCloseButton)
{
m_buttonClose.Visible = showCloseButton;
@ -927,7 +1011,7 @@ namespace WeifenLuo.WinFormsUI @@ -927,7 +1011,7 @@ namespace WeifenLuo.WinFormsUI
int y = rectTabStrip.Y + DocumentButtonGapTop;
m_buttonClose.Location = new Point(x, y);
Point point = m_buttonClose.Location;
bool showCloseButton = DockPane.ActiveContent == null ? true : DockPane.ActiveContent.CloseButton;
bool showCloseButton = DockPane.ActiveContent == null ? true : DockPane.ActiveContent.DockHandler.CloseButton;
if (showCloseButton)
point.Offset(-(DocumentButtonGapBetween + buttonWidth), 0);
m_buttonScrollRight.Location = point;
@ -970,10 +1054,10 @@ namespace WeifenLuo.WinFormsUI @@ -970,10 +1054,10 @@ namespace WeifenLuo.WinFormsUI
if (index != -1)
{
Rectangle rectTab = GetTabRectangle(index);
if (Tabs[index].Content.ToolTipText != null)
toolTip = Tabs[index].Content.ToolTipText;
if (Tabs[index].Content.DockHandler.ToolTipText != null)
toolTip = Tabs[index].Content.DockHandler.ToolTipText;
else if (rectTab.Width < GetTabOriginalWidth(index))
toolTip = Tabs[index].Content.TabText;
toolTip = Tabs[index].Content.DockHandler.TabText;
}
if (m_toolTip.GetToolTip(this) != toolTip)

8
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneTab.cs

@ -15,10 +15,10 @@ namespace WeifenLuo.WinFormsUI @@ -15,10 +15,10 @@ namespace WeifenLuo.WinFormsUI
/// <include file='CodeDoc/DockPaneTab.xml' path='//CodeDoc/Class[@name="DockPaneTab"]/ClassDef/*'/>
public class DockPaneTab : IDisposable
{
private DockContent m_content;
private IDockContent m_content;
/// <include file='CodeDoc/DockPaneTab.xml' path='//CodeDoc/Class[@name="DockPaneTab"]/Construct[@name="(DockContent)"]/*'/>
public DockPaneTab(DockContent content)
/// <include file='CodeDoc/DockPaneTab.xml' path='//CodeDoc/Class[@name="DockPaneTab"]/Construct[@name="(IDockContent)"]/*'/>
public DockPaneTab(IDockContent content)
{
m_content = content;
}
@ -30,7 +30,7 @@ namespace WeifenLuo.WinFormsUI @@ -30,7 +30,7 @@ namespace WeifenLuo.WinFormsUI
}
/// <include file='CodeDoc/DockPaneTab.xml' path='//CodeDoc/Class[@name="DockPaneTab"]/Property[@name="Content"]/*'/>
public DockContent Content
public IDockContent Content
{
get { return m_content; }
}

12
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneTabCollection.cs

@ -76,10 +76,10 @@ namespace WeifenLuo.WinFormsUI @@ -76,10 +76,10 @@ namespace WeifenLuo.WinFormsUI
{
get
{
DockContent content = DockPane.DisplayingContents[index];
IDockContent content = DockPane.DisplayingContents[index];
if (content == null)
throw(new IndexOutOfRangeException());
return content.DockPaneTab;
return content.DockHandler.DockPaneTab;
}
}
@ -90,8 +90,8 @@ namespace WeifenLuo.WinFormsUI @@ -90,8 +90,8 @@ namespace WeifenLuo.WinFormsUI
return (IndexOf(tab) != -1);
}
/// <include file='CodeDoc\DockPaneTabCollection.xml' path='//CodeDoc/Class[@name="DockPaneTabCollection"]/Method[@name="Contains(DockContent)"]/*'/>>
public bool Contains(DockContent content)
/// <include file='CodeDoc\DockPaneTabCollection.xml' path='//CodeDoc/Class[@name="DockPaneTabCollection"]/Method[@name="Contains(IDockContent)"]/*'/>>
public bool Contains(IDockContent content)
{
return (IndexOf(content) != -1);
}
@ -103,8 +103,8 @@ namespace WeifenLuo.WinFormsUI @@ -103,8 +103,8 @@ namespace WeifenLuo.WinFormsUI
return DockPane.DisplayingContents.IndexOf(tab.Content);
}
/// <include file='CodeDoc\DockPaneTabCollection.xml' path='//CodeDoc/Class[@name="DockPaneTabCollection"]/Method[@name="IndexOf(DockContent)"]/*'/>>
public int IndexOf(DockContent content)
/// <include file='CodeDoc\DockPaneTabCollection.xml' path='//CodeDoc/Class[@name="DockPaneTabCollection"]/Method[@name="IndexOf(IDockContent)"]/*'/>>
public int IndexOf(IDockContent content)
{
return DockPane.DisplayingContents.IndexOf(content);
}

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

@ -14,7 +14,7 @@ namespace WeifenLuo.WinFormsUI @@ -14,7 +14,7 @@ namespace WeifenLuo.WinFormsUI
{
internal class DockPaneTabVS2003 : DockPaneTab
{
internal DockPaneTabVS2003(DockContent content) : base(content)
internal DockPaneTabVS2003(IDockContent content) : base(content)
{
}

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

@ -20,13 +20,14 @@ using System.Text; @@ -20,13 +20,14 @@ using System.Text;
namespace WeifenLuo.WinFormsUI
{
/// <include file='CodeDoc\DockPanel.xml' path='//CodeDoc/Delegate[@name="DeserializeDockContent"]/*'/>
public delegate DockContent DeserializeDockContent(string persistString);
public delegate IDockContent DeserializeDockContent(string persistString);
/// <include file='CodeDoc\DockPanel.xml' path='//CodeDoc/Class[@name="DockPanel"]/ClassDef/*'/>
[Designer(typeof(System.Windows.Forms.Design.ControlDesigner))]
[ToolboxBitmap(typeof(DockPanel), "Resources.DockPanel.bmp")]
public class DockPanel : Panel
{
const int WM_REFRESHACTIVEWINDOW = (int)Win32.Msgs.WM_USER + 1;
private const int WM_REFRESHACTIVEWINDOW = (int)Win32.Msgs.WM_USER + 1;
private LocalWindowsHook m_localWindowsHook;
@ -40,8 +41,7 @@ namespace WeifenLuo.WinFormsUI @@ -40,8 +41,7 @@ namespace WeifenLuo.WinFormsUI
SetStyle(ControlStyles.ResizeRedraw |
ControlStyles.UserPaint |
ControlStyles.AllPaintingInWmPaint |
ControlStyles.OptimizedDoubleBuffer, true);
ControlStyles.AllPaintingInWmPaint, true);
SuspendLayout();
Font = SystemInformation.MenuFont;
@ -49,13 +49,15 @@ namespace WeifenLuo.WinFormsUI @@ -49,13 +49,15 @@ namespace WeifenLuo.WinFormsUI
m_autoHideWindow = new AutoHideWindow(this);
m_autoHideWindow.Visible = false;
m_dummyControl = new DummyControl();
m_dummyControl.Bounds = Rectangle.Empty;
if (Environment.Version.Major == 1)
{
m_dummyControl = new DummyControl();
m_dummyControl.Bounds = Rectangle.Empty;
Controls.Add(m_dummyControl);
}
m_dockWindows = new DockWindowCollection(this);
Controls.AddRange(new Control[] {
m_autoHideWindow,
m_dummyControl,
DockWindows[DockState.Document],
DockWindows[DockState.DockLeft],
DockWindows[DockState.DockRight],
@ -85,6 +87,54 @@ namespace WeifenLuo.WinFormsUI @@ -85,6 +87,54 @@ namespace WeifenLuo.WinFormsUI
}
}
private MdiClientController m_mdiClientController = null;
private MdiClientController MdiClientController
{
get
{
if (m_mdiClientController == null)
{
m_mdiClientController = new MdiClientController();
m_mdiClientController.HandleAssigned += new EventHandler(MdiClientHandleAssigned);
m_mdiClientController.MdiChildActivate += new EventHandler(ParentFormMdiChildActivate);
m_mdiClientController.Layout += new LayoutEventHandler(MdiClient_Layout);
}
return m_mdiClientController;
}
}
private void MdiClientHandleAssigned(object sender, EventArgs e)
{
SetMdiClient();
PerformLayout();
}
private void MdiClient_Layout(object sender, LayoutEventArgs e)
{
if (DocumentStyle != DocumentStyles.DockingMdi)
return;
foreach (DockPane pane in Panes)
if (pane.DockState == DockState.Document)
pane.SetContentBounds();
UpdateWindowRegion();
}
private void ParentFormMdiChildActivate(object sender, EventArgs e)
{
if (MdiClientController.ParentForm == null)
return;
IDockContent content = MdiClientController.ParentForm.ActiveMdiChild as IDockContent;
if (content == null)
return;
if (content.DockHandler.DockPanel == this && content.DockHandler.Pane != null)
content.DockHandler.Pane.ActiveContent = content;
}
private bool m_inRefreshingActiveWindow = false;
internal bool InRefreshingActiveWindow
{
@ -98,16 +148,16 @@ namespace WeifenLuo.WinFormsUI @@ -98,16 +148,16 @@ namespace WeifenLuo.WinFormsUI
if (InRefreshingActiveWindow)
return;
Win32.CWPRETSTRUCT cwpret = (Win32.CWPRETSTRUCT)Marshal.PtrToStructure(e.lParam, typeof(Win32.CWPRETSTRUCT));
int msg = cwpret.message;
if (msg == (int)Win32.Msgs.WM_KILLFOCUS)
Win32.Msgs msg = (Win32.Msgs)Marshal.ReadInt32(e.lParam, IntPtr.Size * 3);
if (msg == Win32.Msgs.WM_KILLFOCUS)
{
DockPane pane = GetPaneFromHandle((IntPtr)cwpret.wParam);
IntPtr wParam = Marshal.ReadIntPtr(e.lParam, IntPtr.Size * 2);
DockPane pane = GetPaneFromHandle(wParam);
if (pane == null)
User32.PostMessage(this.Handle, WM_REFRESHACTIVEWINDOW, 0, 0);
}
else if (msg == (int)Win32.Msgs.WM_SETFOCUS)
else if (msg == Win32.Msgs.WM_SETFOCUS)
User32.PostMessage(this.Handle, WM_REFRESHACTIVEWINDOW, 0, 0);
}
@ -115,55 +165,58 @@ namespace WeifenLuo.WinFormsUI @@ -115,55 +165,58 @@ namespace WeifenLuo.WinFormsUI
/// <exclude/>
protected override void Dispose(bool disposing)
{
if (!m_disposed)
lock (this)
{
try
if (!m_disposed && disposing)
{
if (disposing)
m_localWindowsHook.Uninstall();
if (m_mdiClientController != null)
{
FloatWindows.Dispose();
Panes.Dispose();
DummyContent.Dispose();
m_mdiClientController.HandleAssigned -= new EventHandler(MdiClientHandleAssigned);
m_mdiClientController.MdiChildActivate -= new EventHandler(ParentFormMdiChildActivate);
m_mdiClientController.Layout -= new LayoutEventHandler(MdiClient_Layout);
m_mdiClientController.Dispose();
}
m_localWindowsHook.Uninstall();
FloatWindows.Dispose();
Panes.Dispose();
DummyContent.Dispose();
m_disposed = true;
}
finally
{
base.Dispose(disposing);
}
base.Dispose(disposing);
}
}
/// <include file='CodeDoc\DockPanel.xml' path='//CodeDoc/Class[@name="DockPanel"]/Property[@name="ActiveAutoHideContent"]/*' />
[Browsable(false)]
public DockContent ActiveAutoHideContent
public IDockContent ActiveAutoHideContent
{
get { return AutoHideWindow.ActiveContent; }
set { AutoHideWindow.ActiveContent = value; }
}
private DockContent m_activeContent = null;
private IDockContent m_activeContent = null;
/// <include file='CodeDoc\DockPanel.xml' path='//CodeDoc/Class[@name="DockPanel"]/Property[@name="ActiveContent"]/*' />
[Browsable(false)]
public DockContent ActiveContent
public IDockContent ActiveContent
{
get { return m_activeContent; }
}
internal void SetActiveContent()
{
DockContent value = ActivePane == null ? null : ActivePane.ActiveContent;
IDockContent value = ActivePane == null ? null : ActivePane.ActiveContent;
if (m_activeContent == value)
return;
if (m_activeContent != null)
m_activeContent.SetIsActivated(false);
m_activeContent.DockHandler.SetIsActivated(false);
m_activeContent = value;
if (m_activeContent != null)
m_activeContent.SetIsActivated(true);
m_activeContent.DockHandler.SetIsActivated(true);
OnActiveContentChanged(EventArgs.Empty);
}
@ -192,9 +245,18 @@ namespace WeifenLuo.WinFormsUI @@ -192,9 +245,18 @@ namespace WeifenLuo.WinFormsUI
private DockPane GetPaneFromHandle(IntPtr hWnd)
{
Control control = Control.FromChildHandle(hWnd);
IDockContent content = null;
DockPane pane = null;
for (; control != null; control = control.Parent)
{
content = control as IDockContent;
if (content != null)
content.DockHandler.ActiveWindowHandle = hWnd;
if (content != null && content.DockHandler.DockPanel == this)
return content.DockHandler.Pane;
pane = control as DockPane;
if (pane != null && pane.DockPanel == this)
break;
@ -203,28 +265,21 @@ namespace WeifenLuo.WinFormsUI @@ -203,28 +265,21 @@ namespace WeifenLuo.WinFormsUI
return pane;
}
private DockContent m_activeDocument = null;
private IDockContent m_activeDocument = null;
/// <include file='CodeDoc\DockPanel.xml' path='//CodeDoc/Class[@name="DockPanel"]/Property[@name="ActiveDocument"]/*' />
[Browsable(false)]
public DockContent ActiveDocument
public IDockContent ActiveDocument
{
get { return m_activeDocument; }
}
private void SetActiveDocument()
{
DockContent value = ActiveDocumentPane == null ? null : ActiveDocumentPane.ActiveContent;
IDockContent value = ActiveDocumentPane == null ? null : ActiveDocumentPane.ActiveContent;
if (m_activeDocument == value)
return;
m_activeDocument = value;
if (m_activeDocument != null)
if (m_activeDocument.HiddenMdiChild != null)
{
IntPtr hWnd = User32.GetFocus();
m_activeDocument.HiddenMdiChild.Activate();
User32.SetFocus(hWnd);
}
OnActiveDocumentChanged(EventArgs.Empty);
}
@ -296,6 +351,24 @@ namespace WeifenLuo.WinFormsUI @@ -296,6 +351,24 @@ namespace WeifenLuo.WinFormsUI
get { return m_dummyContent; }
}
private bool m_showDocumentIcon = false;
/// <include file='CodeDoc\DockPanel.xml' path='//CodeDoc/Class[@name="DockPanel"]/Property[@name="ShowDocumentIcon"]/*' />
[DefaultValue(false)]
[LocalizedCategory("Category.Docking")]
[LocalizedDescription("DockPanel.ShowDocumentIcon.Description")]
public bool ShowDocumentIcon
{
get { return m_showDocumentIcon; }
set
{
if (m_showDocumentIcon == value)
return;
m_showDocumentIcon = value;
Refresh();
}
}
private DockPanelExtender m_extender;
/// <include file='CodeDoc\DockPanel.xml' path='//CodeDoc/Class[@name="DockPanel"]/Property[@name="Extender"]/*' />
[Browsable(false)]
@ -472,7 +545,7 @@ namespace WeifenLuo.WinFormsUI @@ -472,7 +545,7 @@ namespace WeifenLuo.WinFormsUI
/// <include file='CodeDoc\DockPanel.xml' path='//CodeDoc/Class[@name="DockPanel"]/Property[@name="Documents"]/*' />
[Browsable(false)]
public DockContent[] Documents
public IDockContent[] Documents
{
get { return Contents.Select(DockAreas.Document); }
}
@ -507,7 +580,7 @@ namespace WeifenLuo.WinFormsUI @@ -507,7 +580,7 @@ namespace WeifenLuo.WinFormsUI
get { return m_dragHandler; }
}
private Control m_dummyControl;
private Control m_dummyControl = null;
internal Control DummyControl
{
get { return m_dummyControl; }
@ -521,45 +594,53 @@ namespace WeifenLuo.WinFormsUI @@ -521,45 +594,53 @@ namespace WeifenLuo.WinFormsUI
get { return m_floatWindows; }
}
private bool m_mdiIntegration = true;
/// <include file='CodeDoc\DockPanel.xml' path='//CodeDoc/Class[@name="DockPanel"]/Property[@name="MdiIntegration"]/*' />
private DocumentStyles m_documentStyle = DocumentStyles.DockingMdi;
/// <include file='CodeDoc\DockPanel.xml' path='//CodeDoc/Class[@name="DockPanel"]/Property[@name="DocumentStyle"]/*' />
[LocalizedCategory("Category.Docking")]
[LocalizedDescription("DockPanel.MdiIntegration.Description")]
[DefaultValue(true)]
public bool MdiIntegration
[LocalizedDescription("DockPanel.DocumentStyle.Description")]
[DefaultValue(DocumentStyles.DockingMdi)]
public DocumentStyles DocumentStyle
{
get { return m_mdiIntegration; }
get { return m_documentStyle; }
set
{
if (value == m_mdiIntegration)
if (value == m_documentStyle)
return;
m_mdiIntegration = value;
RefreshMdiIntegration();
}
}
if (!Enum.IsDefined(typeof(DocumentStyles), value))
throw new InvalidEnumArgumentException();
private bool m_sdiDocument = false;
/// <include file='CodeDoc\DockPanel.xml' path='//CodeDoc/Class[@name="DockPanel"]/Property[@name="SdiDocument"]/*' />
[LocalizedCategory("Category.Docking")]
[LocalizedDescription("DockPanel.SdiDocument.Description")]
[DefaultValue(false)]
public bool SdiDocument
{
get { return m_sdiDocument; }
set
{
if (value == m_sdiDocument)
return;
if (value == DocumentStyles.SystemMdi && DockWindows[DockState.Document].DisplayingList.Count > 0)
throw new InvalidEnumArgumentException();
m_sdiDocument = value;
Refresh();
m_documentStyle = value;
SuspendLayout(true);
SetMdiClient();
UpdateWindowRegion();
foreach (IDockContent content in Contents)
{
if (content.DockHandler.DockState == DockState.Document)
{
content.DockHandler.SetPane(content.DockHandler.Pane);
content.DockHandler.SetVisible();
}
}
if (MdiClientController.MdiClient != null)
MdiClientController.MdiClient.PerformLayout();
ResumeLayout(true, true);
}
}
/// <exclude/>
protected override void OnLayout(LayoutEventArgs levent)
{
SuspendLayout(true);
AutoHideStripControl.Bounds = ClientRectangle;
CalculateDockPadding();
@ -591,6 +672,17 @@ namespace WeifenLuo.WinFormsUI @@ -591,6 +672,17 @@ namespace WeifenLuo.WinFormsUI
AutoHideWindow.BringToFront();
base.OnLayout(levent);
if (DocumentStyle == DocumentStyles.SystemMdi && MdiClientController.MdiClient != null)
{
MdiClientController.MdiClient.Bounds = SystemMdiClientBounds;
UpdateWindowRegion();
}
if (Parent != null)
Parent.ResumeLayout();
ResumeLayout(true, true);
}
internal Rectangle GetTabStripRectangle(DockState dockState)
@ -607,7 +699,7 @@ namespace WeifenLuo.WinFormsUI @@ -607,7 +699,7 @@ namespace WeifenLuo.WinFormsUI
g.FillRectangle(SystemBrushes.AppWorkspace, ClientRectangle);
}
internal void AddContent(DockContent content)
internal void AddContent(IDockContent content)
{
if (content == null)
throw(new ArgumentNullException());
@ -660,10 +752,13 @@ namespace WeifenLuo.WinFormsUI @@ -660,10 +752,13 @@ namespace WeifenLuo.WinFormsUI
if (ActiveAutoHideContent == null)
return Rectangle.Empty;
if (Parent == null)
return Rectangle.Empty;
Rectangle rect = Rectangle.Empty;
if (state == DockState.DockLeftAutoHide)
{
int autoHideSize = (int)(rectDockArea.Width * ActiveAutoHideContent.AutoHidePortion);
int autoHideSize = (int)(rectDockArea.Width * ActiveAutoHideContent.DockHandler.AutoHidePortion);
rect.X = rectDockArea.X;
rect.Y = rectDockArea.Y;
rect.Width = autoHideSize;
@ -671,7 +766,7 @@ namespace WeifenLuo.WinFormsUI @@ -671,7 +766,7 @@ namespace WeifenLuo.WinFormsUI
}
else if (state == DockState.DockRightAutoHide)
{
int autoHideSize = (int)(rectDockArea.Width * ActiveAutoHideContent.AutoHidePortion);
int autoHideSize = (int)(rectDockArea.Width * ActiveAutoHideContent.DockHandler.AutoHidePortion);
rect.X = rectDockArea.X + rectDockArea.Width - autoHideSize;
rect.Y = rectDockArea.Y;
rect.Width = autoHideSize;
@ -679,7 +774,7 @@ namespace WeifenLuo.WinFormsUI @@ -679,7 +774,7 @@ namespace WeifenLuo.WinFormsUI
}
else if (state == DockState.DockTopAutoHide)
{
int autoHideSize = (int)(rectDockArea.Height * ActiveAutoHideContent.AutoHidePortion);
int autoHideSize = (int)(rectDockArea.Height * ActiveAutoHideContent.DockHandler.AutoHidePortion);
rect.X = rectDockArea.X;
rect.Y = rectDockArea.Y;
rect.Width = rectDockArea.Width;
@ -687,14 +782,17 @@ namespace WeifenLuo.WinFormsUI @@ -687,14 +782,17 @@ namespace WeifenLuo.WinFormsUI
}
else if (state == DockState.DockBottomAutoHide)
{
int autoHideSize = (int)(rectDockArea.Height * ActiveAutoHideContent.AutoHidePortion);
int autoHideSize = (int)(rectDockArea.Height * ActiveAutoHideContent.DockHandler.AutoHidePortion);
rect.X = rectDockArea.X;
rect.Y = rectDockArea.Y + rectDockArea.Height - autoHideSize;
rect.Width = rectDockArea.Width;
rect.Height = autoHideSize;
}
return rect;
if (Parent == null)
return Rectangle.Empty;
else
return new Rectangle(Parent.PointToClient(PointToScreen(rect.Location)), rect.Size);
}
}
@ -723,19 +821,11 @@ namespace WeifenLuo.WinFormsUI @@ -723,19 +821,11 @@ namespace WeifenLuo.WinFormsUI
AutoHideStripControl.RefreshChanges();
}
private void RefreshMdiIntegration()
private void OnChangingDocumentStyle(DocumentStyles oldValue)
{
foreach (DockPane pane in Panes)
{
if (pane.DockState == DockState.Document)
{
foreach (DockContent content in pane.Contents)
content.RefreshMdiIntegration();
}
}
}
internal void RemoveContent(DockContent content)
internal void RemoveContent(IDockContent content)
{
if (content == null)
throw(new ArgumentNullException());
@ -786,74 +876,38 @@ namespace WeifenLuo.WinFormsUI @@ -786,74 +876,38 @@ namespace WeifenLuo.WinFormsUI
Panes.AddAt(pane, index - 1);
else
Panes.AddAt(pane, index);
if (pane.DockState == DockState.Float)
pane.FloatWindow.PerformLayout();
else if (DockHelper.IsDockWindowState(pane.DockState))
DockWindows[pane.DockState].PerformLayout();
else if (DockHelper.IsDockStateAutoHide(pane.DockState))
Refresh();
}
internal void TestDrop(DragHandler dragHandler, Point pt)
/// <include file='CodeDoc\DockPanel.xml' path='//CodeDoc/Class[@name="DockPanel"]/Method[@name="SuspendLayout(bool)"]/*'/>
public void SuspendLayout(bool allWindows)
{
if (DockArea.Width <=0 || DockArea.Height <= 0)
return;
Point ptClient = PointToClient(pt);
int dragSize = MeasurePane.DragSize;
Rectangle rectDoc = DocumentRectangle;
if (ptClient.Y - rectDoc.Top >= 0 && ptClient.Y - rectDoc.Top < dragSize &&
DockWindows[DockState.DockTop].DisplayingList.Count == 0 &&
dragHandler.IsDockStateValid(DockState.DockTop))
dragHandler.DropTarget.SetDropTarget(this, DockStyle.Top);
else if (rectDoc.Bottom - ptClient.Y >= 0 && rectDoc.Bottom - ptClient.Y < dragSize &&
DockWindows[DockState.DockBottom].DisplayingList.Count == 0 &&
dragHandler.IsDockStateValid(DockState.DockBottom))
dragHandler.DropTarget.SetDropTarget(this, DockStyle.Bottom);
else if (rectDoc.Right - ptClient.X >= 0 && rectDoc.Right - ptClient.X < dragSize &&
DockWindows[DockState.DockRight].DisplayingList.Count == 0 &&
dragHandler.IsDockStateValid(DockState.DockRight))
dragHandler.DropTarget.SetDropTarget(this, DockStyle.Right);
else if (ptClient.X - rectDoc.Left >= 0 && ptClient.X - rectDoc.Left < dragSize &&
DockWindows[DockState.DockLeft].DisplayingList.Count == 0 &&
dragHandler.IsDockStateValid(DockState.DockLeft))
dragHandler.DropTarget.SetDropTarget(this, DockStyle.Left);
else if (((ptClient.Y - rectDoc.Top >= dragSize && ptClient.Y - rectDoc.Top < 2 * dragSize) ||
(rectDoc.Bottom - ptClient.Y >= dragSize && rectDoc.Bottom - ptClient.Y < 2 * dragSize) ||
(rectDoc.Right - ptClient.X >= dragSize && rectDoc.Right - ptClient.X < 2 * dragSize) ||
(ptClient.X - rectDoc.Left >= dragSize && ptClient.X - rectDoc.Left < 2 * dragSize)) &&
DockWindows[DockState.Document].DisplayingList.Count == 0 &&
dragHandler.IsDockStateValid(DockState.Document))
dragHandler.DropTarget.SetDropTarget(this, DockStyle.Fill);
else
return;
SuspendLayout();
if (allWindows)
{
AutoHideWindow.SuspendLayout();
if (dragHandler.DropTarget.SameAsOldValue)
return;
if (MdiClientController.MdiClient != null)
MdiClientController.MdiClient.SuspendLayout();
Rectangle rect = DockArea;
if (dragHandler.DropTarget.Dock == DockStyle.Top)
rect.Height = (int)(DockArea.Height * DockTopPortion);
else if (dragHandler.DropTarget.Dock == DockStyle.Bottom)
{
rect.Height = (int)(DockArea.Height * DockBottomPortion);
rect.Y = DockArea.Bottom - rect.Height;
foreach (DockWindow dockWindow in DockWindows)
dockWindow.SuspendLayout();
}
else if (dragHandler.DropTarget.Dock == DockStyle.Left)
rect.Width = (int)(DockArea.Width * DockLeftPortion);
else if (dragHandler.DropTarget.Dock == DockStyle.Right)
}
/// <include file='CodeDoc\DockPanel.xml' path='//CodeDoc/Class[@name="DockPanel"]/Method[@name="ResumeLayout(bool, bool)"]/*'/>
public void ResumeLayout(bool performLayout, bool allWindows)
{
ResumeLayout(performLayout);
if (allWindows)
{
rect.Width = (int)(DockArea.Width * DockRightPortion);
rect.X = DockArea.Right - rect.Width;
}
else if (dragHandler.DropTarget.Dock == DockStyle.Fill)
rect = DocumentRectangle;
AutoHideWindow.ResumeLayout(performLayout);
rect.Location = PointToScreen(rect.Location);
dragHandler.DragOutline = DrawHelper.CreateDragOutline(rect, dragSize);
foreach (DockWindow dockWindow in DockWindows)
dockWindow.ResumeLayout(performLayout);
if (MdiClientController.MdiClient != null)
MdiClientController.MdiClient.ResumeLayout(performLayout);
}
}
/// <exclude/>
@ -861,10 +915,237 @@ namespace WeifenLuo.WinFormsUI @@ -861,10 +915,237 @@ namespace WeifenLuo.WinFormsUI
{
if (m.Msg == WM_REFRESHACTIVEWINDOW)
RefreshActiveWindow();
else if (m.Msg == (int)Win32.Msgs.WM_WINDOWPOSCHANGING)
{
int offset = (int)Marshal.OffsetOf(typeof(Win32.WINDOWPOS), "flags");
int flags = Marshal.ReadInt32(m.LParam, offset);
Marshal.WriteInt32(m.LParam, offset, flags | (int)Win32.FlagsSetWindowPos.SWP_NOCOPYBITS);
}
base.WndProc (ref m);
}
internal Form ParentForm
{
get
{
if (!IsParentFormValid())
throw new InvalidOperationException();
return MdiClientController.ParentForm;
}
}
private bool IsParentFormValid()
{
if (DocumentStyle == DocumentStyles.DockingSdi || DocumentStyle == DocumentStyles.DockingWindow)
return true;
return (MdiClientController.MdiClient != null);
}
/// <exclude/>
protected override void OnParentChanged(EventArgs e)
{
AutoHideWindow.Parent = this.Parent;
MdiClientController.ParentForm = (this.Parent as Form);
AutoHideWindow.BringToFront();
base.OnParentChanged (e);
}
/// <exclude/>
protected override void OnVisibleChanged(EventArgs e)
{
base.OnVisibleChanged (e);
if (Visible)
SetMdiClient();
}
private Rectangle SystemMdiClientBounds
{
get
{
if (!IsParentFormValid() || !Visible)
return Rectangle.Empty;
Point location = ParentForm.PointToClient(PointToScreen(DocumentWindowBounds.Location));
Size size = DocumentWindowBounds.Size;
return new Rectangle(location, size);
}
}
internal Rectangle DocumentWindowBounds
{
get
{
Rectangle rectDocumentBounds = DisplayRectangle;
if (DockWindows[DockState.DockLeft].Visible)
{
rectDocumentBounds.X += DockWindows[DockState.DockLeft].Width;
rectDocumentBounds.Width -= DockWindows[DockState.DockLeft].Width;
}
if (DockWindows[DockState.DockRight].Visible)
rectDocumentBounds.Width -= DockWindows[DockState.DockRight].Width;
if (DockWindows[DockState.DockTop].Visible)
{
rectDocumentBounds.Y += DockWindows[DockState.DockTop].Height;
rectDocumentBounds.Height -= DockWindows[DockState.DockTop].Height;
}
if (DockWindows[DockState.DockBottom].Visible)
rectDocumentBounds.Height -= DockWindows[DockState.DockBottom].Height;
return rectDocumentBounds;
}
}
private void SetMdiClient()
{
if (this.DocumentStyle == DocumentStyles.DockingMdi)
{
MdiClientController.AutoScroll = false;
MdiClientController.BorderStyle = BorderStyle.None;
if (MdiClientController.MdiClient != null)
MdiClientController.MdiClient.Dock = DockStyle.Fill;
}
else if (DocumentStyle == DocumentStyles.DockingSdi || DocumentStyle == DocumentStyles.DockingWindow)
{
MdiClientController.AutoScroll = true;
MdiClientController.BorderStyle = BorderStyle.Fixed3D;
if (MdiClientController.MdiClient != null)
MdiClientController.MdiClient.Dock = DockStyle.Fill;
}
else if (this.DocumentStyle == DocumentStyles.SystemMdi)
{
MdiClientController.AutoScroll = true;
MdiClientController.BorderStyle = BorderStyle.Fixed3D;
if (MdiClientController.MdiClient != null)
{
MdiClientController.MdiClient.Dock = DockStyle.None;
MdiClientController.MdiClient.Bounds = SystemMdiClientBounds;
}
}
}
private void UpdateWindowRegion()
{
if (DesignMode)
return;
if (this.DocumentStyle == DocumentStyles.DockingMdi)
UpdateWindowRegion_ClipContent();
else if (this.DocumentStyle == DocumentStyles.DockingSdi ||
this.DocumentStyle == DocumentStyles.DockingWindow)
UpdateWindowRegion_FullDocumentArea();
else if (this.DocumentStyle == DocumentStyles.SystemMdi)
UpdateWindowRegion_EmptyDocumentArea();
}
private void UpdateWindowRegion_FullDocumentArea()
{
SetRegion(null);
}
private void UpdateWindowRegion_EmptyDocumentArea()
{
Rectangle rect = DocumentWindowBounds;
SetRegion(new Rectangle[] { rect });
}
private void UpdateWindowRegion_ClipContent()
{
int count = 0;
foreach (DockPane pane in this.Panes)
{
if (pane.DockState != DockState.Document)
continue;
count ++;
}
Rectangle[] rects = new Rectangle[count];
int i = 0;
foreach (DockPane pane in this.Panes)
{
if (pane.DockState != DockState.Document)
continue;
Size size = pane.ContentRectangle.Size;
Point location = PointToClient(pane.PointToScreen(pane.ContentRectangle.Location));
rects[i] = new Rectangle(location, size);
i++;
}
SetRegion(rects);
}
private Rectangle[] m_clipRects = null;
private void SetRegion(Rectangle[] clipRects)
{
if (!IsClipRectsChanged(clipRects))
return;
m_clipRects = clipRects;
if (m_clipRects == null || m_clipRects.GetLength(0) == 0)
Region = null;
else
{
Region region = new Region(new Rectangle(0, 0, this.Width, this.Height));
foreach (Rectangle rect in m_clipRects)
region.Exclude(rect);
Region = region;
}
}
private bool IsClipRectsChanged(Rectangle[] clipRects)
{
if (clipRects == null && m_clipRects == null)
return false;
else if ((clipRects == null) != (m_clipRects == null))
return true;
foreach (Rectangle rect in clipRects)
{
bool matched = false;
foreach (Rectangle rect2 in m_clipRects)
{
if (rect == rect2)
{
matched = true;
break;
}
}
if (!matched)
return true;
}
foreach (Rectangle rect2 in m_clipRects)
{
bool matched = false;
foreach (Rectangle rect in clipRects)
{
if (rect == rect2)
{
matched = true;
break;
}
}
if (!matched)
return true;
}
return false;
}
internal Point PointToMdiClient(Point p)
{
if (MdiClientController.MdiClient == null)
return Point.Empty;
else
return MdiClientController.MdiClient.PointToClient(p);
}
private static readonly object ActiveDocumentChangedEvent = new object();
/// <include file='CodeDoc\DockPanel.xml' path='//CodeDoc/Class[@name="DockPanel"]/Event[@name="ActiveDocumentChanged"]/*' />
[LocalizedCategory("Category.PropertyChanged")]
@ -971,6 +1252,12 @@ namespace WeifenLuo.WinFormsUI @@ -971,6 +1252,12 @@ namespace WeifenLuo.WinFormsUI
DockPanelPersist.SaveAsXml(this, stream, encoding);
}
/// <include file='CodeDoc\DockPanel.xml' path='//CodeDoc/Class[@name="DockPanel"]/Method[@name="SaveAsXml(Stream, Encoding, bool)"]/*'/>
public void SaveAsXml(Stream stream, Encoding encoding, bool upstream)
{
DockPanelPersist.SaveAsXml(this, stream, encoding, upstream);
}
/// <include file='CodeDoc\DockPanel.xml' path='//CodeDoc/Class[@name="DockPanel"]/Method[@name="LoadFromXml"]/*'/>
/// <include file='CodeDoc\DockPanel.xml' path='//CodeDoc/Class[@name="DockPanel"]/Method[@name="LoadFromXml(string, DeserializeDockContent)"]/*'/>
public void LoadFromXml(string filename, DeserializeDockContent deserializeContent)
@ -983,5 +1270,11 @@ namespace WeifenLuo.WinFormsUI @@ -983,5 +1270,11 @@ namespace WeifenLuo.WinFormsUI
{
DockPanelPersist.LoadFromXml(this, stream, deserializeContent);
}
/// <include file='CodeDoc\DockPanel.xml' path='//CodeDoc/Class[@name="DockPanel"]/Method[@name="LoadFromXml(Stream, DeserializeDockContent, bool)"]/*'/>
public void LoadFromXml(Stream stream, DeserializeDockContent deserializeContent, bool closeStream)
{
DockPanelPersist.LoadFromXml(this, stream, deserializeContent, closeStream);
}
}
}
}

42
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.resx

@ -0,0 +1,42 @@ @@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8" ?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<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" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</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>1.0.0.0</value>
</resheader>
<resheader name="Reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="Writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

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

@ -19,14 +19,14 @@ namespace WeifenLuo.WinFormsUI @@ -19,14 +19,14 @@ namespace WeifenLuo.WinFormsUI
public interface IDockPaneFactory
{
/// <include file='CodeDoc\DockPanelExtender.xml' path='//CodeDoc/Class[@name="DockPanelExtender"]/Interface[@name="IDockPaneFactory"]/Method[@name="CreateDockPane"]/*'/>
/// <include file='CodeDoc\DockPanelExtender.xml' path='//CodeDoc/Class[@name="DockPanelExtender"]/Interface[@name="IDockPaneFactory"]/Method[@name="CreateDockPane(DockContent, DockState, bool)"]/*'/>
DockPane CreateDockPane(DockContent content, DockState visibleState, bool show);
/// <include file='CodeDoc\DockPanelExtender.xml' path='//CodeDoc/Class[@name="DockPanelExtender"]/Interface[@name="IDockPaneFactory"]/Method[@name="CreateDockPane(DockContent, FloatWindow, bool)"]/*'/>
DockPane CreateDockPane(DockContent content, FloatWindow floatWindow, bool show);
/// <include file='CodeDoc\DockPanelExtender.xml' path='//CodeDoc/Class[@name="DockPanelExtender"]/Interface[@name="IDockPaneFactory"]/Method[@name="CreateDockPane(DockContent, DockPane, DockAlignment, double, bool)"]/*'/>
DockPane CreateDockPane(DockContent content, DockPane prevPane, DockAlignment alignment, double proportion, bool show);
/// <include file='CodeDoc\DockPanelExtender.xml' path='//CodeDoc/Class[@name="DockPanelExtender"]/Interface[@name="IDockPaneFactory"]/Method[@name="CreateDockPane(DockContent, Rectangle, bool)"]/*'/>
DockPane CreateDockPane(DockContent content, Rectangle floatWindowBounds, bool show);
/// <include file='CodeDoc\DockPanelExtender.xml' path='//CodeDoc/Class[@name="DockPanelExtender"]/Interface[@name="IDockPaneFactory"]/Method[@name="CreateDockPane(IDockContent, DockState, bool)"]/*'/>
DockPane CreateDockPane(IDockContent content, DockState visibleState, bool show);
/// <include file='CodeDoc\DockPanelExtender.xml' path='//CodeDoc/Class[@name="DockPanelExtender"]/Interface[@name="IDockPaneFactory"]/Method[@name="CreateDockPane(IDockContent, FloatWindow, bool)"]/*'/>
DockPane CreateDockPane(IDockContent content, FloatWindow floatWindow, bool show);
/// <include file='CodeDoc\DockPanelExtender.xml' path='//CodeDoc/Class[@name="DockPanelExtender"]/Interface[@name="IDockPaneFactory"]/Method[@name="CreateDockPane(IDockContent, DockPane, DockAlignment, double, bool)"]/*'/>
DockPane CreateDockPane(IDockContent content, DockPane prevPane, DockAlignment alignment, double proportion, bool show);
/// <include file='CodeDoc\DockPanelExtender.xml' path='//CodeDoc/Class[@name="DockPanelExtender"]/Interface[@name="IDockPaneFactory"]/Method[@name="CreateDockPane(IDockContent, Rectangle, bool)"]/*'/>
DockPane CreateDockPane(IDockContent content, Rectangle floatWindowBounds, bool show);
}
/// <include file='CodeDoc\DockPanelExtender.xml' path='//CodeDoc/Class[@name="DockPanelExtender"]/Interface[@name="IFloatWindowFactory"]/InterfaceDef/*'/>
@ -63,8 +63,8 @@ namespace WeifenLuo.WinFormsUI @@ -63,8 +63,8 @@ namespace WeifenLuo.WinFormsUI
/// <include file='CodeDoc\DockPanelExtender.xml' path='//CodeDoc/Class[@name="DockPanelExtender"]/Interface[@name="IAutoHideTabFactory"]/InterfaceDef/*'/>
public interface IAutoHideTabFactory
{
/// <include file='CodeDoc\DockPanelExtender.xml' path='//CodeDoc/Class[@name="DockPanelExtender"]/Interface[@name="IAutoHideTabFactory"]/Method[@name="CreateAutoHideTab(DockContent)"]/*'/>
AutoHideTab CreateAutoHideTab(DockContent content);
/// <include file='CodeDoc\DockPanelExtender.xml' path='//CodeDoc/Class[@name="DockPanelExtender"]/Interface[@name="IAutoHideTabFactory"]/Method[@name="CreateAutoHideTab(IDockContent)"]/*'/>
AutoHideTab CreateAutoHideTab(IDockContent content);
}
/// <include file='CodeDoc\DockPanelExtender.xml' path='//CodeDoc/Class[@name="DockPanelExtender"]/Interface[@name="IAutoHidePaneFactory"]/InterfaceDef/*'/>
@ -77,29 +77,29 @@ namespace WeifenLuo.WinFormsUI @@ -77,29 +77,29 @@ namespace WeifenLuo.WinFormsUI
/// <include file='CodeDoc\DockPanelExtender.xml' path='//CodeDoc/Class[@name="DockPanelExtender"]/Interface[@name="IDockPaneTabFactory"]/InterfaceDef/*'/>
public interface IDockPaneTabFactory
{
/// <include file='CodeDoc\DockPanelExtender.xml' path='//CodeDoc/Class[@name="DockPanelExtender"]/Interface[@name="IDockPaneTabFactory"]/Method[@name="CreateDockPaneTab(DockContent)"]/*'/>
DockPaneTab CreateDockPaneTab(DockContent content);
/// <include file='CodeDoc\DockPanelExtender.xml' path='//CodeDoc/Class[@name="DockPanelExtender"]/Interface[@name="IDockPaneTabFactory"]/Method[@name="CreateDockPaneTab(IDockContent)"]/*'/>
DockPaneTab CreateDockPaneTab(IDockContent content);
}
#region DefaultDockPaneFactory
private class DefaultDockPaneFactory : IDockPaneFactory
{
public DockPane CreateDockPane(DockContent content, DockState visibleState, bool show)
public DockPane CreateDockPane(IDockContent content, DockState visibleState, bool show)
{
return new DockPane(content, visibleState, show);
}
public DockPane CreateDockPane(DockContent content, FloatWindow floatWindow, bool show)
public DockPane CreateDockPane(IDockContent content, FloatWindow floatWindow, bool show)
{
return new DockPane(content, floatWindow, show);
}
public DockPane CreateDockPane(DockContent content, DockPane prevPane, DockAlignment alignment, double proportion, bool show)
public DockPane CreateDockPane(IDockContent content, DockPane prevPane, DockAlignment alignment, double proportion, bool show)
{
return new DockPane(content, prevPane, alignment, proportion, show);
}
public DockPane CreateDockPane(DockContent content, Rectangle floatWindowBounds, bool show)
public DockPane CreateDockPane(IDockContent content, Rectangle floatWindowBounds, bool show)
{
return new DockPane(content, floatWindowBounds, show);
}
@ -134,7 +134,7 @@ namespace WeifenLuo.WinFormsUI @@ -134,7 +134,7 @@ namespace WeifenLuo.WinFormsUI
#region DefaultDockPaneTabFactory
private class DefaultDockPaneTabFactory : IDockPaneTabFactory
{
public DockPaneTab CreateDockPaneTab(DockContent content)
public DockPaneTab CreateDockPaneTab(IDockContent content)
{
return new DockPaneTabVS2003(content);
}
@ -164,7 +164,7 @@ namespace WeifenLuo.WinFormsUI @@ -164,7 +164,7 @@ namespace WeifenLuo.WinFormsUI
#region DefaultAutoHideTabFactory
private class DefaultAutoHideTabFactory : IAutoHideTabFactory
{
public AutoHideTab CreateAutoHideTab(DockContent content)
public AutoHideTab CreateAutoHideTab(IDockContent content)
{
return new AutoHideTabVS2003(content);
}

154
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanelPersist.cs

@ -22,7 +22,8 @@ namespace WeifenLuo.WinFormsUI @@ -22,7 +22,8 @@ namespace WeifenLuo.WinFormsUI
{
internal class DockPanelPersist
{
private const string ConfigFileVersion = "0.9.3";
private const string ConfigFileVersion = "1.0";
private static string[] CompatibleConfigFileVersions = new string[] { };
private class DummyContent : DockContent
{
@ -244,14 +245,21 @@ namespace WeifenLuo.WinFormsUI @@ -244,14 +245,21 @@ namespace WeifenLuo.WinFormsUI
}
public static void SaveAsXml(DockPanel dockPanel, Stream stream, Encoding encoding)
{
SaveAsXml(dockPanel, stream, encoding, false);
}
public static void SaveAsXml(DockPanel dockPanel, Stream stream, Encoding encoding, bool upstream)
{
XmlTextWriter xmlOut = new XmlTextWriter(stream, encoding);
// Use indenting for readability
xmlOut.Formatting = Formatting.Indented;
if (!upstream)
xmlOut.WriteStartDocument();
// Always begin file with identification and warning
xmlOut.WriteStartDocument();
xmlOut.WriteComment(" DockPanel configuration file. Author: Weifen Luo, all rights reserved. ");
xmlOut.WriteComment(" !!! AUTOMATICALLY GENERATED FILE. DO NOT MODIFY !!! ");
@ -269,14 +277,14 @@ namespace WeifenLuo.WinFormsUI @@ -269,14 +277,14 @@ namespace WeifenLuo.WinFormsUI
// Contents
xmlOut.WriteStartElement("Contents");
xmlOut.WriteAttributeString("Count", dockPanel.Contents.Count.ToString());
foreach (DockContent content in dockPanel.Contents)
foreach (IDockContent content in dockPanel.Contents)
{
xmlOut.WriteStartElement("Content");
xmlOut.WriteAttributeString("ID", dockPanel.Contents.IndexOf(content).ToString());
xmlOut.WriteAttributeString("PersistString", content.PersistString);
xmlOut.WriteAttributeString("AutoHidePortion", content.AutoHidePortion.ToString(CultureInfo.InvariantCulture));
xmlOut.WriteAttributeString("IsHidden", content.IsHidden.ToString());
xmlOut.WriteAttributeString("IsFloat", content.IsFloat.ToString());
xmlOut.WriteAttributeString("PersistString", content.DockHandler.PersistString);
xmlOut.WriteAttributeString("AutoHidePortion", content.DockHandler.AutoHidePortion.ToString(CultureInfo.InvariantCulture));
xmlOut.WriteAttributeString("IsHidden", content.DockHandler.IsHidden.ToString());
xmlOut.WriteAttributeString("IsFloat", content.DockHandler.IsFloat.ToString());
xmlOut.WriteEndElement();
}
xmlOut.WriteEndElement();
@ -292,7 +300,7 @@ namespace WeifenLuo.WinFormsUI @@ -292,7 +300,7 @@ namespace WeifenLuo.WinFormsUI
xmlOut.WriteAttributeString("ActiveContent", dockPanel.Contents.IndexOf(pane.ActiveContent).ToString());
xmlOut.WriteStartElement("Contents");
xmlOut.WriteAttributeString("Count", pane.Contents.Count.ToString());
foreach (DockContent content in pane.Contents)
foreach (IDockContent content in pane.Contents)
{
xmlOut.WriteStartElement("Content");
xmlOut.WriteAttributeString("ID", pane.Contents.IndexOf(content).ToString());
@ -306,18 +314,12 @@ namespace WeifenLuo.WinFormsUI @@ -306,18 +314,12 @@ namespace WeifenLuo.WinFormsUI
// DockWindows
xmlOut.WriteStartElement("DockWindows");
int count = 0;
foreach (DockWindow dw in dockPanel.DockWindows)
if (dw.DockList.Count > 0)
count++;
xmlOut.WriteAttributeString("Count", count.ToString());
int i = 0;
int dockWindowId = 0;
foreach (DockWindow dw in dockPanel.DockWindows)
{
if (dw.DockList.Count == 0)
continue;
xmlOut.WriteStartElement("DockWindow");
xmlOut.WriteAttributeString("ID", i.ToString());
xmlOut.WriteAttributeString("ID", dockWindowId.ToString());
dockWindowId++;
xmlOut.WriteAttributeString("DockState", dw.DockState.ToString());
xmlOut.WriteAttributeString("ZOrderIndex", dockPanel.Controls.IndexOf(dw).ToString());
xmlOut.WriteStartElement("DockList");
@ -335,7 +337,6 @@ namespace WeifenLuo.WinFormsUI @@ -335,7 +337,6 @@ namespace WeifenLuo.WinFormsUI
}
xmlOut.WriteEndElement();
xmlOut.WriteEndElement();
i++;
}
xmlOut.WriteEndElement();
@ -369,10 +370,14 @@ namespace WeifenLuo.WinFormsUI @@ -369,10 +370,14 @@ namespace WeifenLuo.WinFormsUI
xmlOut.WriteEndElement(); // </FloatWindows>
xmlOut.WriteEndElement();
xmlOut.WriteEndDocument();
// This should flush all actions and close the file
xmlOut.Close();
if (!upstream)
{
xmlOut.WriteEndDocument();
xmlOut.Close();
}
else
xmlOut.Flush();
}
public static void LoadFromXml(DockPanel dockPanel, string filename, DeserializeDockContent deserializeContent)
@ -389,6 +394,11 @@ namespace WeifenLuo.WinFormsUI @@ -389,6 +394,11 @@ namespace WeifenLuo.WinFormsUI
}
public static void LoadFromXml(DockPanel dockPanel, Stream stream, DeserializeDockContent deserializeContent)
{
LoadFromXml(dockPanel, stream, deserializeContent, true);
}
public static void LoadFromXml(DockPanel dockPanel, Stream stream, DeserializeDockContent deserializeContent, bool closeStream)
{
if (dockPanel.Contents.Count != 0)
@ -402,12 +412,16 @@ namespace WeifenLuo.WinFormsUI @@ -402,12 +412,16 @@ namespace WeifenLuo.WinFormsUI
xmlIn.WhitespaceHandling = WhitespaceHandling.None;
xmlIn.MoveToContent();
if (xmlIn.Name != "DockPanel")
throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat"));
while (!xmlIn.Name.Equals("DockPanel"))
{
if (!MoveToNextElement(xmlIn))
throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat"));
}
string formatVersion = xmlIn.GetAttribute("FormatVersion");
if (formatVersion != ConfigFileVersion)
if (!IsFormatVersionValid(formatVersion))
throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidFormatVersion"));
DockPanelStruct dockPanelStruct = new DockPanelStruct();
dockPanelStruct.DockLeftPortion = Convert.ToDouble(xmlIn.GetAttribute("DockLeftPortion"), CultureInfo.InvariantCulture);
dockPanelStruct.DockRightPortion = Convert.ToDouble(xmlIn.GetAttribute("DockRightPortion"), CultureInfo.InvariantCulture);
@ -472,7 +486,7 @@ namespace WeifenLuo.WinFormsUI @@ -472,7 +486,7 @@ namespace WeifenLuo.WinFormsUI
// Load DockWindows
if (xmlIn.Name != "DockWindows")
throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat"));
int countOfDockWindows = Convert.ToInt32(xmlIn.GetAttribute("Count"));
int countOfDockWindows = dockPanel.DockWindows.Count;
DockWindowStruct[] dockWindows = new DockWindowStruct[countOfDockWindows];
MoveToNextElement(xmlIn);
for (int i=0; i<countOfDockWindows; i++)
@ -535,23 +549,44 @@ namespace WeifenLuo.WinFormsUI @@ -535,23 +549,44 @@ namespace WeifenLuo.WinFormsUI
MoveToNextElement(xmlIn);
}
}
xmlIn.Close();
if (closeStream)
xmlIn.Close();
dockPanel.DockLeftPortion = dockPanelStruct.DockLeftPortion;
dockPanel.DockRightPortion = dockPanelStruct.DockRightPortion;
dockPanel.DockTopPortion = dockPanelStruct.DockTopPortion;
dockPanel.DockBottomPortion = dockPanelStruct.DockBottomPortion;
// Set DockWindow ZOrders
int prevMaxDockWindowZOrder = int.MaxValue;
for (int i=0; i<dockWindows.Length; i++)
{
int maxDockWindowZOrder = -1;
int index = -1;
for (int j=0; j<dockWindows.Length; j++)
{
if (dockWindows[j].ZOrderIndex > maxDockWindowZOrder && dockWindows[j].ZOrderIndex < prevMaxDockWindowZOrder)
{
maxDockWindowZOrder = dockWindows[j].ZOrderIndex;
index = j;
}
}
dockPanel.DockWindows[dockWindows[index].DockState].BringToFront();
prevMaxDockWindowZOrder = maxDockWindowZOrder;
}
// Create Contents
for (int i=0; i<contents.Length; i++)
{
DockContent content = deserializeContent(contents[i].PersistString);
IDockContent content = deserializeContent(contents[i].PersistString);
if (content == null)
content = new DummyContent();
content.DockPanel = dockPanel;
content.AutoHidePortion = contents[i].AutoHidePortion;
content.IsHidden = true;
content.IsFloat = contents[i].IsFloat;
content.DockHandler.DockPanel = dockPanel;
content.DockHandler.AutoHidePortion = contents[i].AutoHidePortion;
content.DockHandler.IsHidden = true;
content.DockHandler.IsFloat = contents[i].IsFloat;
}
// Create panes
@ -560,13 +595,13 @@ namespace WeifenLuo.WinFormsUI @@ -560,13 +595,13 @@ namespace WeifenLuo.WinFormsUI
DockPane pane = null;
for (int j=0; j<panes[i].IndexContents.Length; j++)
{
DockContent content = dockPanel.Contents[panes[i].IndexContents[j]];
IDockContent content = dockPanel.Contents[panes[i].IndexContents[j]];
if (j==0)
pane = dockPanel.DockPaneFactory.CreateDockPane(content, panes[i].DockState, false);
else if (panes[i].DockState == DockState.Float)
content.FloatPane = pane;
content.DockHandler.FloatPane = pane;
else
content.PanelPane = pane;
content.DockHandler.PanelPane = pane;
}
}
@ -611,7 +646,7 @@ namespace WeifenLuo.WinFormsUI @@ -611,7 +646,7 @@ namespace WeifenLuo.WinFormsUI
}
}
// sort DockContent by its Pane's ZOrder
// sort IDockContent by its Pane's ZOrder
int[] sortedContents = null;
if (contents.Length > 0)
{
@ -624,9 +659,9 @@ namespace WeifenLuo.WinFormsUI @@ -624,9 +659,9 @@ namespace WeifenLuo.WinFormsUI
{
for (int j=i+1; j<contents.Length; j++)
{
DockPane pane1 = dockPanel.Contents[sortedContents[i]].Pane;
DockPane pane1 = dockPanel.Contents[sortedContents[i]].DockHandler.Pane;
int ZOrderIndex1 = pane1 == null ? 0 : panes[dockPanel.Panes.IndexOf(pane1)].ZOrderIndex;
DockPane pane2 = dockPanel.Contents[sortedContents[j]].Pane;
DockPane pane2 = dockPanel.Contents[sortedContents[j]].DockHandler.Pane;
int ZOrderIndex2 = pane2 == null ? 0 : panes[dockPanel.Panes.IndexOf(pane2)].ZOrderIndex;
if (ZOrderIndex1 > ZOrderIndex2)
{
@ -638,20 +673,20 @@ namespace WeifenLuo.WinFormsUI @@ -638,20 +673,20 @@ namespace WeifenLuo.WinFormsUI
}
}
// show non-document DockContent first to avoid screen flickers
// show non-document IDockContent first to avoid screen flickers
for (int i=0; i<contents.Length; i++)
{
DockContent content = dockPanel.Contents[sortedContents[i]];
if (content.Pane != null && content.Pane.DockState != DockState.Document)
content.IsHidden = contents[sortedContents[i]].IsHidden;
IDockContent content = dockPanel.Contents[sortedContents[i]];
if (content.DockHandler.Pane != null && content.DockHandler.Pane.DockState != DockState.Document)
content.DockHandler.IsHidden = contents[sortedContents[i]].IsHidden;
}
// after all non-document DockContent, show document DockContent
// after all non-document IDockContent, show document IDockContent
for (int i=0; i<contents.Length; i++)
{
DockContent content = dockPanel.Contents[sortedContents[i]];
if (content.Pane != null && content.Pane.DockState == DockState.Document)
content.IsHidden = contents[sortedContents[i]].IsHidden;
IDockContent content = dockPanel.Contents[sortedContents[i]];
if (content.DockHandler.Pane != null && content.DockHandler.Pane.DockState == DockState.Document)
content.DockHandler.IsHidden = contents[sortedContents[i]].IsHidden;
}
for (int i=0; i<panes.Length; i++)
@ -665,14 +700,33 @@ namespace WeifenLuo.WinFormsUI @@ -665,14 +700,33 @@ namespace WeifenLuo.WinFormsUI
for (int i=dockPanel.Contents.Count-1; i>=0; i--)
if (dockPanel.Contents[i] is DummyContent)
dockPanel.Contents[i].Close();
dockPanel.Contents[i].DockHandler.Form.Close();
}
private static void MoveToNextElement(XmlTextReader xmlIn)
private static bool MoveToNextElement(XmlTextReader xmlIn)
{
xmlIn.Read();
if (!xmlIn.Read())
return false;
while (xmlIn.NodeType == XmlNodeType.EndElement)
xmlIn.Read();
{
if (!xmlIn.Read())
return false;
}
return true;
}
private static bool IsFormatVersionValid(string formatVersion)
{
if (formatVersion == ConfigFileVersion)
return true;
foreach (string s in CompatibleConfigFileVersions)
if (s == formatVersion)
return true;
return false;
}
}
}

40
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockWindow.cs

@ -11,10 +11,13 @@ @@ -11,10 +11,13 @@
using System;
using System.Windows.Forms;
using System.Drawing;
using System.Runtime.InteropServices;
using System.ComponentModel;
namespace WeifenLuo.WinFormsUI
{
/// <include file='CodeDoc\DockWindow.xml' path='//CodeDoc/Class[@name="DockWindow"]/ClassDef/*'/>
[ToolboxItem(false)]
public class DockWindow : Panel, IDockListContainer
{
private DockPanel m_dockPanel;
@ -59,7 +62,9 @@ namespace WeifenLuo.WinFormsUI @@ -59,7 +62,9 @@ namespace WeifenLuo.WinFormsUI
m_splitter.Dock = DockStyle.Top;
}
else if (DockState == DockState.Document)
{
Dock = DockStyle.Fill;
}
ResumeLayout();
}
@ -122,18 +127,18 @@ namespace WeifenLuo.WinFormsUI @@ -122,18 +127,18 @@ namespace WeifenLuo.WinFormsUI
}
// exclude the splitter
else if (DockState == DockState.DockLeft)
rect.Width -= MeasureDockWindow.SplitterSize;
rect.Width -= Measures.SplitterSize;
else if (DockState == DockState.DockRight)
{
rect.X += MeasureDockWindow.SplitterSize;
rect.Width -= MeasureDockWindow.SplitterSize;
rect.X += Measures.SplitterSize;
rect.Width -= Measures.SplitterSize;
}
else if (DockState == DockState.DockTop)
rect.Height -= MeasureDockWindow.SplitterSize;
rect.Height -= Measures.SplitterSize;
else if (DockState == DockState.DockBottom)
{
rect.Y += MeasureDockWindow.SplitterSize;
rect.Height -= MeasureDockWindow.SplitterSize;
rect.Y += Measures.SplitterSize;
rect.Height -= Measures.SplitterSize;
}
return rect;
@ -156,19 +161,30 @@ namespace WeifenLuo.WinFormsUI @@ -156,19 +161,30 @@ namespace WeifenLuo.WinFormsUI
DisplayingList.Refresh();
if (DisplayingList.Count == 0)
{
Visible = false;
base.OnLayout(levent);
return;
if (Visible)
Visible = false;
}
if (!Visible)
else if (!Visible)
{
SendToBack();
Visible = true;
DisplayingList.Refresh();
}
base.OnLayout (levent);
}
/// <exclude/>
protected override void WndProc(ref Message m)
{
if (m.Msg == (int)Win32.Msgs.WM_WINDOWPOSCHANGING)
{
int offset = (int)Marshal.OffsetOf(typeof(Win32.WINDOWPOS), "flags");
int flags = Marshal.ReadInt32(m.LParam, offset);
Marshal.WriteInt32(m.LParam, offset, flags | (int)Win32.FlagsSetWindowPos.SWP_NOCOPYBITS);
}
base.WndProc (ref m);
}
}
}

42
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockWindow.resx

@ -0,0 +1,42 @@ @@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8" ?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<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" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</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>1.0.0.0</value>
</resheader>
<resheader name="Reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="Writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

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

@ -20,7 +20,7 @@ namespace WeifenLuo.WinFormsUI @@ -20,7 +20,7 @@ namespace WeifenLuo.WinFormsUI
{
protected override int SplitterSize
{
get { return MeasureDockWindow.SplitterSize; }
get { return Measures.SplitterSize; }
}
protected override void StartDrag()

742
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DragHandler.cs

File diff suppressed because it is too large Load Diff

31
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DragHandlerBase.cs

@ -69,19 +69,22 @@ namespace WeifenLuo.WinFormsUI @@ -69,19 +69,22 @@ namespace WeifenLuo.WinFormsUI
protected bool BeginDrag(Control c)
{
// Avoid re-entrance;
if (m_dragControl != null)
return false;
m_startMousePosition = Control.MousePosition;
if (!User32.DragDetect(c.Handle, StartMousePosition))
return false;
m_dragControl = c;
c.FindForm().Capture = true;
AssignHandle(c.FindForm().Handle);
Application.AddMessageFilter(this);
return true;
lock (this)
{
if (m_dragControl != null)
return false;
m_startMousePosition = Control.MousePosition;
if (!User32.DragDetect(c.Handle, StartMousePosition))
return false;
m_dragControl = c;
c.FindForm().Capture = true;
AssignHandle(c.FindForm().Handle);
Application.AddMessageFilter(this);
return true;
}
}
protected virtual void OnDragging()
@ -119,7 +122,7 @@ namespace WeifenLuo.WinFormsUI @@ -119,7 +122,7 @@ namespace WeifenLuo.WinFormsUI
protected virtual bool OnPreFilterMessage(ref Message m)
{
return true;
return false;
}
private IntPtr WndProc(IntPtr hWnd, int iMsg, IntPtr wParam, IntPtr lParam)

13
src/Libraries/DockPanel_Src/WinFormsUI/Docking/Enums.cs

@ -75,4 +75,17 @@ namespace WeifenLuo.WinFormsUI @@ -75,4 +75,17 @@ namespace WeifenLuo.WinFormsUI
/// <include file='CodeDoc\Enums.xml' path='//CodeDoc/Enum[@name="DockAlignment"]/Member[@name="Bottom"]/*'/>
Bottom
}
/// <include file='CodeDoc\Enums.xml' path='//CodeDoc/Enum[@name="DocumentStyles"]/EnumDef/*'/>
public enum DocumentStyles
{
/// <include file='CodeDoc\Enums.xml' path='//CodeDoc/Enum[@name="DocumentStyles"]/Member[@name="DockingMdi"]/*'/>
DockingMdi,
/// <include file='CodeDoc\Enums.xml' path='//CodeDoc/Enum[@name="DocumentStyles"]/Member[@name="DockingWindow"]/*'/>
DockingWindow,
/// <include file='CodeDoc\Enums.xml' path='//CodeDoc/Enum[@name="DocumentStyles"]/Member[@name="DockingSdi"]/*'/>
DockingSdi,
/// <include file='CodeDoc\Enums.xml' path='//CodeDoc/Enum[@name="DocumentStyles"]/Member[@name="SystemMdi"]/*'/>
SystemMdi,
}
}

8
src/Libraries/DockPanel_Src/WinFormsUI/Docking/EventArgs.cs

@ -14,16 +14,16 @@ namespace WeifenLuo.WinFormsUI @@ -14,16 +14,16 @@ namespace WeifenLuo.WinFormsUI
/// <include file='CodeDoc\EventArgs.xml' path='//CodeDoc/Class[@name="DockContentEventArgs"]/ClassDef/*'/>
public class DockContentEventArgs : EventArgs
{
private DockContent m_content;
private IDockContent m_content;
/// <include file='CodeDoc\EventArgs.xml' path='//CodeDoc/Class[@name="DockContentEventArgs"]/Constructor[@name="(DockContent)"]/*'/>
public DockContentEventArgs(DockContent content)
/// <include file='CodeDoc\EventArgs.xml' path='//CodeDoc/Class[@name="DockContentEventArgs"]/Constructor[@name="(IDockContent)"]/*'/>
public DockContentEventArgs(IDockContent content)
{
m_content = content;
}
/// <include file='CodeDoc\EventArgs.xml' path='//CodeDoc/Class[@name="DockContentEventArgs"]/Property[@name="Content"]/*'/>
public DockContent Content
public IDockContent Content
{
get { return m_content; }
}

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

@ -12,6 +12,7 @@ using System; @@ -12,6 +12,7 @@ using System;
using System.Collections;
using System.Drawing;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace WeifenLuo.WinFormsUI
{
@ -54,9 +55,12 @@ namespace WeifenLuo.WinFormsUI @@ -54,9 +55,12 @@ namespace WeifenLuo.WinFormsUI
else
StartPosition = FormStartPosition.WindowsDefaultLocation;
m_dummyControl = new DummyControl();
m_dummyControl.Bounds = Rectangle.Empty;
Controls.Add(m_dummyControl);
if (Environment.Version.Major == 1)
{
m_dummyControl = new DummyControl();
m_dummyControl.Bounds = Rectangle.Empty;
Controls.Add(m_dummyControl);
}
m_dockPanel = dockPanel;
Owner = DockPanel.FindForm();
@ -124,7 +128,7 @@ namespace WeifenLuo.WinFormsUI @@ -124,7 +128,7 @@ namespace WeifenLuo.WinFormsUI
get { return DockState == DockState.Float; }
}
private Control m_dummyControl;
private Control m_dummyControl = null;
internal Control DummyControl
{
get { return m_dummyControl; }
@ -133,8 +137,8 @@ namespace WeifenLuo.WinFormsUI @@ -133,8 +137,8 @@ namespace WeifenLuo.WinFormsUI
internal bool IsDockStateValid(DockState dockState)
{
foreach (DockPane pane in DockList)
foreach (DockContent content in pane.Contents)
if (!DockHelper.IsDockStateValid(dockState, content.DockableAreas))
foreach (IDockContent content in pane.Contents)
if (!DockHelper.IsDockStateValid(dockState, content.DockHandler.DockableAreas))
return false;
return true;
@ -167,7 +171,7 @@ namespace WeifenLuo.WinFormsUI @@ -167,7 +171,7 @@ namespace WeifenLuo.WinFormsUI
else if (theOnlyPane.ActiveContent == null)
Text = " ";
else
Text = theOnlyPane.ActiveContent.Text;
Text = theOnlyPane.ActiveContent.DockHandler.TabText;
}
/// <exclude/>
@ -216,17 +220,17 @@ namespace WeifenLuo.WinFormsUI @@ -216,17 +220,17 @@ namespace WeifenLuo.WinFormsUI
DockContentCollection contents = DockList[i].Contents;
for (int j=contents.Count - 1; j>=0; j--)
{
DockContent content = contents[j];
if (content.DockState != DockState.Float)
IDockContent content = contents[j];
if (content.DockHandler.DockState != DockState.Float)
continue;
if (!content.CloseButton)
if (!content.DockHandler.CloseButton)
continue;
if (content.HideOnClose)
content.Hide();
if (content.DockHandler.HideOnClose)
content.DockHandler.Hide();
else
content.Close();
content.DockHandler.Close();
}
}
@ -240,20 +244,29 @@ namespace WeifenLuo.WinFormsUI @@ -240,20 +244,29 @@ namespace WeifenLuo.WinFormsUI
base.WndProc(ref m);
return;
}
Visible = false;
DockPanel.SuspendLayout(true);
// Restore to panel
DockContent activeContent = DockPanel.ActiveContent;
foreach(DockPane pane in DockList)
{
if (pane.DockState != DockState.Float)
continue;
pane.RestoreToPanel();
}
if (activeContent != null)
activeContent.Activate();
DockPanel.ResumeLayout(true, true);
if (Visible != (DisplayingList.Count > 0))
Visible = (DisplayingList.Count > 0);
return;
}
else if (m.Msg == (int)Win32.Msgs.WM_WINDOWPOSCHANGING)
{
int offset = (int)Marshal.OffsetOf(typeof(Win32.WINDOWPOS), "flags");
int flags = Marshal.ReadInt32(m.LParam, offset);
Marshal.WriteInt32(m.LParam, offset, flags | (int)Win32.FlagsSetWindowPos.SWP_NOCOPYBITS);
}
else if (m.Msg == WM_CHECKDISPOSE)
{
if (DockList.Count == 0)
@ -278,11 +291,11 @@ namespace WeifenLuo.WinFormsUI @@ -278,11 +291,11 @@ namespace WeifenLuo.WinFormsUI
DockContentCollection contents = DisplayingList[i].Contents;
for (int j=contents.Count - 1; j>=0; j--)
{
DockContent content = contents[j];
if (content.DockState != DockState.Float)
IDockContent content = contents[j];
if (content.DockHandler.DockState != DockState.Float)
continue;
if (content.CloseButton)
if (content.DockHandler.CloseButton)
{
ControlBox = true;
return;
@ -297,5 +310,17 @@ namespace WeifenLuo.WinFormsUI @@ -297,5 +310,17 @@ namespace WeifenLuo.WinFormsUI
{
get { return ClientRectangle; }
}
internal void TestDrop(DragHandler dragHandler)
{
if (!dragHandler.IsDockStateValid(DockState) ||
DisplayingList.Count != 1)
return;
Point ptMouse = Control.MousePosition;
uint lParam = Win32Helper.MakeLong(ptMouse.X, ptMouse.Y);
if (User32.SendMessage(Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, lParam) == (uint)Win32.HitTest.HTCAPTION)
dragHandler.DockOutline.Show(DisplayingList[0], -1);
}
}
}

87
src/Libraries/DockPanel_Src/WinFormsUI/Docking/HiddenMdiChild.cs

@ -1,87 +0,0 @@ @@ -1,87 +0,0 @@
// *****************************************************************************
//
// Copyright 2004, Weifen Luo
// All rights reserved. The software and associated documentation
// supplied hereunder are the proprietary information of Weifen Luo
// and are supplied subject to licence terms.
//
// WinFormsUI Library Version 1.0
// *****************************************************************************
using System;
using System.Drawing;
using System.Windows.Forms;
namespace WeifenLuo.WinFormsUI
{
internal class HiddenMdiChild : Form
{
private DockContent m_content = null;
internal HiddenMdiChild(DockContent content) : base()
{
SetStyle(ControlStyles.Selectable, false);
if (content == null)
throw(new ArgumentNullException());
Form mdiParent = (content.DockPanel == null) ? null : content.DockPanel.FindForm();
if (mdiParent != null)
if (!mdiParent.IsMdiContainer)
mdiParent = null;
if (mdiParent == null)
throw(new InvalidOperationException());
m_content = content;
Menu = ((Form)content).Menu;
FormBorderStyle = FormBorderStyle.None;
Text = m_content.Text;
SetMdiParent(mdiParent);
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (Menu != null)
((Form)m_content).Menu = Menu;
m_content = null;
}
base.Dispose(disposing);
}
public DockContent Content
{
get { return m_content; }
}
protected override Size DefaultSize
{
get { return new Size(0, 0); }
}
internal void SetMdiParent(Form mdiParent)
{
if (mdiParent == null)
throw(new ArgumentNullException());
MdiParent = mdiParent;
Show();
}
protected override void WndProc(ref Message m)
{
if (m.Msg == (int)Win32.Msgs.WM_MDIACTIVATE && m.HWnd == m.LParam)
Content.Show();
if (m.Msg == (int)Win32.Msgs.WM_CLOSE && Content.DockState == DockState.Document && Content.Pane != null)
{
Content.Pane.CloseContent(Content);
return;
}
base.WndProc(ref m);
}
}
}

7
src/Libraries/DockPanel_Src/WinFormsUI/Docking/Interfaces.cs

@ -13,6 +13,13 @@ using System.Drawing; @@ -13,6 +13,13 @@ using System.Drawing;
namespace WeifenLuo.WinFormsUI
{
/// <include file='CodeDoc\Interfaces.xml' path='//CodeDoc/Interface[@name="IDockContent"]/InterfaceDef/*'/>
public interface IDockContent
{
/// <include file='CodeDoc\Interfaces.xml' path='//CodeDoc/Interface[@name="IDockListContainer"]/Property[@name="DockHandler"]/*'/>
DockContentHandler DockHandler { get; }
}
/// <include file='CodeDoc\Interfaces.xml' path='//CodeDoc/Interface[@name="IDockListContainer"]/InterfaceDef/*'/>
public interface IDockListContainer
{

13
src/Libraries/DockPanel_Src/WinFormsUI/Docking/Measures.cs

@ -12,12 +12,17 @@ using System; @@ -12,12 +12,17 @@ using System;
namespace WeifenLuo.WinFormsUI
{
internal class Measures
{
public const int SplitterSize = 4;
}
internal class MeasurePane
{
public const int DragSize = 4;
public const int MinSize = 24;
}
/*
internal class MeasureDockWindow
{
public const int SplitterSize = 4;
@ -32,9 +37,5 @@ namespace WeifenLuo.WinFormsUI @@ -32,9 +37,5 @@ namespace WeifenLuo.WinFormsUI
{
public const int SplitterSize = 4;
}
internal class MeasureOutline
{
public const int Width = 4;
}
*/
}

54
src/Libraries/DockPanel_Src/WinFormsUI/Docking/SplitterOutline.cs

@ -0,0 +1,54 @@ @@ -0,0 +1,54 @@
// *****************************************************************************
//
// Copyright 2004, Weifen Luo
// All rights reserved. The software and associated documentation
// supplied hereunder are the proprietary information of Weifen Luo
// and are supplied subject to licence terms.
//
// WinFormsUI Library Version 1.0
// *****************************************************************************
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
namespace WeifenLuo.WinFormsUI
{
internal class SplitterOutline
{
public SplitterOutline()
{
m_dragForm = new DragForm();
SetDragForm(Rectangle.Empty);
DragForm.BackColor = Color.Black;
DragForm.Opacity = 0.7;
DragForm.Show(false);
}
DragForm m_dragForm;
private DragForm DragForm
{
get { return m_dragForm; }
}
public void Show(Rectangle rect)
{
SetDragForm(rect);
}
public void Close()
{
DragForm.Close();
}
private void SetDragForm(Rectangle rect)
{
DragForm.Bounds = rect;
if (rect == Rectangle.Empty)
DragForm.Region = new Region(Rectangle.Empty);
else if (DragForm.Region != null)
DragForm.Region = null;
}
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save